
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_3_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_3_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_3_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// My Product stack
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};







var dooabuttonlink;
var dooabuttontarget;

$("#stacks_in_3_page0 .stacks_in_3_page0buttoncontainer").each(function() {
dooabuttonlink = $("a", this).attr("href");
dooabuttonrel = $("a", this).attr("rel");
dooabuttonclass = $("a", this).attr("class");
		$(this).wrap('<a href="'+ dooabuttonlink +'" class="stacks_in_3_page0link '+ dooabuttonclass +'" rel="'+ dooabuttonrel +'"  />');
	});
	

$("#stacks_in_3_page0 .stacks_in_3_page0link").hover(
  function () {
    $("a", this).css("color","#FFFFFF");
  }, 
  function () {
    $("a", this).css("color","#FFFFFF");
  }
);


var itsIE = navigator.userAgent.match(/MSIE 8/i) || navigator.userAgent.match(/MSIE 7/i) != null;

if(itsIE){
$("#stacks_in_3_page0 .outershadow").css({
	"box-shadow": "none", 
    "behavior":"url(" + yourfolder + "files/IPIE.htc)" 
    });
$("#stacks_in_3_page0 .stacks_in_3_page0link:first-child .stacks_in_3_page0buttoncontainer").css({
	"border-radius": "10px 0px 0px 10px",
    "behavior":"url(" + yourfolder + "files/IPIE.htc)" 
    });
$("#stacks_in_3_page0 .stacks_in_3_page0link:last-child .stacks_in_3_page0buttoncontainer").css({
	"border-radius": "0px 10px 10px 0px",
    "behavior":"url(" + yourfolder + "files/IPIE.htc)" 
    });
}    


});



// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// End my producet stack
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	return stack;
})(stacks.stacks_in_3_page0);


// Javascript for stacks_in_7_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_7_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_7_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_7_page0 .stacks_in_7_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_7_page0 .stacks_in_7_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_7_page0 .stacks_in_7_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_7_page0);


// Javascript for stacks_in_12_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_12_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_12_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/*
**
**	GalleryView - jQuery Content Gallery Plugin
**	Author: 		Jack Anderson
**	Version:		2.1 (March 14, 2010)
**	
**	Please use this development script if you intend to make changes to the
**	plugin code.  For production sites, please use jquery.galleryview-2.1-pack.js.
**	
**  See README.txt for instructions on how to markup your HTML
**
**	See CHANGELOG.txt for a review of changes and LICENSE.txt for the applicable
**	licensing information.
**
*/

//Global variable to check if window is already loaded
//Used for calling GalleryView after page has loaded
var window_loaded = false;
			
(function($){
	$.fn.galleryView = function(options) {
		var opts = $.extend($.fn.galleryView.defaults,options);
		
		var id;
		var iterator = 0;		// INT - Currently visible panel/frame
		var item_count = 0;		// INT - Total number of panels/frames
		var slide_method;		// STRING - indicator to slide entire filmstrip or just the pointer ('strip','pointer')
		var theme_path;			// STRING - relative path to theme directory
		var paused = false;		// BOOLEAN - flag to indicate whether automated transitions are active
		
	// Element dimensions
		var gallery_width;
		var gallery_height;
		var pointer_height;
		var pointer_width;
		var strip_width;
		var strip_height;
		var wrapper_width;
		var f_frame_width;
		var f_frame_height;
		var frame_caption_size = 20;
		var gallery_padding;
		var filmstrip_margin;
		var filmstrip_orientation;
		
		
	// Arrays used to scale frames and panels
		var frame_img_scale = {};
		var panel_img_scale = {};
		var img_h = {};
		var img_w = {};
		
	// Flag indicating whether to scale panel images
		var scale_panel_images = true;
		
		var panel_nav_displayed = false;
		
	// Define jQuery objects for reuse
		var j_gallery;
		var j_filmstrip;
		var j_frames;
		var j_frame_img_wrappers;
		var j_panels;
		var j_pointer;
		
		var loader_path = 'files';
		var theme_path = 'files/themes/';
		
/*
**	Plugin Functions
*/

	/*
	**	showItem(int)
	**		Transition from current frame to frame i (1-based index)
	*/
		function showItem(i) {
			// Disable next/prev buttons until transition is complete
			// This prevents overlapping of animations
			$('.nav-next-overlay',j_gallery).unbind('click');
			$('.nav-prev-overlay',j_gallery).unbind('click');
			$('.nav-next',j_gallery).unbind('click');
			$('.nav-prev',j_gallery).unbind('click');
			j_frames.unbind('click');
			
			if(opts.show_filmstrip) {
				// Fade out all frames
				j_frames.removeClass('current').find('img').stop().animate({
					'opacity':opts.frame_opacity
				},opts.transition_speed);
				// Fade in target frame
				j_frames.eq(i).addClass('current').find('img').stop().animate({
					'opacity':1.0
				},opts.transition_speed);
			}
			
			//If necessary, fade out all panels while fading in target panel
			if(opts.show_panels && opts.fade_panels) {
				j_panels.fadeOut(opts.transition_speed).eq(i%item_count).fadeIn(opts.transition_speed,function(){
					//If no filmstrip exists, re-bind click events to navigation buttons
					if(!opts.show_filmstrip) {
						$('.nav-prev-overlay',j_gallery).click(showPrevItem);
						$('.nav-next-overlay',j_gallery).click(showNextItem);
						$('.nav-prev',j_gallery).click(showPrevItem);
						$('.nav-next',j_gallery).click(showNextItem);		
					}
				});
			}
			
			// If gallery has a filmstrip, handle animation of frames
			if(opts.show_filmstrip) {
				// Slide either pointer or filmstrip, depending on transition method
				if(slide_method=='strip') {
					// Stop filmstrip if it's currently in motion
					j_filmstrip.stop();
					var distance;
					var diststr;
					if(filmstrip_orientation=='horizontal') {
						// Determine distance between pointer (eventual destination) and target frame
						distance = getPos(j_frames[i]).left - (getPos(j_pointer[0]).left+(pointer_width/2)-(f_frame_width/2));
						diststr = (distance>=0?'-=':'+=')+Math.abs(distance)+'px';
						
						// Animate filmstrip and slide target frame under pointer
						j_filmstrip.animate({
							'left':diststr
						},opts.transition_speed,opts.easing,function(){
							var old_i = i;
							// After transition is complete, shift filmstrip so that a sufficient number of frames
							// remain on either side of the visible filmstrip
							if(i>item_count) {
								i = i%item_count;
								iterator = i;
								j_filmstrip.css('left','-'+((f_frame_width+opts.frame_gap)*i)+'px');
							} else if (i<=(item_count-strip_size)) {
								i = (i%item_count)+item_count;
								iterator = i;
								j_filmstrip.css('left','-'+((f_frame_width+opts.frame_gap)*i)+'px');
							}
							// If the target frame has changed due to filmstrip shifting,
							// make sure new target frame has 'current' class and correct size/opacity settings
							if(old_i != i) {
								j_frames.eq(old_i).removeClass('current').find('img').css({
									'opacity':opts.frame_opacity
								});
								j_frames.eq(i).addClass('current').find('img').css({
									'opacity':1.0
								});
							}
							// If panels are not set to fade in/out, simply hide all panels and show the target panel
							if(!opts.fade_panels) {
								j_panels.hide().eq(i%item_count).show();
							}
							
							// Once animation is complete, re-bind click events to navigation buttons
							$('.nav-prev-overlay',j_gallery).click(showPrevItem);
							$('.nav-next-overlay',j_gallery).click(showNextItem);
							$('.nav-prev',j_gallery).click(showPrevItem);
							$('.nav-next',j_gallery).click(showNextItem);
							enableFrameClicking();
						});
					} else { // filmstrip_orientation == 'vertical'
						//Determine distance between pointer (eventual destination) and target frame
						distance = getPos(j_frames[i]).top - (getPos(j_pointer[0]).top+(pointer_height)-(f_frame_height/2));
						diststr = (distance>=0?'-=':'+=')+Math.abs(distance)+'px';
						
						// Animate filmstrip and slide target frame under pointer
						j_filmstrip.animate({
							'top':diststr
						},opts.transition_speed,opts.easing,function(){
							// After transition is complete, shift filmstrip so that a sufficient number of frames
							// remain on either side of the visible filmstrip
							var old_i = i;
							if(i>item_count) {
								i = i%item_count;
								iterator = i;
								j_filmstrip.css('top','-'+((f_frame_height+opts.frame_gap)*i)+'px');
							} else if (i<=(item_count-strip_size)) {
								i = (i%item_count)+item_count;
								iterator = i;
								j_filmstrip.css('top','-'+((f_frame_height+opts.frame_gap)*i)+'px');
							}
							//If the target frame has changed due to filmstrip shifting,
							//Make sure new target frame has 'current' class and correct size/opacity settings
							if(old_i != i) {
								j_frames.eq(old_i).removeClass('current').find('img').css({
									'opacity':opts.frame_opacity
								});
								j_frames.eq(i).addClass('current').find('img').css({
									'opacity':1.0
								});
							}
							// If panels are not set to fade in/out, simply hide all panels and show the target panel
							if(!opts.fade_panels) {
								j_panels.hide().eq(i%item_count).show();
							}
							
							// Once animation is complete, re-bind click events to navigation buttons
							$('.nav-prev-overlay',j_gallery).click(showPrevItem);
							$('.nav-next-overlay',j_gallery).click(showNextItem);
							$('.nav-prev',j_gallery).click(showPrevItem);
							$('.nav-next',j_gallery).click(showNextItem);
							enableFrameClicking();
						});
					}
				} else if(slide_method=='pointer') {
					// Stop pointer if it's currently in motion
					j_pointer.stop();
					// Get screen position of target frame
					var pos = getPos(j_frames[i]);
					
					if(filmstrip_orientation=='horizontal') {
						// Slide the pointer over the target frame
						j_pointer.animate({
							'left':(pos.left+(f_frame_width/2)-(pointer_width/2)+'px')
						},opts.transition_speed,opts.easing,function(){	
							if(!opts.fade_panels) {
								j_panels.hide().eq(i%item_count).show();
							}	
							$('.nav-prev-overlay',j_gallery).click(showPrevItem);
							$('.nav-next-overlay',j_gallery).click(showNextItem);
							$('.nav-prev',j_gallery).click(showPrevItem);
							$('.nav-next',j_gallery).click(showNextItem);
							enableFrameClicking();
						});
					} else {
						// Slide the pointer over the target frame
						j_pointer.animate({
							'top':(pos.top+(f_frame_height/2)-(pointer_height)+'px')
						},opts.transition_speed,opts.easing,function(){	
							if(!opts.fade_panels) {
								j_panels.hide().eq(i%item_count).show();
							}	
							$('.nav-prev-overlay',j_gallery).click(showPrevItem);
							$('.nav-next-overlay',j_gallery).click(showNextItem);
							$('.nav-prev',j_gallery).click(showPrevItem);
							$('.nav-next',j_gallery).click(showNextItem);
							enableFrameClicking();
						});
					}
				}
			
			}
		};
		
	/*
	**	extraWidth(jQuery element)
	**		Return the combined width of the border and padding to the elements left and right.
	**		If the border is non-numerical, assume zero (not ideal, will fix later)
	**		RETURNS - int
	*/
		function extraWidth(el) {
			if(!el) { return 0; }
			if(el.length==0) { return 0; }
			el = el.eq(0);
			var ew = 0;
			ew += getInt(el.css('paddingLeft'));
			ew += getInt(el.css('paddingRight'));
			ew += getInt(el.css('borderLeftWidth'));
			ew += getInt(el.css('borderRightWidth'));
			return ew;
		};
		
	/*
	**	extraHeight(jQuery element)
	**		Return the combined height of the border and padding above and below the element
	**		If the border is non-numerical, assume zero (not ideal, will fix later)
	**		RETURN - int
	*/
		function extraHeight(el) {
			if(!el) { return 0; }
			if(el.length==0) { return 0; }
			el = el.eq(0);
			var eh = 0;
			eh += getInt(el.css('paddingTop'));
			eh += getInt(el.css('paddingBottom'));
			eh += getInt(el.css('borderTopWidth'));
			eh += getInt(el.css('borderBottomWidth'));
			return eh;
		};
	
	/*
	**	showNextItem()
	**		Transition from current frame to next frame
	*/
		function showNextItem() {
			
			// Cancel any transition timers until we have completed this function
			$(document).stopTime("transition");
			if(++iterator==j_frames.length) {iterator=0;}
			// We've already written the code to transition to an arbitrary panel/frame, so use it
			showItem(iterator);
			// If automated transitions haven't been cancelled by an option or paused on hover, re-enable them
			if(!paused) {
				$(document).everyTime(opts.transition_interval,"transition",function(){
					showNextItem();
				});
			}
		};
		
	/*
	**	showPrevItem()
	**		Transition from current frame to previous frame
	*/
		function showPrevItem() {
			// Cancel any transition timers until we have completed this function
			$(document).stopTime("transition");
			if(--iterator<0) {iterator = item_count-1;}
			// We've already written the code to transition to an arbitrary panel/frame, so use it
			showItem(iterator);
			// If automated transitions haven't been cancelled by an option or paused on hover, re-enable them
			if(!paused) {
				$(document).everyTime(opts.transition_interval,"transition",function(){
					showNextItem();
				});
			}
		};
		
	/*
	**	getPos(jQuery element
	**		Calculate position of an element relative to top/left corner of gallery
	**		If the gallery bounding box itself is passed to the function, calculate position of gallery relative to top/left corner of browser window
	** 		RETURNS - JSON {left: int, top: int}
	*/
		function getPos(el) {
			var left = 0, top = 0;
			var el_id = el.id;
			if(el.offsetParent) {
				do {
					left += el.offsetLeft;
					top += el.offsetTop;
				} while(el = el.offsetParent);
			}
			//If we want the position of the gallery itself, return it
			if(el_id == id) {return {'left':left,'top':top};}
			//Otherwise, get position of element relative to gallery
			else {
				var gPos = getPos(j_gallery[0]);
				var gLeft = gPos.left;
				var gTop = gPos.top;
				
				return {'left':left-gLeft,'top':top-gTop};
			}
		};
	
	/*
	**	enableFrameClicking()
	**		Add an onclick event handler to each frame
	**		Exception: if a frame has an anchor tag, do not add an onlick handler
	*/
		function enableFrameClicking() {
			j_frames.each(function(i){
				if($('a',this).length==0) {
					$(this).click(function(){
						// Prevent transitioning to the current frame (unnecessary)
						if(iterator!=i) {
							$(document).stopTime("transition");
							showItem(i);
							iterator = i;
							if(!paused) {
								$(document).everyTime(opts.transition_interval,"transition",function(){
									showNextItem();
								});
							}
						}
					});
				}
			});
		};
	
	/*
	**	buildPanels()
	**		Construct gallery panels from <div class="panel"> elements
	**		NOTE - These DIVs are generated automatically from the content of the UL passed to the plugin
	*/
		function buildPanels() {
			// If panel overlay content exists, add the necessary overlay background DIV
			// The overlay content and background are separate elements so the background's opacity isn't inherited by the content
			j_panels.each(function(i){
		   		if($('.panel-overlay',this).length>0) {
					$(this).append('<div class="overlay-background"></div>');	
				}
		   	});
			// If there is no filmstrip in this gallery, add navigation buttons to the panel itself
			if(!opts.show_filmstrip) {
				$('<img />').addClass('nav-next').attr('src',theme_path+'next'+opts.nav_theme+'.gif').appendTo(j_gallery).css({ // Mod MS
					'position':'absolute',
					'zIndex':'1100',
					'cursor':'pointer',
					'top':((opts.panel_height-22)/2)+gallery_padding+'px',
					'right':'10px',
					'display':'none'
				}).click(showNextItem);
				$('<img />').addClass('nav-prev').attr('src',theme_path+'prev'+opts.nav_theme+'.gif').appendTo(j_gallery).css({ // Mod MS
					'position':'absolute',
					'zIndex':'1100',
					'cursor':'pointer',
					'top':((opts.panel_height-22)/2)+gallery_padding+'px',
					'left':'10px',
					'display':'none'
				}).click(showPrevItem);
				
				$('<img />').addClass('nav-next-overlay').attr('src',theme_path+'panel-nav-next'+opts.nav_theme+'.gif').appendTo(j_gallery).css({ // Mod MS
					'position':'absolute',
					'zIndex':'1099',
					'top':((opts.panel_height-22)/2)+gallery_padding-10+'px',
					'right':'0',
					'display':'none',
					'cursor':'pointer',
					'opacity':0.75
				}).click(showNextItem);
				
				$('<img />').addClass('nav-prev-overlay').attr('src',theme_path+'panel-nav-prev'+opts.nav_theme+'.gif').appendTo(j_gallery).css({ // Mod MS
					'position':'absolute',
					'zIndex':'1099',
					'top':((opts.panel_height-22)/2)+gallery_padding-10+'px',
					'left':'0',
					'display':'none',
					'cursor':'pointer',
					'opacity':0.75
				}).click(showPrevItem);
			}
			// Set the height and width of each panel, and position it appropriately within the gallery
			j_panels.each(function(i){
				$(this).css({
					'width':(opts.panel_width-extraWidth(j_panels))+'px',
					'height':(opts.panel_height-extraHeight(j_panels))+'px',
					'position':'absolute',
					'overflow':'hidden',
					'display':'none'
				});
				switch(opts.filmstrip_position) {
					case 'top': $(this).css({
									'top':strip_height+Math.max(gallery_padding,filmstrip_margin)+'px',
									'left':gallery_padding+'px'
								}); break;
					case 'left': $(this).css({
								 	'top':gallery_padding+'px',
									'left':strip_width+Math.max(gallery_padding,filmstrip_margin)+'px'
								 }); break;
					default: $(this).css({'top':gallery_padding+'px','left':gallery_padding+'px'}); break;
				}
			});
			// Position each panel overlay within panel
			$('.panel-overlay',j_panels).css({
				'position':'absolute',
				'zIndex':'999',
				'width':(opts.panel_width-extraWidth($('.panel-overlay',j_panels)))+'px',
				'left':'0'
			});
			$('.overlay-background',j_panels).css({
				'position':'absolute',
				'zIndex':'998',
				'width':opts.panel_width+'px',
				'left':'0',
				'opacity':opts.overlay_opacity
			});
			if(opts.overlay_position=='top') {
				$('.panel-overlay',j_panels).css('top',0);
				$('.overlay-background',j_panels).css('top',0);
			} else {
				$('.panel-overlay',j_panels).css('bottom',0);
				$('.overlay-background',j_panels).css('bottom',0);
			}
			
			$('.panel iframe',j_panels).css({
				'width':opts.panel_width+'px',
				'height':opts.panel_height+'px',
				'border':'0'
			});
			
			// If panel images have to be scaled to fit within frame, do so and position them accordingly
			if(scale_panel_images) {
				$('img',j_panels).each(function(i){
					$(this).css({
						'height':panel_img_scale[i%item_count]*img_h[i%item_count],
						'width':panel_img_scale[i%item_count]*img_w[i%item_count],
						'position':'relative',
						'top':(opts.panel_height-(panel_img_scale[i%item_count]*img_h[i%item_count]))/2+'px',
						'left':(opts.panel_width-(panel_img_scale[i%item_count]*img_w[i%item_count]))/2+'px'
					});
				});
			}
		};
	
	/*
	**	buildFilmstrip()
	**		Construct filmstrip from <ul class="filmstrip"> element
	**		NOTE - 'filmstrip' class is automatically added to UL passed to plugin
	*/
		function buildFilmstrip() {
			// Add wrapper to filmstrip to hide extra frames
			j_filmstrip.wrap('<div class="strip_wrapper"></div>');
			if(slide_method=='strip') {
				j_frames.clone().appendTo(j_filmstrip);
				j_frames.clone().appendTo(j_filmstrip);
				j_frames = $('li',j_filmstrip);
			}
			// If captions are enabled, add caption DIV to each frame and fill with the image titles
			if(opts.show_captions) {
				j_frames.append('<div class="caption"></div>').each(function(i){
					$(this).find('.caption').html($(this).find('img').attr('title'));	
					//$(this).find('.caption').html(i);		
				});
			}
			// Position the filmstrip within the gallery
			j_filmstrip.css({
				'listStyle':'none',
				'margin':'0',
				'padding':'0',
				'width':strip_width+'px',
				'position':'absolute',
				'zIndex':'900',
				'top':(filmstrip_orientation=='vertical' && slide_method=='strip'?-((f_frame_height+opts.frame_gap)*iterator):0)+'px',
				'left':(filmstrip_orientation=='horizontal' && slide_method=='strip'?-((f_frame_width+opts.frame_gap)*iterator):0)+'px',
				'height':strip_height+'px'
			});
			j_frames.css({
				'float':'left',
				'position':'relative',
				'height':f_frame_height+(opts.show_captions?frame_caption_size:0)+'px',
				'width':f_frame_width+'px',
				'zIndex':'901',
				'padding':'0',
				'cursor':'pointer'
			});
			// Set frame margins based on user options and position of filmstrip within gallery
			
			if(opts.show_filmstrip) { //MS
			switch(opts.filmstrip_position) {
				case 'top': j_frames.css({
								'marginBottom':filmstrip_margin+'px',
								'marginRight':opts.frame_gap+'px'
							}); break;
				case 'bottom': j_frames.css({
								'marginTop':filmstrip_margin+'px',
								'marginRight':opts.frame_gap+'px'
							}); break;
				case 'left': j_frames.css({
								'marginRight':filmstrip_margin+'px',
								'marginBottom':opts.frame_gap+'px'
							}); break;
				case 'right': j_frames.css({
								'marginLeft':filmstrip_margin+'px',
								'marginBottom':opts.frame_gap+'px'
							}); break;
			}
			} //MS
			// Apply styling to individual image wrappers. These will eventually hide overflow in the case of cropped filmstrip images
			$('.img_wrap',j_frames).each(function(i){								  
				$(this).css({
					'height':Math.min(opts.frame_height,img_h[i%item_count]*frame_img_scale[i%item_count])+'px',
					'width':Math.min(opts.frame_width,img_w[i%item_count]*frame_img_scale[i%item_count])+'px',
					'position':'relative',
					'top':(opts.show_captions && opts.filmstrip_position=='top'?frame_caption_size:0)+Math.max(0,(opts.frame_height-(frame_img_scale[i%item_count]*img_h[i%item_count]))/2)+'px',
					'left':Math.max(0,(opts.frame_width-(frame_img_scale[i%item_count]*img_w[i%item_count]))/2)+'px',
					'overflow':'hidden'
				});
			});
			// Scale each filmstrip image if necessary and position it within the image wrapper
			$('img',j_frames).each(function(i){
				$(this).css({
					'opacity':opts.frame_opacity,
					'height':img_h[i%item_count]*frame_img_scale[i%item_count]+'px',
					'width':img_w[i%item_count]*frame_img_scale[i%item_count]+'px',
					'position':'relative',
					'top':Math.min(0,(opts.frame_height-(frame_img_scale[i%item_count]*img_h[i%item_count]))/2)+'px',
					'left':Math.min(0,(opts.frame_width-(frame_img_scale[i%item_count]*img_w[i%item_count]))/2)+'px'
	
				}).mouseover(function(){
					$(this).stop().animate({'opacity':1.0},300);
				}).mouseout(function(){
					//Don't fade out current frame on mouseout
					if(!$(this).parent().parent().hasClass('current')) { $(this).stop().animate({'opacity':opts.frame_opacity},300); }
				});
			});
			// Set overflow of filmstrip wrapper to hidden so as to hide frames that don't fit within the gallery
			$('.strip_wrapper',j_gallery).css({
				'position':'absolute',
				'overflow':'hidden'
			});
			// Position filmstrip within gallery based on user options
			if(filmstrip_orientation=='horizontal') {
				$('.strip_wrapper',j_gallery).css({
					'top':(opts.filmstrip_position=='top'?Math.max(gallery_padding,filmstrip_margin)+'px':opts.panel_height+gallery_padding+'px'),
					'left':((gallery_width-wrapper_width)/2)+gallery_padding+'px',
					'width':wrapper_width+'px',
					'height':strip_height+'px'
				});
			} else {
				$('.strip_wrapper',j_gallery).css({
					'left':(opts.filmstrip_position=='left'?Math.max(gallery_padding,filmstrip_margin)+'px':opts.panel_width+gallery_padding+'px'),
					'top':Math.max(gallery_padding,opts.frame_gap)+'px',
					'width':strip_width+'px',
					'height':wrapper_height+'px'
				});
			}
			// Style frame captions
			$('.caption',j_gallery).css({
				'position':'absolute',
				'top':(opts.filmstrip_position=='bottom'?f_frame_height:0)+'px',
				'left':'0',
				'margin':'0',
				'width':f_frame_width+'px',
				'padding':'0',
				'height':frame_caption_size+'px',
				'overflow':'hidden',
				'lineHeight':frame_caption_size+'px'
			});
			// Create pointer for current frame
			var pointer = $('<div></div>');
			pointer.addClass('pointer').appendTo(j_gallery).css({
				 'position':'absolute',
				 'zIndex':'1000',
				 'width':'0px',
				 'fontSize':'0px',
				 'lineHeight':'0%',
				 'borderTopWidth':pointer_height+'px',
				 'borderRightWidth':(pointer_width/2)+'px',
				 'borderBottomWidth':pointer_height+'px',
				 'borderLeftWidth':(pointer_width/2)+'px',
				 'borderStyle':'solid'
			});
			
			// For IE6, use predefined color string in place of transparent (IE6 bug fix, see stylesheet)
			var transColor = $.browser.msie && $.browser.version.substr(0,1)=='6' ? 'pink' : 'transparent';
			
			// If there are no panels, make pointer transparent (nothing to point to)
			// This is not the optimal solution, but we need the pointer to exist as a reference for transition animations
			if(!opts.show_panels) { pointer.css('borderColor',transColor); }
		
				switch(opts.filmstrip_position) {
					case 'top': pointer.css({
									'bottom':(opts.panel_height-(pointer_height*2)+gallery_padding+filmstrip_margin)+'px',
				 					'left':((gallery_width-wrapper_width)/2)+(slide_method=='strip'?0:((f_frame_width+opts.frame_gap)*iterator))+((f_frame_width/2)-(pointer_width/2))+gallery_padding+'px',
									'borderBottomColor':transColor,
									'borderRightColor':transColor,
									'borderLeftColor':transColor
								}); break;
					case 'bottom': pointer.css({
										'top':(opts.panel_height-(pointer_height*2)+gallery_padding+filmstrip_margin)+'px',
				 						'left':((gallery_width-wrapper_width)/2)+(slide_method=='strip'?0:((f_frame_width+opts.frame_gap)*iterator))+((f_frame_width/2)-(pointer_width/2))+gallery_padding+'px',
										'borderTopColor':transColor,
										'borderRightColor':transColor,
										'borderLeftColor':transColor
									}); break;
					case 'left': pointer.css({
									'right':(opts.panel_width-pointer_width+gallery_padding+filmstrip_margin)+'px',
				 					'top':(f_frame_height/2)-(pointer_height)+(slide_method=='strip'?0:((f_frame_height+opts.frame_gap)*iterator))+gallery_padding+'px',
									'borderBottomColor':transColor,
									'borderRightColor':transColor,
									'borderTopColor':transColor
								}); break;
					case 'right': pointer.css({
									'left':(opts.panel_width-pointer_width+gallery_padding+filmstrip_margin)+'px',
				 					'top':(f_frame_height/2)-(pointer_height)+(slide_method=='strip'?0:((f_frame_height+opts.frame_gap)*iterator))+gallery_padding+'px',
									'borderBottomColor':transColor,
									'borderLeftColor':transColor,
									'borderTopColor':transColor
								}); break;
				}
		
			j_pointer = $('.pointer',j_gallery);
			
			// Add navigation buttons
			var navNext = $('<img />');
			navNext.addClass('nav-next').attr('src',theme_path+'next'+opts.nav_theme+'.gif').appendTo(j_gallery).css({ // Mod MS
				'position':'absolute',
				'cursor':'pointer'
			}).click(showNextItem);
			var navPrev = $('<img />');
			navPrev.addClass('nav-prev').attr('src',theme_path+'prev'+opts.nav_theme+'.gif').appendTo(j_gallery).css({ // Mod MS
				'position':'absolute',
				'cursor':'pointer'
			}).click(showPrevItem);
			if(filmstrip_orientation=='horizontal') {
				navNext.css({					 
					'top':(opts.filmstrip_position=='top'?Math.max(gallery_padding,filmstrip_margin):opts.panel_height+filmstrip_margin+gallery_padding)+((f_frame_height-22)/2)+'px',
					'right':((gallery_width+(gallery_padding*2))/2)-(wrapper_width/2)-opts.frame_gap-22+'px'
				});
				navPrev.css({
					'top':(opts.filmstrip_position=='top'?Math.max(gallery_padding,filmstrip_margin):opts.panel_height+filmstrip_margin+gallery_padding)+((f_frame_height-22)/2)+'px',
					'left':((gallery_width+(gallery_padding*2))/2)-(wrapper_width/2)-opts.frame_gap-22+'px'
				 });
			} else {
				navNext.css({					 
					'left':(opts.filmstrip_position=='left'?Math.max(gallery_padding,filmstrip_margin):opts.panel_width+filmstrip_margin+gallery_padding)+((f_frame_width-22)/2)+13+'px',
					'top':wrapper_height+(Math.max(gallery_padding,opts.frame_gap)*2)+'px'
				});
				navPrev.css({
					'left':(opts.filmstrip_position=='left'?Math.max(gallery_padding,filmstrip_margin):opts.panel_width+filmstrip_margin+gallery_padding)+((f_frame_width-22)/2)-13+'px',
					'top':wrapper_height+(Math.max(gallery_padding,opts.frame_gap)*2)+'px'
				});
			}
		};
	
	/*
	**	mouseIsOverGallery(int,int)
	**		Check to see if mouse coordinates lie within borders of gallery
	**		This is a more reliable method than using the mouseover event
	**		RETURN - boolean
	*/
		function mouseIsOverGallery(x,y) {		
			var pos = getPos(j_gallery[0]);
			var top = pos.top;
			var left = pos.left;
			return x > left && x < left+gallery_width+(filmstrip_orientation=='horizontal'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin)) && y > top && y < top+gallery_height+(filmstrip_orientation=='vertical'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin));				
		};
	
	/*
	**	getInt(string)
	**		Parse a string to obtain the integer value contained
	**		If the string contains no number, return zero
	**		RETURN - int
	*/
		function getInt(i) {
			i = parseInt(i,10);
			if(isNaN(i)) { i = 0; }
			return i;	
		};
	
	/*
	**	buildGallery()
	**		Construct HTML and CSS for the gallery, based on user options
	*/
		function buildGallery() {
			var gallery_images = opts.show_filmstrip?$('img',j_frames):$('img',j_panels);
			// For each image in the gallery, add its original dimensions and scaled dimensions to the appropriate arrays for later reference
			gallery_images.each(function(i){
				img_h[i] = this.height;
				img_w[i] = this.width;
				if(opts.frame_scale=='nocrop') {
					frame_img_scale[i] = Math.min(opts.frame_height/img_h[i],opts.frame_width/img_w[i]);
				} else {
					frame_img_scale[i] = Math.max(opts.frame_height/img_h[i],opts.frame_width/img_w[i]);
				}
				
				if(opts.panel_scale=='nocrop') {
					panel_img_scale[i] = Math.min(opts.panel_height/img_h[i],opts.panel_width/img_w[i]);
				} else {
					panel_img_scale[i] = Math.max(opts.panel_height/img_h[i],opts.panel_width/img_w[i]);
				}
			});
			
			// Size gallery based on position of filmstrip
			if(opts.show_filmstrip)
			{
			j_gallery.css({
				'position':'relative',
				'width':gallery_width+(filmstrip_orientation=='horizontal'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin))+'px',
				'height':gallery_height+(filmstrip_orientation=='vertical'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin))+'px'
			});
			}
			else {
			j_gallery.css({
				'position':'relative',
				'width':gallery_width +'px',
				'height':gallery_height +'px'
				});			
			}
			
			// Build filmstrip if necessary
			if(opts.show_filmstrip) {
				buildFilmstrip();
				enableFrameClicking();
			}
			
			// Build panels if necessary
			if(opts.show_panels) {
				buildPanels();
			}
			
			// If user opts to pause on hover, or no filmstrip exists, add some mouseover functionality
			if(opts.pause_on_hover || (opts.show_panels && !opts.show_filmstrip)) {
				$(document).mousemove(function(e){
					if(mouseIsOverGallery(e.pageX,e.pageY)) {
						// If the user opts to pause on hover, kill automated transitions
						if(opts.pause_on_hover) {
							if(!paused) {
								// Pause slideshow in 500ms
								$(document).oneTime(500,"animation_pause",function(){
									$(document).stopTime("transition");
									paused=true;
								});
							}
						}
						// Display panel navigation on mouseover
						if(opts.show_panels && !opts.show_filmstrip && !panel_nav_displayed) {
							$('.nav-next-overlay').fadeIn('fast');
							$('.nav-prev-overlay').fadeIn('fast');
							$('.nav-next',j_gallery).fadeIn('fast');
							$('.nav-prev',j_gallery).fadeIn('fast');
							panel_nav_displayed = true;
						}
					} else {
						// If the mouse leaves the gallery, stop the pause timer and restart automated transitions
						if(opts.pause_on_hover) {
							$(document).stopTime("animation_pause");
							if(paused) {
								$(document).everyTime(opts.transition_interval,"transition",function(){
									showNextItem();
								});
								paused = false;
							}
						}
						// Hide panel navigation
						if(opts.show_panels && !opts.show_filmstrip && panel_nav_displayed) {
							$('.nav-next-overlay').fadeOut('fast');
							$('.nav-prev-overlay').fadeOut('fast');
							$('.nav-next',j_gallery).fadeOut('fast');
							$('.nav-prev',j_gallery).fadeOut('fast');
							panel_nav_displayed = false;
						}
					}
				});
			}
			
			// Hide loading box and display gallery
			j_filmstrip.css('visibility','visible');
			j_gallery.css('visibility','visible');
			$('.loader',j_gallery).fadeOut('1000',function(){
				// Show the 'first' panel (set by opts.start_frame)
				showItem(iterator);
				// If we have more than one item, begin automated transitions
				if(item_count > 1) {
					$(document).everyTime(opts.transition_interval,"transition",function(){
						showNextItem();
					});
				}	
			});	
		};
		
	/*
	**	MAIN PLUGIN CODE
	*/
		return this.each(function() {
			//Hide the unstyled UL until we've created the gallery
			$(this).css('visibility','hidden');
			
			// Wrap UL in DIV and transfer ID to container DIV
			$(this).wrap("<div></div>");
			j_gallery = $(this).parent();
			j_gallery.css('visibility','hidden').attr('id',$(this).attr('id')).addClass('gallery');
			
			// Assign filmstrip class to UL
			$(this).removeAttr('id').addClass('filmstrip');
			
			// If the transition or pause timers exist for any reason, stop them now.
			$(document).stopTime("transition");
			$(document).stopTime("animation_pause");
			
			// Save the id of the UL passed to the plugin
			id = j_gallery.attr('id');
			
			// If the UL does not contain any <div class="panel-content"> elements, we will scale the UL images to fill the panels
			scale_panel_images = $('.panel-content',j_gallery).length==0;
			
			// Define dimensions of pointer <div>
			pointer_height = opts.pointer_size;
			pointer_width = opts.pointer_size*2;
			
			// Determine filmstrip orientation (vertical or horizontal)
			// Do not show captions on vertical filmstrips (override user set option)
			filmstrip_orientation = (opts.filmstrip_position=='top'||opts.filmstrip_position=='bottom'?'horizontal':'vertical');
			if(filmstrip_orientation=='vertical') { opts.show_captions = false; }
			
			// Determine path between current page and plugin images
			// Scan script tags and look for path to GalleryView plugin
/*			$('script').each(function(i){
				var s = $(this);
				if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
					loader_path = s.attr('src').split('jquery.galleryview')[0];
					theme_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';	
				}
			});
*/
			
			// Assign elements to variables to minimize calls to jQuery
			j_filmstrip = $('.filmstrip',j_gallery);
			j_frames = $('li',j_filmstrip);
			j_frames.addClass('frame');
			
			// If the user wants panels, generate them using the filmstrip images
			if(opts.show_panels) {
				for(i=j_frames.length-1;i>=0;i--) {
					if(j_frames.eq(i).find('.panel-content').length>0) {
						j_frames.eq(i).find('.panel-content').remove().prependTo(j_gallery).addClass('panel');
					} else {
						p = $('<div>');
						p.addClass('panel');
						im = $('<img />');
						im.attr('src',j_frames.eq(i).find('img').eq(0).attr('src')).attr('alt',i).appendTo(p);
						p.prependTo(j_gallery);
						j_frames.eq(i).find('.panel-overlay').remove().appendTo(p);
					}
				}
			} else { 
				$('.panel-overlay',j_frames).remove(); 
				$('.panel-content',j_frames).remove();
			}
			
			// If the user doesn't want a filmstrip, delete it
			if(!opts.show_filmstrip) { j_filmstrip.remove(); }
			else {
				// Wrap the frame images (and links, if applicable) in container divs
				// These divs will handle cropping and zooming of the images
				j_frames.each(function(i){
					if($(this).find('a').length>0) {
						$(this).find('a').wrap('<div class="img_wrap"></div>');
					} else {
						$(this).find('img').wrap('<div class="img_wrap"></div>');	
					}
				});
				j_frame_img_wrappers = $('.img_wrap',j_frames);
			}
			
			j_panels = $('.panel',j_gallery);
			
			if(!opts.show_panels) {
				opts.panel_height = 0;
				opts.panel_width = 0;
			}
			
			
			// Determine final frame dimensions, accounting for user-added padding and border
			f_frame_width = opts.frame_width+extraWidth(j_frame_img_wrappers);
			f_frame_height = opts.frame_height+extraHeight(j_frame_img_wrappers);
			
			// Number of frames in filmstrip
			item_count = opts.show_panels?j_panels.length:j_frames.length;
			
			// Number of frames that can display within the gallery block
			// 64 = width of block for navigation button * 2 + 20
			if(filmstrip_orientation=='horizontal') {
				strip_size = opts.show_panels?Math.floor((opts.panel_width-((opts.frame_gap+22)*2))/(f_frame_width+opts.frame_gap)):Math.min(item_count,opts.filmstrip_size); 
			} else {
				strip_size = opts.show_panels?Math.floor((opts.panel_height-(opts.frame_gap+22))/(f_frame_height+opts.frame_gap)):Math.min(item_count,opts.filmstrip_size);
			}
			
			// Determine animation method for filmstrip
			// If more items than strip size, slide filmstrip
			// Otherwise, slide pointer
			if(strip_size >= item_count) {
				slide_method = 'pointer';
				strip_size = item_count;
			}
			else {slide_method = 'strip';}
			
			iterator = (strip_size<item_count?item_count:0)+opts.start_frame-1;
			
			// Determine dimensions of various gallery elements
			filmstrip_margin = (opts.show_panels?getInt(j_filmstrip.css('marginTop')):0);
			j_filmstrip.css('margin','0px');
			
			if(filmstrip_orientation=='horizontal') {
				// Width of gallery block
				gallery_width = opts.show_panels?opts.panel_width:(strip_size*(f_frame_width+opts.frame_gap))+44+opts.frame_gap;
				
				// Height of gallery block = screen + filmstrip + captions (optional)
				gallery_height = (opts.show_panels?opts.panel_height:0)+(opts.show_filmstrip?f_frame_height+filmstrip_margin+(opts.show_captions?frame_caption_size:0):0);
			} else {
				// Width of gallery block
				gallery_height = opts.show_panels?opts.panel_height:(strip_size*(f_frame_height+opts.frame_gap))+22;
				
				// Height of gallery block = screen + filmstrip + captions (optional)
				gallery_width = (opts.show_panels?opts.panel_width:0)+(opts.show_filmstrip?f_frame_width+filmstrip_margin:0);
			}
			if(opts.show_filmstrip) { //MS
			// Width of filmstrip
			if(filmstrip_orientation=='horizontal') {
				if(slide_method == 'pointer') {strip_width = (f_frame_width*item_count)+(opts.frame_gap*(item_count));}
				else {strip_width = (f_frame_width*item_count*3)+(opts.frame_gap*(item_count*3));}
			} else {
				strip_width = (f_frame_width+filmstrip_margin);
			}
			if(filmstrip_orientation=='horizontal') {
				strip_height = (f_frame_height+filmstrip_margin+(opts.show_captions?frame_caption_size:0));	
			} else {
				if(slide_method == 'pointer') {strip_height = (f_frame_height*item_count+opts.frame_gap*(item_count));}
				else {strip_height = (f_frame_height*item_count*3)+(opts.frame_gap*(item_count*3));}
			}
			
			// Width of filmstrip wrapper (to hide overflow)
			wrapper_width = ((strip_size*f_frame_width)+((strip_size-1)*opts.frame_gap));
			wrapper_height = ((strip_size*f_frame_height)+((strip_size-1)*opts.frame_gap));
			} // MS
			
			gallery_padding = getInt(j_gallery.css('paddingTop'));
			j_gallery.css('padding','0px');

			// Place loading box over gallery until page loads
			galleryPos = getPos(j_gallery[0]);
			$('<div>').addClass('loader').css({
				'position':'absolute',
				'zIndex':'32666',
				'opacity':1,
				'top':'0px',
				'left':'0px',
				'width':gallery_width+(filmstrip_orientation=='horizontal'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin))+'px',
				'height':gallery_height+(filmstrip_orientation=='vertical'?(gallery_padding*2):gallery_padding+Math.max(gallery_padding,filmstrip_margin))+'px'
			}).appendTo(j_gallery);
					
			// Don't call the buildGallery function until the window is loaded
			// NOTE - lazy way of waiting until all images are loaded, may find a better solution for future versions
			if(!window_loaded) {
				$(window).load(function(){
					window_loaded = true;
					buildGallery();
				});
			} else {
				buildGallery();
			}
					
		});
	};
	
/*
**	GalleryView options and default values
*/
	$.fn.galleryView.defaults = {
		
		show_panels: true,					//BOOLEAN - flag to show or hide panel portion of gallery
		show_filmstrip: true,				//BOOLEAN - flag to show or hide filmstrip portion of gallery
		
		panel_width: 600,					//INT - width of gallery panel (in pixels)
		panel_height: 400,					//INT - height of gallery panel (in pixels)
		frame_width: 60,					//INT - width of filmstrip frames (in pixels)
		frame_height: 40,					//INT - width of filmstrip frames (in pixels)
		
		start_frame: 1,						//INT - index of panel/frame to show first when gallery loads
		filmstrip_size: 3,					
		transition_speed: 800,				//INT - duration of panel/frame transition (in milliseconds)
		transition_interval: 4000,			//INT - delay between panel/frame transitions (in milliseconds)
		
		overlay_opacity: 0.7,				//FLOAT - transparency for panel overlay (1.0 = opaque, 0.0 = transparent)
		frame_opacity: 0.3,					//FLOAT - transparency of non-active frames (1.0 = opaque, 0.0 = transparent)
		
		pointer_size: 8,					//INT - Height of frame pointer (in pixels)
		
		nav_theme: 'dark',					//STRING - name of navigation theme to use (folder must exist within 'themes' directory)
		easing: 'swing',					//STRING - easing method to use for animations (jQuery provides 'swing' or 'linear', more available with jQuery UI or Easing plugin)
		
		filmstrip_position: 'bottom',		//STRING - position of filmstrip within gallery (bottom, top, left, right)
		overlay_position: 'bottom',			//STRING - position of panel overlay (bottom, top, left, right)
		
		panel_scale: 'nocrop',				//STRING - cropping option for panel images (crop = scale image and fit to aspect ratio determined by panel_width and panel_height, nocrop = scale image and preserve original aspect ratio)
		frame_scale: 'crop',				//STRING - cropping option for filmstrip images (same as above)
		
		frame_gap: 5,						//INT - spacing between frames within filmstrip (in pixels)
		
		show_captions: false,				//BOOLEAN - flag to show or hide frame captions
		fade_panels: true,					//BOOLEAN - flag to fade panels during transitions or swap instantly
		pause_on_hover: false				//BOOLEAN - flag to pause slideshow when user hovers over the gallery
	};
})(jQuery);
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */
/**
 * jQuery.timers - Timer abstractions for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/10/16
 *
 * @author Blair Mitchelmore
 * @version 1.2
 *
 **/

jQuery.fn.extend({
	everyTime: function(interval, label, fn, times) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, times);
		});
	},
	oneTime: function(interval, label, fn) {
		return this.each(function() {
			jQuery.timer.add(this, interval, label, fn, 1);
		});
	},
	stopTime: function(label, fn) {
		return this.each(function() {
			jQuery.timer.remove(this, label, fn);
		});
	}
});

jQuery.extend({
	timer: {
		global: [],
		guid: 1,
		dataKey: "jQuery.timer",
		regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
		powers: {
			// Yeah this is major overkill...
			'ms': 1,
			'cs': 10,
			'ds': 100,
			's': 1000,
			'das': 10000,
			'hs': 100000,
			'ks': 1000000
		},
		timeParse: function(value) {
			if (value == undefined || value == null)
				return null;
			var result = this.regex.exec(jQuery.trim(value.toString()));
			if (result[2]) {
				var num = parseFloat(result[1]);
				var mult = this.powers[result[2]] || 1;
				return num * mult;
			} else {
				return value;
			}
		},
		add: function(element, interval, label, fn, times) {
			var counter = 0;

			if (jQuery.isFunction(label)) {
				if (!times) 
					times = fn;
				fn = label;
				label = interval;
			}

			interval = jQuery.timer.timeParse(interval);

			if (typeof interval != 'number' || isNaN(interval) || interval < 0)
				return;

			if (typeof times != 'number' || isNaN(times) || times < 0) 
				times = 0;

			times = times || 0;

			var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});

			if (!timers[label])
				timers[label] = {};

			fn.timerID = fn.timerID || this.guid++;

			var handler = function() {
				if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
					jQuery.timer.remove(element, label, fn);
			};

			handler.timerID = fn.timerID;

			if (!timers[label][fn.timerID])
				timers[label][fn.timerID] = window.setInterval(handler,interval);

			this.global.push( element );

		},
		remove: function(element, label, fn) {
			var timers = jQuery.data(element, this.dataKey), ret;

			if ( timers ) {

				if (!label) {
					for ( label in timers )
						this.remove(element, label, fn);
				} else if ( timers[label] ) {
					if ( fn ) {
						if ( fn.timerID ) {
							window.clearInterval(timers[label][fn.timerID]);
							delete timers[label][fn.timerID];
						}
					} else {
						for ( var fn in timers[label] ) {
							window.clearInterval(timers[label][fn]);
							delete timers[label][fn];
						}
					}

					for ( ret in timers[label] ) break;
					if ( !ret ) {
						ret = null;
						delete timers[label];
					}
				}

				for ( ret in timers ) break;
				if ( !ret ) 
					jQuery.removeData(element, this.dataKey);
			}
		}
	}
});

jQuery(window).bind("unload", function() {
	jQuery.each(jQuery.timer.global, function(index, item) {
		jQuery.timer.remove(item);
	});
});

jQuery(document).ready(function() {
	jQuery('#gvphotos').galleryView({
			panel_width: 298,
			panel_height: 220,
			frame_width: 75,
			frame_height: 55,
      		transition_speed: 1000,
     		easing: 'easeInOutQuad',
			pause_on_hover: true,
			filmstrip_position: 'bottom',
			overlay_position: 'bottom',
			nav_theme: '1',
			overlay_opacity: 0.6,
			frame_scale: 'nocrop',
			show_filmstrip: false, filmstrip_position: 'bottom',
			transition_interval: 5000
	});
});
	return stack;
})(stacks.stacks_in_12_page0);


// Javascript for stacks_in_30_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_30_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_30_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_30_page0 .stacks_in_30_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_30_page0 .stacks_in_30_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_30_page0 .stacks_in_30_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_30_page0);


// Javascript for stacks_in_36_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_36_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_36_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_36_page0 .stacks_in_36_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_36_page0 .stacks_in_36_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_36_page0 .stacks_in_36_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_36_page0);


// Javascript for stacks_in_101_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_101_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_101_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/*
 * Ultimate Lightbox Stack By WeaverAddons.com Version 1.0.0 Visit http://www.weaveraddons.com for more information on how to use this stack in RapidWeaver.
 * jquery.yoxview http://yoxigen.com/yoxview Copyright (c) 2010 Yossi Kolesnicov Licensed under the MIT license http://www.opensource.org/licenses/mit-license.php
 * jQuery JSONP Core Plugin 2.1.4 (2010-11-17 http://code.google.com/p/jquery-jsonp/ Copyright (c) 2010 Julian Aubourg Licensed as free software under the the MIT License: http://www.opensource.org/licenses/mit-license.php
 */


(function(b,v){function V(){}function j(b){ra=[b]}function g(b,g,j){return b&&b.apply(g.context||g,j)}function d(d){function Aa(b){!J++&&v(function(){K();ca&&(la[z]={s:[b]});Ba&&(b=Ba.apply(d,[b]));g(d.success,d,[b,A]);g(da,d,[d,A])},0)}function ka(b){!J++&&v(function(){K();ca&&b!=eb&&(la[z]=b);g(d.error,d,[d,b]);g(da,d,[d,b])},0)}var d=b.extend({},ea,d),da=d.complete,Ba=d.dataFilter,fa=d.callbackParameter,sa=d.callback,La=d.cache,ca=d.pageCache,Q=d.charset,z=d.url,G=d.data,Ca=d.timeout,W,J=0,K=V;
d.abort=function(){!J++&&K()};if(g(d.beforeSend,d,[d])===false||J)return d;z=z||o;G=G?typeof G=="string"?G:b.param(G,d.traditional):o;z+=G?(/\?/.test(z)?"&":"?")+G:o;fa&&(z+=(/\?/.test(z)?"&":"?")+encodeURIComponent(fa)+"=?");!La&&!ca&&(z+=(/\?/.test(z)?"&":"?")+"_"+(new Date).getTime()+"=");z=z.replace(/=\?(&|$)/,"="+sa+"$1");ca&&(W=la[z])?W.s?Aa(W.s[0]):ka(W):v(function(d,g,o){if(!J){o=Ca>0&&v(function(){ka(eb)},Ca);K=function(){o&&clearTimeout(o);d[ta]=d[m]=d[L]=d[q]=null;ga[w](d);g&&ga[w](g)};
window[sa]=j;d=b(x)[0];d.id=p+Na++;Q&&(d[h]=Q);var A=function(b){(d[m]||V)();b=ra;ra=void 0;b?Aa(b[0]):ka(F)};Ea.msie?(d.event=m,d.htmlFor=d.id,d[ta]=function(){/loaded|complete/.test(d.readyState)&&A()}):(d[q]=d[L]=A,Ea.opera?(g=b(x)[0]).text="jQuery('#"+d.id+"')[0]."+q+"()":d[n]=n);d.src=z;ga.insertBefore(d,ga.firstChild);g&&ga.insertBefore(g,ga.firstChild)}},0);return d}var n="async",h="charset",o="",F="error",p="_jqjsp",m="onclick",q="on"+F,L="onload",ta="onreadystatechange",w="removeChild",x=
"<script/>",A="success",eb="timeout",Ea=b.browser,ga=b("head")[0]||document.documentElement,la={},Na=0,ra,ea={callback:p,url:location.href};d.setup=function(d){b.extend(ea,d)};b.jsonp=d})(jQuery,setTimeout);
(function(b){function v(){var j,g,d,n,h,o,F,p,m,q,L;function ta(a){return"a:has(img)"+(a.tLs?",a"+a.tLs:"")}function w(a){a=a.data("yoxview");if(!O||Xa!=a.vI){O=a.set?b('a[rel="lightbox['+a.set+']"]:first').data("yoxview").images:a.images;u=O.length;Xa=a.vI;var l=false;if(!Oa||Oa!=a.optionsSet)Oa=a.optionsSet||0,c=Ya[Oa],l=true;if(X&&u==1||k&&!X&&u>0)l=true;l&&(k&&(D.remove(),k=X=ma=Y=ua=Fa=Ga=void 0,P=0,M={}),ra());s=a.cacheVars}}function x(a,b,c){a=b&&(b.width||b.height)?{width:parseInt(b.width,
10),height:parseInt(b.height,10)}:a=="none"?{}:c.dD[a];if(isNaN(a.width))a.width=null;if(isNaN(a.height))a.height=null;return a}function A(a,c){if(a instanceof jQuery){var ha=a.children("img:first");if(!ha||ha.length==0)ha=a;var e=a.attr("href"),d=a.attr("target"),f=Yox.getUrlData(e)}else var g=a,e=d="",f={};var j={};if(!g&&e.match(c.allowedImageUrls))j={contentType:"image",src:e,title:ha.attr(c.tA),alt:ha.attr("alt")};else if(!g&&e.match(Yox.Regex.flash)){var h=x("flash",f.queryFields,c);f.queryFields&&
(delete f.queryFields.width,delete f.queryFields.height);j=e.match(Yox.Regex.flash);d=f.queryFields||{};if(j)d.swf=f.path;b.extend(d,h,rb);str='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+d.width+'" height="'+d.height+'"><param name="movie" value="'+d.swf+'"></param>';emb="";b.each(d,function(a,b){str+='<param name="'+a+'" value="'+b+'"></param>';emb+=" "+a+'="'+b+'"'});str+='<embed src="'+e+'" type="application/x-shockwave-flash" width="'+d.width+'" height="'+d.height+'"'+
emb+"></embed></object>";j={contentType:"flash",html:'<div class="ultimateelement">'+str+"</div>",title:ha.attr(c.tA)};b.extend(j,h)}else if(g||f&&f.anchor){if(g=g?b(g):b("#"+f.anchor),j={contentType:"inline",type:"inlineElement",element:g,title:g.attr("title")},e={h:parseInt(g.css("padding-right"),10)+parseInt(g.css("padding-left"),10),v:parseInt(g.css("padding-top"),10)+parseInt(g.css("padding-bottom"),10)},e.h||e.v)j.padding=e}else if(!d||d!="yoxview"){for(h in Yox.Regex.oembed)if(d=Yox.Regex.oembed[h][1],
typeof d=="string"){if(g=RegExp(d,"i"),e.match(g)!=null){j={contentType:"oembed",provider:h,url:e};break}}else{for(i=0;i<d.length;i++)if(g=RegExp(d[i],"i"),e.match(g)!=null){j={contentType:"oembed",provider:h,url:e};break}if(j.provider)break}j.provider&&Yox.Regex.oembed[h][3]&&Yox.Regex.oembed[h][3].extra&&b.extend(j,Yox.Regex.oembed[h][3].extra);j.provider&&(h=x("none",f.queryFields,c),f.queryFields&&(delete f.queryFields.width,delete f.queryFields.height),b.extend(j,h))}!j.contentType&&f&&f.path&&
(e=x("iframe",f.queryFields,c),f.queryFields&&(delete f.queryFields.width,delete f.queryFields.height),j={contentType:"iframe",html:"<iframe src='"+Yox.urlDataToPath(f)+"' class='ultimateelement' style='background-color:#ffffff' frameborder='0'></iframe>",title:ha.attr("title")},b.extend(j,e));return j.contentType?{thumbnailImg:ha,media:j,elementId:sb++}:null}function v(a,c,d,e){var g=function(a){var c=b(a.currentTarget).data("yoxview");if(!c||c.iI===null)return true;else a.preventDefault(),b.yoxview.open(b(a.liveFired||
a.currentTarget).data("yoxview").vI,c.iI)};if(a[0].tagName=="A")a.bind("click.yoxview",g);else if(d){var f=b.extend({images:d,onClick:e||function(a){a.preventDefault();if(c.tO&&c.tO.onClick)c.tO.onClick(b(a.currentTarget).data("yoxview").iI,b(a.currentTarget),b(a.liveFired).data("yoxview").vI);else b.yoxview.open(b(a.liveFired||a.currentTarget).data("yoxview").vI,b(a.currentTarget).data("yoxview").iI);return false}},c.tO,{sTc:"selected",tOfT:600});a.data("yoxview")&&a.data("yoxview");var d=a[0].tagName==
"A",j=0,h={thumbnails:[]},n=function(a,b){var e=f[a+"Ml"];return!e||b.length<=e?b:b.substr(0,e)+(c.aE?"&hellip;":"")},k=f.c-(f.b?f.b:0),va=0,o=0,Za=0,m=false;a.css("width","100%");if(c.lT=="carousel"&&typeof f.cI=="undefined")f.cI=3,f.cTe="slide",f.cTs=500,f.cNl="top bottom",f.cNb="Next",f.cPb="Prev",f.cNbC=true,f.cRc=0;if(f.cI)f.z=0,f.r=0;var q=function(a){if(!a)return"";var b={"&":"amp","<":"lt",">":"gt",'"':"quot","'":"#39"};return a.replace(/[&<>"']/g,function(a){return"&"+b[a]+";"})};f.images&&
b.each(f.images,function(c,e){f.cI&&va==0&&(m=b('<div class="ultimatepage" style="float:left;;"></div>'),o++);va++;var l=b('<div class="ultimateitem'+(f.z?" ultimatezoom":"")+'"><div class="ultimatethumbnail" style="width:'+e.thumbnailDimensions.width+"px;height:"+e.thumbnailDimensions.height+'px"><img src="'+e.thumbnailSrc+'" alt="'+q(e.media.alt)+'" title="'+q(e.media.title)+'" style="width:'+e.thumbnailDimensions.width+"px;height:"+e.thumbnailDimensions.height+";-webkit-border-radius:"+k+"px;-moz-border-radius:"+
k+"px;border-radius:"+k+'px;" /></div></div>');o==1&&(Za+=e.thumbnailDimensions.width+f.p*2+f.b*2);e.data&&l.data("yoxthumbs",e.data);if(e.media.title&&e.media.description&&e.media.title==e.media.description)e.media.description="";if(f.tH=="none"&&!e.media.title&&!e.media.description)e.media.title="No title";var d=thumbnailDescription=false;f.sT&&e.media.title&&(f.cT?(d=b('<div class="'+f.tC+'" style="width:'+e.thumbnailDimensions.width+'px;"></div><div class="'+f.tC+'_text" style="width:'+e.thumbnailDimensions.width+
'px;"><span>'+n("t",e.media.title)+"</span></div>"),ea(d,k,["bottom-right","bottom-left"],null)):d=b('<div class="'+f.tC+'">'+n("t",e.media.title)+"</div>"));f.sD&&e.media.description&&(thumbnailDescription=b('<div class="'+f.dC+'">'+n("d",e.media.description)+"</div>"));f.tP&&f.tP.toLowerCase()=="top"?(thumbnailDescription&&thumbnailDescription.prependTo(l),d&&d.prependTo(l)):(d&&d.appendTo(!f.cT||f.cT=="outside"?l:l.find(".ultimatethumbnail").first()),thumbnailDescription&&thumbnailDescription.appendTo(l));
if(m)if(m.append(l),f.cI=="auto"){if(Za>p)imagecount=0,a.append(m),m=false,f.cI=va}else f.cI==va&&(va=0,a.append(m),m=false);else a.append(l)});va&&m&&(a.append(m),m=false);f.z&&a.parent().parent().parent().css("overflow","visible");if(f.cI){f.cNs=f.cNl.match(/sides/);var p=a.width()-f.p*2,e=a.find(".ultimatepage:first"),y=Za,g=a.parent(),r=g.parent(),F=false;y>p&&(y=p,F=true);f.cNs&&y>p-100&&(y=p-100,F=true);a.find(".ultimatepage").width(y+"px");a.css({width:y*o+"px",overflow:"hidden"});if(f.cNbC)f.cBc=
"transparent";f.cRc&&ea(g,f.cRc,"",null);g.css({position:"relative",overflow:"hidden",width:y+"px",padding:f.p+"px",background:f.cBc});f.cNs&&g.css({"margin-left":"50px","margin-right":"50px"});if(f.cPb.match(/\.(jpe?g|gif|png)/i))f.cPb='<img src="'+f.cPb+'" />';if(f.cNb.match(/\.(jpe?g|gif|png)/i))f.cNb='<img src="'+f.cNb+'" />';f.cNl.match(/top/)&&g.before(b('<div class="ultimatenavigation"><a href="#" class="ultimateprev" style="line-height:0;">'+f.cPb+'</a> &nbsp; <a href="#" class="ultimatenext">'+
f.cNb+"</a></div>"));f.cNl.match(/bottom/)&&g.after(b('<div class="ultimatenavigation"><a href="#" class="ultimateprev">'+f.cPb+'</a> &nbsp; <a href="#"" class="ultimatenext">'+f.cNb+"</a></div>"));f.cNl.match(/sides/)&&g.after(b('<div class="ultimatenavigation" style="position:absolute;top:40%;left:0;"><a href="#" class="ultimateprev">'+f.cPb+'</a></div><div class="ultimatenavigation" style="position:absolute;top:40%;right:0;"><a href="#" class="ultimatenext">'+f.cNb+"</a></div>"));c.cG&&r.css("margin",
"auto");r.css("width",y+f.p*2+(f.cNs?100:0)+"px");if(F){e.parent().css("display","block");var s=0,t=0;e.find(".ultimateitem").each(function(a,c){var e=b(c).offset().top;if(e)if(t||(t=e),e==t)s++;else return false});e.parent().css("display","none");var u=0,y=0;s?b.each(f.images,function(a,b){y+=parseInt(b.thumbnailDimensions.width,10)+f.p*2+f.b*2;u=b.thumbnailDimensions.width;if(a==s-1)return false}):y=p;f.cNs&&y>p-100&&(y-=u-f.p*2-f.b*2,y>p-100&&(y-=100));a.find(".ultimatepage").width(y+"px");a.css("width",
y*o+"px");g.css("width",y+"px");r.css("width",y+f.p*2+(f.cNs?100:0)+"px")}r.find(".ultimatenavigation a").click(function(){var a=b(this).parent().parent(),c=a.find(".ultimategallery"),a=a.find("#containerparent"),e=arguments.callee.current?arguments.callee.current:0,l=a.find(".ultimatepage:first").width(),a=a.find(".ultimatepage").length;b(this).hasClass("ultimatenext")?(e++,margin="-="+l,e>=a&&(margin="0",e=0)):(e-=1,margin="+="+l,e<0&&(e=a-1,margin=-l*a+l));b.fx.prototype.cur=function(){if(this.elem[this.prop]!=
null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(jQuery.css(this.elem,this.prop));return typeof a=="undefined"?0:a};f.cTe=="fade"?b(c).fadeTo(f.cTs,0.01,function(){b(c).css("margin-left",-1*e*l);b(c).fadeTo(f.cTs,1)}):b(c).animate({marginLeft:margin},f.cTs);arguments.callee.current=e;return false})}e=d?a:a.find("div.ultimateitem:has(img)");b.each(e,function(a,c){var e=b(c);e.data("yoxthumbs",b.extend({iI:j++},e.data("yoxthumbs")));h.thumbnails.push(e)});
f.r&&a.find(c.lT=="grid"||c.lT=="carousel"?".ultimateitem":".ultimatethumbnail").each(function(){var a=parseInt(Math.random()*f.r-f.r/2,10)+"deg";if(a!="0deg"){var c="rotate("+a+")";b(this).css({"-webkit-transform":c,"-moz-transform":c,"-o-transform":c,msTransform:c,transform:c})}b(this).data("rotation",a)});f.lM.match(/indicator/i)&&(a.find(".ultimatethumbnail").css({"background-image":"url(rw_common/plugins/stacks/ultimatelightbox/images/ajax_loader.gif)","background-position":"center center","background-repeat":"no-repeat"}),
a.find("img").css("display","none").load(function(){b(this).fadeIn(800,function(){b(this).parent().css("background-image","none")})}));f.cT&&f.cT=="slide"&&a.delegate(".ultimateitem","mouseenter",function(a){b(a.currentTarget).find(".title_"+c.lT).slideDown(200)}).delegate(".ultimateitem","mouseleave",function(a){b(a.currentTarget).find(".title_"+c.lT).stop(true,true).slideUp(200)});c.pI&&a.delegate("img","dragstart",function(a){a.preventDefault()}).delegate("img","contextmenu",function(){return false});
f.cT&&f.b&&a.find(".title_"+c.lT+".inside_text, .title_"+c.lT+".slide_text, .title_"+c.lT+".inside, .title_"+c.lT+".slide").css({bottom:f.b+"px",left:f.b+"px"});f.o&&f.o!=1&&(e.find("img").css("opacity",f.o/100),a.delegate("img","mouseenter",function(a){b(a.currentTarget).stop().animate({opacity:1},f.tOfT)}).delegate("img","mouseleave",function(a){b(a.currentTarget).stop().animate({opacity:f.o/100},f.tOfT)}));f.onClick&&(d?a.bind("click.yoxthumbs",function(a){f.onClick(a);return false}):a.delegate("div.ultimateitem",
"click.yoxthumbs",function(a){if(!b(a.currentTarget).data("yoxthumbs"))return true;f.onClick(a);return false}));a.data("yoxthumbs",h)}else a.delegate(ta(c),"click.yoxview",g)}function Ea(a){var l=loadedViews[Xa];H=l[0].className.match(/ultimateitem|ultimatelauncher/i)?l:O[P].thumbnailImg;if(!H||H.length==0)H=O[0].thumbnailImg;if(H){l="";H.find("img").length&&(thumbImg=H.find("img:first"),thumbImg.css("display")=="block"&&(H=thumbImg),l=thumbImg.attr("src"));a&&Y&&l&&Y.attr("src",l);tb&&!wa&&window.name&&
(wa=b(top.document).find("[name='"+window.name+"']").offset());var d=0;if(!c.oA||c.oA=="elastic"){var e=c.lT=="grid"||c.lT=="carousel"?H.parent().parent():H.parent();if(c.tO.r||c.tO.z)a?e.css({"-webkit-transition":"-webkit-transform 0 linear","-moz-transition":"-moz-transform 0 linear","-o-transition":"-o-transform 0 linear",msTransition:"-ms-transform 0 linear",transition:"transform 0 linear"}):e.css({"-webkit-transition":"-webkit-transform .15s linear","-moz-transition":"-moz-transform .15s linear",
"-o-transition":"-o-transform .15s linear",msTransition:"-ms-transform .15s linear",transition:"transform .15s linear"});c.tO.r&&(d=Math.abs(parseInt(e.data("rotation"),10)),isNaN(d)||(l=a?"none !important":"rotate("+d+"deg) !important",e.css({"-webkit-transform":l,"-moz-transform":l,"-o-transform":l,msTransform:l,transform:l})));c.tO.z&&(a?(l="none !important",e.css({"-webkit-transform":l,"-moz-transform":l,"-o-transform":l,msTransform:l,transform:l})):e.hover(function(){var a="scale("+(1+c.tO.z/
100)+") !important";e.css({"-webkit-transform":a,"-moz-transform":a,"-o-transform":a,msTransform:a,transform:a})},function(){var a=c.tO.r&&!isNaN(d)?"rotate("+d+"deg) !important":"none !important";e.css({"-webkit-transform":a,"-moz-transform":a,"-o-transform":a,msTransform:a,transform:a})}))}$a=H.offset();N={width:H.width(),height:H.height(),top:Math.floor($a.top-Pa.scrollTop()+(wa?wa.top:0))-((a?0:c.bW)-0),left:Math.floor($a.left+(wa?wa.left:0))-((a?0:c.bW)-0)}}else N={top:0,left:0}}function ga(a){if(b.yoxview&&
R){var c=b.yoxview[fb[ub[a.keyCode]]];if(c)return a.preventDefault(),c.apply(b.yoxview),false}return true}function la(a,c,d){return btn=b('<a href="#"><span style="opacity:0;filter:alpha(opacity=0);zoom:1;">'+a+"</span></a>").append(na.getSprite("icons",c)).click(function(){this.blur();return b.yoxview.clickBtn(b.yoxview[c],d)}).mousedown(function(){this.blur();return false}).focus(function(){this.blur();return false})}function Na(a,l,d){var e=new Image;e.src=c.iF+l+".png";l=b('<a href="#" class="ultimatectlbtn" style="background:url('+
e.src+") no-repeat "+l+" center;opacity:0;filter:alpha(opacity=0);zoom:1;outline:none;border:none;"+l+':0"></a>');d?l.css("cursor","default"):(l.click(function(){this.blur();return b.yoxview.clickBtn(a,true)}).mousedown(function(){this.blur();return false}).focus(function(){this.blur();return false}),l.hover(function(){b(this).stop().animate({opacity:0.6},c.bFt)},function(){c.bFt&&b(this).stop().animate({opacity:0},c.bFt)}));return l}function ra(){function a(a,b){a=parseInt(a.replace("#","0x"),16);
return"rgba("+((a&16711680)>>16)+", "+((a&65280)>>8)+", "+(a&255)+", "+(typeof b!="undefined"?b:"1")+")"}typeof c.pM=="string"&&c.pM.match(/ /)?(margins=c.pM.split(" ",2),d=n=h=parseInt(margins[0],10),o=F=parseInt(margins[1],10)):d=F=o=n=h=parseInt(c.pM,10);p=m=d+n;q=o+F;na=new Yox.Sprites({icons:{width:18,height:18,top:59,sprites:"close,help,playpause,link,pin,unpin,play,pause,right,left".split(",")}},c.iF+"sprites.png",c.iF+"empty.gif");fb={RIGHT:c.isRTL?"prev":"next",DOWN:"next",UP:"prev",LEFT:c.isRTL?
"next":"prev",ENTER:"play",HOME:"first",END:"last",SPACE:"next",h:"help",ESCAPE:"close"};var l=/^rgba/.test(b("<div>").css("color","rgba(0,0,0,0.5)").css("color"));E=Qa[c.l];var g=c.skin?Ra[c.skin]:null;k=b("<div>",{id:"ultimatepopup",click:function(a){a.stopPropagation()}});D=b("<div>",{id:"ultimatewrap",click:function(a){a.preventDefault();b.yoxview.clickBtn(b.yoxview.close,true)}});c.skin&&D.attr("className","ultimate_"+c.skin);var e=b(top.document.getElementsByTagName("body")[0]);D.appendTo(e).append(k);
oa=b('<div id="ultimatebackground" style="background:'+c.bC+";"+(c.bO!=1?"opacity:"+c.bO+";filter:alpha(opacity="+c.bO*100+");":"")+'zoom:1;"></div>').appendTo(D);c.bgI?oa.css("background-image","url("+c.bgI+")"):c.bO===0?oa.css("background","none"):l&&oa.css("background-color",a(c.bC,c.bO));oa.css("position")!="fixed"&&(oa.css("position","absolute"),D.css("position","absolute"),oa.css("width","100%"));Y=b('<img class="ultimatefadeimg" style="display:block;width:100%;height:100%;" />');ua=Y.clone();
Fa=b('<div class="ultimateimgpanel" style="z-index:10005"></div>').data("yoxviewPanel",{image:Y}).append(Y).appendTo(k);Ga=b('<div class="ultimateimgpanel" style="z-index:10004;display:none;"></div>').data("yoxviewPanel",{image:ua}).append(ua).appendTo(k);if((e=u==1)&&!O[0].media.title)c.rI=false;if(c.rM){Ha=b('<div class="ultimatepopupbarpanel ultimatetop" />');c.aHm&&Ha.hover(function(){k.hasClass("loading")||K("show",null)},function(){k.hasClass("loading")||K("hide",null)});I=b("<div>",{id:"ultimatemenupanel"});
l&&c.mBc&&I.css("background",a(c.mBc,c.mBo||0.8));var j=la(E.Help,"help",false);M.playBtn=la(E.Slideshow,"play",false);ab=M.playBtn.children("span");I.append(la(E.Close,"close",true),j,M.playBtn);e&&(M.playBtn.hide(),j.hide(),I.css("width","58px"));Ha.append(I).appendTo(k);I.delegate("a","mouseenter",function(){b(this).stop().animate({top:"8px"},"fast").find("span").stop().animate({opacity:1},"fast")}).delegate("a","mouseleave",function(){b(this).stop().animate({top:"0"},"fast").find("span").stop().animate({opacity:0},
"fast")})}c.rB&&!e?(X=Na(b.yoxview.prev,c.isRTL?"right":"left",e),ma=Na(b.yoxview.next,c.isRTL?"left":"right",e),k.append(X,ma),Z=e&&!b.support.opacity?b():k.find(".ultimatectlbtn")):Z=b();S=b('<div id="ultimateloader" class="ultimatenotification" style="display:none"><img src="'+c.iF+'popup_ajax_loader.gif" alt="'+E.Loading+'" style="width:32px;height:32px;" /></div>').appendTo(k);xa=b('<div id="ultimatehelppanel" style="display:none;background:url('+c.iF+"help_panel.png) no-repeat center top;direction: "+
E.Direction+'; opacity:0;filter:alpha(opacity=0);zoom:1;"><h1>'+E.Help.toUpperCase()+"</h1><p>"+E.HelpText+'</p><span id="ultimateclosehelp">'+E.CloseHelp+"</span></div>").click(function(){return b.yoxview.clickBtn(b.yoxview.help,false)}).appendTo(k);if(c.rI){r=b("<div>",{id:"ultimateinfopanel",click:function(a){a.stopPropagation()}});c.iBo===0?(r.css("background","none"),aa=r):l?(aa=r,r.css("background-color",a(c.iBc,c.iBo))):(r.append(b("<div>",{id:"ultimateinfopanelback",css:{background:c.iBc,
opacity:c.iBo}})),aa=b("<div>",{id:"ultimateinfopanelcontent"}));Sa=b('<span id="ultimatecount"></span>');ya=b('<div id="ultimateinfotext"></div>');e&&(ya.css("margin-left","10px"),Sa.hide());aa.append(Sa);c.rIp&&(bb=na.getSprite("icons",c.aHi?"pin":"unpin"),b('<a class="ultimateinfolink" href="#" style="display:inline"></a>').append(bb).click(function(a){a.preventDefault();c.aHi=!c.aHi;c.aHi?pa=setTimeout(function(){J(null)},c.tDd):clearTimeout(pa);bb.css("background-position",na.getBackgroundPosition("icons",
c.aHi?"pin":"unpin"));this.title=c.aHi?E.PinInfo:E.UnpinInfo}).appendTo(aa));g&&g.iB&&b.extend(c.iB,g.iB(c,E,na,D,k));if(c.iB){b.extend(M,c.iB);for(var f in c.iB)c.iB[f].attr("className","ultimateinfolink").show().appendTo(aa)}c.hPb&&M.playBtn&&(M.playBtn.hide(),I&&I.css("width","100px"));c.lOc&&(Ta=b('<a class="ultimateinfolink" target="_blank" title"'+E.OriginalContext+'"></a>').append(na.getSprite("icons","link")).appendTo(aa));aa.append(ya);l||r.append(aa);c.rIe&&c.iBl=="top"&&r.css({bottom:"auto",
top:0});r.appendTo(c.rIe?D:k);c.rIe||(ia=b('<div class="ultimatepopupbarpanel ultimatebottom" />'),ia.hover(function(){R&&!Ia&&c.aHi&&W(null)},function(){R&&!Ia&&c.aHi&&J(null)}),r.wrap(ia),ia=r.parent())}c.rC&&(l=c.rC-c.bW,ea(Y.add(ua),l,"",null),ea(I,l,["top-right"],true),c.skin.match(/external/i)||ea(r,l,["bottom-left","bottom-right"],true));B=G()}function ea(a,c,d,e){a&&a.length&&(c+="px",!d||d=="all"?a.css({"-webkit-border-radius":c,"-moz-border-radius":c,"border-radius":c}):b.each(d,function(b,
e){var d="-webkit-border-"+e+"-radius",g="-moz-border-radius-"+e.replace("-",""),j={};j[d]=j[g]=j["border-"+e+"-radius"]=c;a.css(j)}),e&&a.css({"-webkit-background-clip":"padding-box","-moz-background-clip":"padding","background-clip":"padding-box"}))}function Wa(){s.cIc++;s.cIc==u?s.cC=true:Aa()}function Aa(){if(!c.cB||s.cCi!=s.cBlI)da(s.cCi+(s.cDf?1:-1))}function ka(){if(c.cB)s.cBlI=s.cDf?P+c.cB:P-c.cB,s.cBlI<0?s.cBlI+=u:s.cBlI>=u&&(s.cBlI-=u)}function da(a){if(!s.cC){a==u?a=0:a<0&&(a+=u);var b=
O[a].media;s.cCi=a;b&&!b.loaded?!b.contentType||b.contentType==="image"?gb.src=b.src:b.contentType!="oembed"&&hb(b,function(){Wa()},null):Aa()}}function Ba(a,d){Ja=a=="show"?true:false;d?!c.oA||c.oA=="elastic"?S.appendTo(k):S.appendTo(b("body")):S.appendTo(k);clearTimeout(ib);Ja?(S.stop(),d&&k.addClass("loading"),c.oA&&c.oA!="elastic"?S.css("opacity","0.6").fadeIn(c.buttonFadeTime):ib=setTimeout(function(){S.css("opacity","0.6").fadeIn(c.buttonFadeTime)},c.bFt)):(k.removeClass("loading"),d&&(k.css("top",
function(a,b){return(parseInt(b,10)||0)-c.bW+"px"}),k.css("left",function(a,b){return(parseInt(b,10)||0)-c.bW+"px"})),S.stop().fadeOut(c.buttonFadeTime,function(){S.css("display","none")}))}function fa(a,b,d){var e=k.offset();e.width=k.width();e.height=k.height();var g=Math.abs(e.top-a.top),f=Math.abs(e.left-a.left),j=Math.abs(e.width-a.width),e=Math.abs(e.height-a.height),h=parseInt(a.pRt?a.pRt:c.pRt,10);!ja&&!d&&h==0?(k.stop(true,true).css(a),b()):ja||d&&g>2||f>2||j>2||e>2||p!=m?k.stop(true,true).animate(a,
ja||d?c.oS:h,b):b()}function sa(a,b,d){d?k.stop(true,true).fadeOut(c.oS,b):k.stop(true,true).css(a).css("display","none").fadeIn(c.oS,function(){k.css("opacity","");b()})}function La(a,b,c){c?k.stop(true,true).css("display","none"):k.stop(true,true).css(a).css("display","block");b()}function ca(){u!=1&&(ba=true,z("Pause"),end=P==u-1,!end||c.lP?jb=setTimeout(function(){end?b.yoxview.select(0,null):b.yoxview.next(true)},c.pD):Q())}function Q(){clearTimeout(jb);ba=false;z("Play")}function z(a){ab?ab.text(E[a]):
M.playBtn&&M.playBtn.attr("title",E[a]);M.playBtn&&M.playBtn.find("img").css("background-position",na.getBackgroundPosition("icons",a.toLowerCase()))}function G(){var a=Pa.width(),b=Pa.height();return{h:b,w:a,u:{h:b-p-(c?c.bW*2:0),w:a-q-(c?c.bW*2:0)}}}function Ca(a){B=G();var c={};if(!a.width||!a.height)if(a.contentType=="iframe")a.width=a.width?Math.min(a.width,B.u.w):B.u.w,a.height=a.height?Math.min(a.height,B.u.h):B.u.h;else{if(!a.element)a.element=b(a.html);tmp=b("#ultimatetmp");tmp.length||b("body").append(tmp=
b('<div id="ultimatetmp" style="padding:0;margin:0;"></div>'));tmp.append(a.element);tmp.wrapInner('<div style="width:auto;height:auto;overflow:auto;position:relative;"></div>');a.width=a.width?a.width:tmp.find("div:first").width();a.height=a.height?a.height:tmp.find("div:first").height()}var c=B.u,d=a.contentType=="inline",e={width:a.width,height:a.height};if(a.width>c.w){if(!d)e.height=Math.round(c.w/a.width*a.height);e.width=c.w}if(e.height>c.h){if(!d)e.width=Math.round(c.h/e.height*e.width);e.height=
c.h}c=e;c.top=n+Math.round((B.u.h-c.height)/2);c.left=o+Math.round((B.u.w-c.width)/2);return c}function W(a){clearTimeout(pa);var g=ya.outerHeight();g<kb&&(g=kb);Math.abs(r.height()-g)>2&&r.stop().animate({height:g},500,function(){c.rIe&&(r.position().top===0?n=h+g:d=h+g,m=p,p=n+d,L=g,B=G(),b.yoxview.resize(false))});a&&a()}function J(a){clearTimeout(pa);r.stop().animate({height:0},500,function(){if(R&&c.skin==""&&(c.iBl=="top"||c.iBl=="bottom"))L&&(m=p,d=p=h,L=0),B=G(),b.yoxview.resize();a&&a()})}
function K(a,b){I&&(clearTimeout(lb),I.stop().animate({top:a=="hide"?vb:0},500,function(){b&&b()}))}function db(){qa=t;t=Ua?Ga:Fa;Ua=!Ua}function Ma(a){C=ja;var d=a.contentType==="image"||a.contentType=="oembed"&&a.type=="image"||a.type=="photo"||!a.contentType;d&&Ia&&ia&&ia.show();clearTimeout(pa);db();var h=t.data("yoxviewPanel");if(r){var e=a.title||"";if(c.dMl&&a.description){if(c.dMl!="all")a.description=a.description.length<=c.dMl?a.description:a.description.substr(0,c.dMl)+(c.aE?"&hellip;":
"");e+=e!=""?"<div id='ultimateinfotextdescription'>"+a.description+"</div>":a.description}ya.html(e);u>1&&Sa.html(P+1+"/"+u);Ta&&(b.yoxview.cI.link?Ta.attr("href",b.yoxview.cI.link).show():Ta.hide())}var e=Ca(a),n=false;if(Ka){var f=Math.abs(Ka.width-e.width),m=Math.abs(Ka.height-e.height);if(f<=2&&m<=2)n=true;else if(f<50&&m<50&&c.pRt)e.pRt=c.pRt/2}Ka=e;if(d){f=Ua?Y:ua;f.attr({src:a.src,title:a.title,alt:a.alt});h.image=f;if(!h.isImage&&h.element)h.element.hide(),h.image.show(),h.isImage=true;za||
(c.rB&&Z.css({height:"100%",width:"50%",top:"0"}),Ia=false,za=true)}else{if(h.element&&(!a.elementId||h.elementId!=a.elementId))h.element.remove(),h.element=void 0;if(!h.element)a.html?h.element=b("<div>",{className:mb}):(h.element=b("<div>",{className:mb}),h.element.append(a.element));a.html&&h.element.html(a.html);t=h.element;za&&(ia&&(c.aHi&&J(null),ia.hide(),Ia=true),c.rB&&Z.css({width:j,height:g}),za=false);c.rB&&Z.css({top:(e.height-g)/2});a.contentType=="inline"||a.contentType=="iframe"?(k.css("background-color",
"#fff"),t.css("background-color","#fff")):!C||a.contentType!="flash"&&a.contentType!="oembed"?(k.css("background-color","#999999"),t.css("background-color","#999999")):(k.css("background-color","#000"),t.css("background-color","#000"));(!C||a.contentType!="flash"&&a.contentType!="oembed")&&k.append(h.element);if(h.isImage===void 0||h.isImage)h.element.show(),h.image.hide(),h.isImage=false}var o={width:e.width,height:e.height};t.css(C?{width:"100%",height:"100%"}:o);Ja&&Ba("hide",
C);T=true;if((!c.fI&&!C||!d&&!C)&&!n&&c.pRt!=0)qa&&qa.css("display","none"),t&&t.css("display","none"),c.skin.match(/external/i)||(X&&X.hide(),ma&&ma.hide(),!c.rIe&&r&&r.hide(),I.hide());C&&Z&&Z.css("opacity",0);(C?!c.oA||c.oA=="elastic"?fa:c.oA=="fade"?sa:La:fa)(e,function(){if(C){if(!za&&(a.contentType=="flash"||a.contentType=="oembed"))k.append(t),t.css({"z-index":"10005",opacity:1});R=true;t.css(o);c.cIdT>0&&(c.sBuO&&Z.stop(true).animate({opacity:0.8},c.cIfT,function(){c.bFt&&b(this).delay(c.cIdT).animate({opacity:0},
c.cIfT)}),c.sBaO?(K("show",function(){c.aHm&&(lb=setTimeout(function(){K("hide",null)},c.cIdT))}),r&&W(function(){c.aHi&&(pa=setTimeout(function(){J(null)},c.cIdT))})):!c.aHm&&Ha&&Ha.hover(function(){K("show",null)}));c.aP&&b.yoxview.play()}else!c.sBaO&&!c.aHm&&K("show",null);if(c.pRt==0)t.show(),Da();else if((!c.fI&&!C||!d&&!C)&&!n){if(t.fadeIn(200,Da),!c.skin.match(/external/i)){var e=[X,ma];!c.rIe&&r&&e.push(r);b.each(e,function(a,c){b(c)&&b(c).fadeIn(100)});c.autoHideMenuBar||I.show()}}else!c.fI&&
!n&&!d?Da():C&&Da();ja=false},false);t.css({"z-index":"10005",opacity:1});qa&&qa.css("z-index","10004");if(C)t.css({display:"block",width:"100%",height:"100%"});else if((c.fI&&d||n)&&c.pRt)t.fadeIn(C?c.oS:c.pRt,Da)}function Da(){qa&&qa.css("display","none");T=false;r&&W(function(){c.aHi&&(pa=setTimeout(function(){J(null)},c.tDd))});C||(b(".ultimatemediapanel:hidden")&&b(".ultimatemediapanel:hidden").remove(),u>1&&(c.cIb&&!s.cC&&da(P+(s.cDf?1:-1)),ba&&ca()))}function qb(a,c,d,e,g){function f(a){var b=
/width=["']?([0-9]+)["']/gi.exec(a),a=/height=["']?([0-9]+)["']/gi.exec(a),c={};if(b&&b[1])c.width=b[1];if(a&&a[1])c.height=a[1];return c}function h(a,b){var c=a[2];c+=c.indexOf("?")<=0?"?":"&";c+="format="+(a[3]&&a[3].format?a[3].format:"json")+"&url="+escape(b)+"&"+(a[3]&&a[3].callbackparameter?a[3].callbackparameter:"callback")+"=?";return c}a=Yox.Regex.oembed[a];b("#jqoembeddata").length==0&&b('<span id="jqoembeddata"></span>').appendTo("body");if(b("#jqoembeddata").data(c)!=void 0)e(b("#jqoembeddata").data(c));
else if(a[3]&&a[3].templateRegex)if(a[2])b.jsonp({url:c.replace(a[3].templateRegex,a[2]),dataType:"jsonp",success:function(f){f={type:"rich",html:a[3].templateData(f)};d.width&&b.extend(f,d);b("#jqoembeddata").data(c,f);e(f)},error:function(a,b){g&&g(a,b)}});else{if(a[3].embedtag){var j=a[3].embedtag.flashvars||"",n=a[3].embedtag.tag||"embed";d.width||(d={width:a[3].embedtag.width,height:a[3].embedtag.height});var k="<"+n+' src="'+c.replace(a[3].templateRegex,a[3].embedtag.src)+'" width="'+d.width+
'" height="'+d.height+'" allowfullscreen="'+(a[3].embedtag.allowfullscreen||"true")+'" allowscriptaccess="'+(a[3].embedtag.allowfullscreen||"always")+'"';n=="embed"&&(k+=' type="'+(a[3].embedtag.type||"application/x-shockwave-flash")+'" wmode="transparent" flashvars="'+c.replace(a[3].templateRegex,j)+'"');n=="iframe"&&(k+=' scrolling="'+(a[3].embedtag.scrolling||"no")+'" frameborder="'+(a[3].embedtag.frameborder||"0")+'"');k+="></"+n+">";j={type:"rich",html:k};b.extend(j,d);b("#jqoembeddata").data(c,
k)}else j={type:"rich",html:c.replace(a[3].templateRegex,a[3].template)},d.width?b.extend(j,d):b.extend(j,f(j.html)),b("#jqoembeddata").data(c,j);e(j)}else a[2]+=a[2].indexOf("?")<=0?"?":"&",b.ajax({url:h(a,c),dataType:"jsonp",success:function(a){var a=b.extend({},a),f={title:a.title,width:a.width,height:a.height,type:a.type};d.width&&b.extend(f,d);f.type=="photo"||f.type=="image"?b.extend(f,{src:a.url,alt:a.title,type:"image"}):f.html=a.html.replace(/<embed /,'<embed wmode="transparent" ').replace(/<param/,
'<param name="wmode" value="transparent"><param').replace(/width=\"[\d]+\"/ig,'width="100%"').replace(/height=\"[\d]+\"/ig,'height="100%"');b("#jqoembeddata").data(c,f);e(f)},error:function(a,b){g&&g(a,b)}})}function pb(a){try{if(!a)throw"Error: Media is unavailable.";a.contentType==="image"||!a.contentType?a.src.toLowerCase().indexOf("http://")==-1&&U.src.indexOf(a.src)!=-1?b(U).trigger("load"):U.src==a.src?b(U).trigger("load"):U.src=a.src:!a.loaded&&a.contentType=="oembed"?hb(a,function(a){a.contentType==
"oembed"&&(a.type=="image"||a.type=="photo")?U.src==a.src?b(U).trigger("load"):U.src=a.src:Ma(a)},function(a){Va("Error getting data from:<br /><span class='errorUrl'>"+a.data.url+"</span>")}):Ma(b.yoxview.cI.media)}catch(c){Va(c)}}function hb(a,c,d){var e=a.width;a.contentType=="oembed"&&qb(a.provider,a.url,{width:a.width,height:a.height},function(d){b.extend(a,d,{loaded:true});a.height=parseInt(a.height,10);a.width=parseInt(a.width,10);if(!e&&a.width>720)d=a.width/720,a.width=720,a.height/=d;c&&
c(a)},d)}function Va(a){Ma({html:"<span class='ultimateerror'>"+a+"</span>",width:500,height:300,type:"error"})}var wb={aHi:true,bC:"#000000",bO:0.8,bFt:300,cB:5,cIb:true,cIfT:1500,cIdT:1E3,dD:{flash:{width:720,height:560},iframe:{width:1024}},iF:"rw_common/plugins/stacks/ultimatelightbox/images/",iBc:"#000000",iBo:0.5,iB:{},l:"en",lP:true,pD:3E3,pM:20,pRt:500,oS:500,rB:true,rM:true,sBaO:true,sBuO:true,sD:true,tLs:".yoxviewLink",tO:{},tA:"title",tDd:3E3,aE:true,dMl:250},R=false,S,gb=new Image,Sa,Z,sb=0,P=
0,Xa=0,u=0,E={},Ka=null;d=void 0;n=void 0;h=void 0;o=void 0;F=void 0;p=void 0;m=void 0;q=void 0;L=void 0;var s={},M={},Oa,tb=window!=window.parent,Ia=false,Ua=false,ba=false,Ja=false,T=false,cb=false,rb={wmode:"transparent",width:"100%",height:"100%",allowfullscreen:"true",allowscriptaccess:"true"},ja=true,C=false,za=true,wa,xa,pa,lb,Y,ua,O,r,aa,Ta,kb=25,ia,bb,ya,ib;j=100;g=100;var mb="ultimatemediapanel",vb=-42,I,Ha,ma,c,Ya=loadedViews=[],Fa,Ga,ab,k,oa,jb,Pa=b(window.top),D,X,na,U=new Image,H,$a,
N,B,nb={},Ra={},Qa={en:{Direction:"ltr",Close:"Close",Help:"Help",FirstImage:"To the first image",LastImage:"To the last image",StartStopSlideShow:"Play/Pause slideshow",Pause:"Pause",Play:"Play",Prev:"Prev",PinInfo:"Pin info",UnpinInfo:"Unpin info",Next:"Next",PrevImage:"Previous image",NextImage:"Next image",Loading:"Loading",CloseHelp:"Close help",HelpText:"The gallery can be navigated using the keyboard:<br/><br/>LEFT/RIGHT ARROWS: Prev/Next<br/>SPACEBAR: Next<br/>ENTER: Start/Stop slideshow<br/>ESCAPE: Close gallery<br/>HOME/END: First/Last image<br/>H - This help panel",
Slideshow:"Play",OriginalContext:"View in original context"}},ub={40:"DOWN",35:"END",13:"ENTER",36:"HOME",37:"LEFT",39:"RIGHT",32:"SPACE",38:"UP",72:"h",27:"ESCAPE"},fb,ob={};this.init=function(a,c){function d(c){identifier=e.sID?e.sID:0;if(!ob[identifier]&&Qa[e.l]&&!(e.skin&&!Ra[e.skin]||e.dS&&!Yox.dataSources[e.dS]&&!c))ob[identifier]=true,a.each(function(a,d){var d=b(d),f=loadedViews.length;d.data("yoxview")||d.data("yoxview",{});d.data("yoxview").vI=f;d.data("yoxview").cacheVars={cIc:0,cDf:true,
cBlI:null,cCi:0};var h=d.data("yoxview");if(g)h.optionsSet=g;e.allowedImageUrls=Yox.Regex.image;var l=d[0].tagName=="A",k=l?d:d.find(ta(e)),n=false;l?(theRel=d.attr("rel"),galleryRegExp=/lightbox\[(.*)\]/,n="",(n=galleryRegExp.exec(theRel))?(l=false,n=n[1],h.set=n,nb[n]==void 0?(nb[n]=1,k=b('a[rel="lightbox['+n+']"]')):k=d):k=d):k=e.dS?null:d.find(ta(e));var m=[],o=0;k&&k.each(function(a,c){var d=b(c),g=A(d,e);if(g)m.push(g),l?d.data("yoxview").iI=o:n?d.data("yoxview")?d.data("yoxview").iI=o:d.data("yoxview",
{iI:o,vI:f}):d.data("yoxview",{iI:o,vI:f}),o++});e.images&&(m=[],b.each(e.images,function(a,b){b.contentType?m.push({media:b}):(b=A(b,null),m.push({media:b.media}))}));e.dS?(k=function(a,c){if(c&&e.onLoadBegin)e.onLoadBegin();if(!a.createGroups&&j&&!c)try{var g=(new Date).getTime();localStorage.setItem("ultimategallery_"+e.sID,JSON.stringify({time:g,dU:e.dU,data:a,tS:e.dSo.tS,nr:e.dSo.nr}))}catch(k){}m=m.concat(a.images);h.images=m;a.title&&e.tO&&e.tO.setHeader&&b('<h2 class="'+e.tO.headerClass+'">'+
a.title+"</h2>").appendTo(d);g=a.isGroup?[b.extend(a,{media:{title:a.title+" ("+a.images.length+" images)",alt:a.title}})]:a.images;v(d,e,l?null:g,!a.createGroups?null:function(a){var c=b(a.currentTarget).data("yoxview"),a=b(a.currentTarget).data("yoxthumbs");if(c.imagesAreSet)b.yoxview.open(c.vI);else{b("body").css("cursor","wait");var d=b.extend({},e);d.dSr?b.extend(d.dSr,a):d.dSr=a;Yox.dataSources[e.dS].getImagesData(d,function(a){c.images=a.images;c.imagesAreSet=true;c.cacheVars={};b("body").css("cursor",
"");b.yoxview.open(c.vI)})}});a.createGroups?b.each(d.data("yoxthumbs").thumbnails,function(a,c){c.data("yoxview",{vI:++f});loadedViews.push(b(c))}):b.each(d.data("yoxthumbs").thumbnails,function(a,c){var b=o+a,d=c.children("img");d.length==0&&(d=c);m[b].thumbnailImg=d;c.data("yoxview",{iI:a,vI:f})});if(!b.yoxview.fV&&a.images.length>0)b.yoxview.fV=d,e.cIb&&b.yoxview.startCache();if(c&&e.onLoadComplete)e.onLoadComplete()},c?k(c,true):Yox.dataSources[e.dS].getImagesData(e,k)):(h.images=m,v(d,e,null,
null));loadedViews.push(d);if(!b.yoxview.fV&&h.images&&h.images)b.yoxview.fV=d,w(d),e.cIb&&u&&(ka(),da(0))})}var e=b.extend(true,{},wb,c);b.each(e,function(a,c){typeof c=="string"&&(e[a]=b.trim(c.toLowerCase()))});if(e.skin=="default")e.skin="";Ya.push(e);var g=Ya.length-1;if(e.bgI)(new Image).src=e.bgI;var f=null,j=false;d(null);Qa[e.l]||b.getJSON("rw_common/plugins/stacks/ultimatelightbox/lang/"+e.l+".js",function(a){Qa[e.l]=a;d(f)});if(e.skin&&!Ra[e.skin]){var h="rw_common/plugins/stacks/ultimatelightbox/skins/"+
e.skin+"/yoxview."+e.skin;b.ajax({url:h+".js",dataType:"script",cache:true,success:function(){typeof LightboxSkin!="undefined"?(Ra[e.skin]=LightboxSkin,LightboxSkin.css&&b("head").append('<link rel="stylesheet" href="'+h+'.css" type="text/css" />'),LightboxSkin.options&&b.extend(e,LightboxSkin.options)):e.skin="";d(f)}})}if(e.dS&&!Yox.dataSources[e.dS])if(e.dS=="inline")Yox.dataSources.inline=new V,d(null);else{try{"localStorage"in window&&window.localStorage!==null&&localStorage.getItem&&JSON&&JSON.stringify&&
(j=true)}catch(n){}if(j){var k=localStorage.getItem("ultimategallery_"+e.sID);if(k)(k=JSON.parse(k))&&k.time&&(new Date).getTime()-k.time<36E5&&k.dU==e.dU&&k.tS==e.dSo.tS&&k.nr==e.dSo.nr?f=k.data:localStorage.removeItem(e.sID)}f?d(f):b.ajax({url:e.dSl,dataType:"script",cache:true,success:function(a){eval(a);eval("Yox.dataSources['"+e.dS+"'] = new yox_"+e.dS+"();");d(null)}})}};this.open=function(a,d){a=a||0;d=d||0;b(document).bind("keydown.yoxview",ga);w(loadedViews[a]);!k&&u&&ra();b.yoxview.selectImage(d);
!c.oA||c.oA=="elastic"?D.stop().fadeIn(c.oS,function(){D.css({opacity:"",filter:""})}):D.stop().css({opacity:"",filter:"",display:"block"});c.cIb&&da(d);return false};this.selectImage=function(a){b.yoxview.cI=O[a];P=a;Ea(true);Fa.css({"z-index":"10004",width:"100%",height:"100%"});Ga.css({display:"none","z-index":"10005"});ja=true;if(!c.oA||c.oA=="elastic")k.css(N),k.css("display","block");this.select(a,null,null)};this.select=function(a){if(!T){if(a<0||a==u)a=a<0?u-1:0;b.yoxview.cI=O[a];P=a;ba||
(ja&&c.oA&&c.oA!="elastic"&&S.css({position:"fixed",top:"50%",left:"50%"}),Ba("show",ja));pb(b.yoxview.cI.media);ka();if(c.onSelect)c.onSelect(a,O[a])}};this.prev=function(){if(T||Ja)return false;s.cDf=false;this.select(P-1,X,null);Q()};this.next=function(a){if(T||Ja)return false;s.cDf=true;this.select(P+1,ma,null);ba&&!a&&Q()};this.play=function(){if(R&&u!=1)s.cDf=true,ba?Q():ca()};this.close=function(){if(R){xa.hide();Ea(false);isIE6=false;c.oA&&c.oA!="elastic"&&b(".ultimatemediapanel").find("iframe").attr("src",
isIE6&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");if(!c.oA||c.oA=="elastic"){var a=fa;if(N.left<0||N.top<0||N.left>B.w||N.top>B.h)a=sa,N.left=B.w/2,N.top=B.h/2}else a=c.oA=="fade"?sa:La;a(N,function(){b(".ultimatemediapanel")&&b(".ultimatemediapanel").empty();T=R=false;D.stop().css({display:"none",filter:"",opacity:""})},true);K("hide",null);r&&J(function(){ya.html("")});a==fa&&(!c.oA||c.oA=="elastic")&&(!b.yoxview.cI.media.contentType||b.yoxview.cI.media.contentType==
"image")&&t.animate({width:N.width,height:N.height},c.oS);c.oA!="none"?D.stop().fadeOut(c.oS,function(){D.css({display:"none",filter:"",opacity:""})}):D.stop().css({display:"none",filter:"",opacity:""});ba&&Q();db();b(document).unbind("keydown.yoxview");T=false}};this.help=function(){xa.css("display")=="none"?xa.css("display","block").stop().animate({opacity:0.8},c.bFt):xa.stop().animate({opacity:0},c.bFt,function(){xa.css("display","none")})};this.clickBtn=function(a,c){c&&ba&&Q();a.call(this);return false};
Pa.bind("resize.yoxview",function(){B=G();R&&b.yoxview.resize()});b(gb).load(function(){b.extend(O[s.cCi].media,{width:this.width,height:this.height,loaded:true});Wa()}).error(function(){Wa()});this.startCache=function(){w(this.fV);ka();da(0)};var t=Ga,qa=Fa;this.resize=function(a){if(R){ba&&(cb=true,Q());var c=Ca(Ka);t.css({width:"100%",height:"100%"});T=true;za||Z.css({top:Math.round((c.height-g)/2)});c.pRt=500;fa(c,function(){var c={width:k.width(),height:k.height()};t.css(c);T=false;r&&a&&W(null);
cb&&(ca(),cb=false)},false)}else T=false};b(U).load(function(){this.width==0?Va("Image error"):Ma(b.extend({},b.yoxview.cI.media,{width:this.width,height:this.height}))}).error(function(){b(U).attr("src")&&Va("Image not found")})}function V(){this.getImagesData=function(j,g){var d={},n=[];if(j.onLoadBegin)j.onLoadBegin();var h=b("#"+j.dSl+" li");b.each(h,function(d,g){var h=b(g).find("span.ultimatetitle:first").text(),m=b(g).find("span.ultimatedescription:first").text();h=="Title"&&(h="");m=="Description"&&
(m="");var q=b(g).find("img:first"),L=b(g).find("a.ultimateimage:first"),L=L.length?L.attr("href"):q.attr("src");q.data("thumb_size")||q.attr("data-thumb_size");if(!q.length)return true;var v=b(g).find(".ultimateimage a:first");(v=v.length?v.attr("href"):q.data("thumb_link")||q.attr("data-thumb_link"))||(v=null);var w=q.attr("width"),x=q.attr("height");w||(w=q.data("thumb_width")||q.attr("data-thumb_width"));x||(x=q.data("thumb_height")||q.attr("data-thumb_height"));if(!w){var A=q.parent().html().match(/width=["']?([0-9]+)/);
A&&(w=A[1])}x||(A=q.parent().html().match(/height=["']?([0-9]+)/))&&(x=A[1]);w||(w=120);x||(x=120);if(w>j.tO.tS||x>j.tO.tS)A=0,A=w>x?w/j.tO.tS:x/j.tO.tS,w=Math.round(w/A),x=Math.round(x/A);h={thumbnailSrc:q.attr("src"),thumbnailDimensions:{width:w,height:x},link:v,media:{src:L,title:h,alt:h,description:m}};n.push(h)});d.images=n;b("#"+j.dSl).remove();g&&g(d);if(j.onLoadComplete)j.onLoadComplete()}}Yox={dataSources:[],Regex:{flash:/^(.*\.(swf))(\?[^\?]+)?/i,image:/^[^\?#]+\.(?:jpg|jpeg|gif|png)$/i,
oembed:{1:["video","youtube\\.com/watch.+v=[\\w-]+&?",null,{templateRegex:/.*v=([\w-]+).*?(autoplay=1|$).*/,embedtag:{tag:"iframe",width:425,height:349,src:"http://www.youtube.com/embed/$1?$2"}}],2:["video","metacafe\\.com/watch/.+",null,{templateRegex:/.*watch\/(\d+)\/(\w+)\/.*/,embedtag:{width:400,height:345,src:"http://www.metacafe.com/fplayer/$1/$2.swf"}}],3:["video","twitvid\\.com/.+",null,{templateRegex:/.*twitvid\.com\/(\w+).*/,embedtag:{tag:"iframe",width:480,height:360,src:"http://www.twitvid.com/embed.php?guid=$1&autoplay=0"}}],
4:["video","embedr\\.com/playlist/.+",null,{templateRegex:/.*playlist\/([^\/]+).*/,embedtag:{width:425,height:520,src:"http://embedr.com/swf/slider/$1/425/520/default/false/std"}}],5:["video","blip\\.tv/.+","http://blip.tv/oembed/"],6:["video","hulu\\.com/watch/.*","http://www.hulu.com/api/oembed.json"],7:["video",["vimeo.com/groups/.*/videos/.*","vimeo.com/.*"],"http://vimeo.com/api/oembed.json"],8:["video","dailymotion\\.com/.+","http://www.dailymotion.com/services/oembed"],9:["photo","flickr\\.com/photos/[-.\\w@]+/\\d+/?",
"http://flickr.com/services/oembed",{callbackparameter:"jsoncallback"}],10:["photo","instagr\\.?am(\\.com)?/.+","http://api.instagram.com/oembed"]}},Sprites:function(j,g,d){(new Image).src=this.spritesImage=g;this.getSprite=function(n,h,o){return b("<img/>",{src:d,alt:h,title:o,css:{width:j[n].width,height:j[n].height,background:"url("+g+") no-repeat "+this.getBackgroundPosition(n,h)}})};this.getBackgroundPosition=function(d,g){return"-"+b.inArray(g,j[d].sprites)*(j[d].width||0)+"px -"+j[d].top+"px"}},
getUrlData:function(b){b=b.match(/^([^#\?]*)?(?:\?([^\?#]*))?(?:#([A-Za-z]{1}[A-Za-z\d-_\:\.]+))?$/);return!b?null:{path:b[1],anchor:b[3],queryFields:this.queryToJson(b[2])}},queryToJson:function(b){for(var g={},b=b?b.split("&"):[],d=0;d<b.length;d++){var n=b[d].split("=");n.length==2&&(g[n[0]]=n[1])}return g},urlDataToPath:function(b){var g=b.path||"";if(b.queryFields){g+="?";for(var d in b.queryFields)g+=d+"="+b.queryFields[d]+"&";g=g.substring(0,g.length-1)}b.anchor&&(g+="#"+b.anchor);return g}};
if(!b.yoxview)b.yoxview=new v;b.fn.yoxview=function(j){this.length&&b.yoxview.init(this,j);return this};b.fn.waitForImages=function(j){return this.each(function(){var g=b(this),d=[];g.find("img").each(function(){d.push({src:this.src,element:this})});var n=d.length,h=0;n==0&&j.call(g[0]);b.each(d,function(b,d){var p=new Image;p.onload=function(){h++;if(h==n)return j.call(g[0]),false};p.src=d.src})})}})(jQuery);
$(document).ready(function(){function b(b,d,j){var h=$("#"+b);j&&h.addClass(j.cTa);if(d=="wait"){var o=(new Date).getTime();h.waitForImages(function(){(new Date).getTime()-o<=100?h.show():h.fadeIn()})}else h.show()}function v(b,d){var j=$(b).data(d);j||(j=$(b).attr("data-"+d));typeof j=="string"&&(j=eval("("+j+")"));typeof j!="object"&&(j={});return j}var V={aHi:!0,aHm:!0,aP:false,pM:1 + 20,bW:1,fI:true,oA:"elastic",oS:400,rC:0,bC:"#000000",bO:75/100,iBc:"#000000",lang:"en",mBc:"#000000",pD:3.0*1000,rI:('default' != 'hidden'),rIe:('default'=='top' || 'default'=='bottom'),iBl:"default",rIp:!0,rM:!0,sD:!0,skin:"default",bFt:500},j=$(".ultimatelightboxextrasettings:first");j.length&&(j=v(j,"settings"),$.extend(V,j));$('a[rel="lightbox"]'.replace(/=/,"^=")).yoxview(V);
$("div.ultimatelauncher").each(function(){var b=$(this).find("div.ultimatelauncheritems div.ultimatelauncheritem");if(b.length){var d=$(this).find("a.ultimatelauncher:first");$(this).find("div.ultimatelauncherslice:first").click(function(){d.trigger("click")});d.attr("href","#"+b.get(0).id);var j=[];$.each(b,function(b,d){var g=false,p=$(d).find("span.ultimatelauncherwidth:first"),m=p.text().toLowerCase();p.remove();var p=$(d).find("span.ultimatelauncherheight:first"),q=p.text().toLowerCase();p.remove();
m=="click here to add content."&&(m="auto");q=="click here to add content."&&(q="auto");m!="auto"&&$(d).css("width",parseInt(m,10)+"px");q!="auto"&&$(d).css("height",parseInt(q,10)+"px");$(d).find(".stacks_in").length==1&&(m=$(d).find("img"),m.length==1&&(m=m.get(0),m.width&&m.height&&(g={contentType:"image",src:m.src,title:m.alt,alt:m.alt,width:m.width,height:m.height})));g||(g=d);j.push(g)});b={images:j};$.extend(b,V);$(d).yoxview(b)}});$("div.ultimategallery").each(function(){var g=v(this,"gallery");
if(g){var d=$(this).attr("id"),j=g.dSo.lM||"none",h={},o=430;if(g.lT){var h=$(this).parent().parent().find(".ultimate"+g.lT+"stylesettings:first"),F=["grid","list","sequence","carousel"];if($.inArray(g.lT,F)==-1)return $("#"+d).parent().html('Unknown layout "'+g.lT+'". Only grid, list, sequence, and carousel are allowed.'),true;if(h.length)h=v(h,"settings"),o=h.dMl,o=="all"&&(o=0);else{var p=false;$.each(F,function(b,h){var j=$("#"+d).parent().parent().find(".ultimate"+h+"stylesettings:first");if(h!=
g.lT&&j.length)return $("#"+d).parent().html("You still have the settings of an other layout style. You must remove that and replace it (if necessary) by the correct stack: ultimate "+g.lT+" style layout stack."),p=true,false});if(p)return true;else if(h={},g.lT!="grid"&&g.lT!="carousel")h.sT=true,h.sD=true}$.extend(g.tO,h,{sT:h.sT||h.tSz&&h.tSz!="0",sD:h.sD||h.dSz&&h.dSz!="0"&&h.dMl&&h.dMl!="0",tC:h.tC?h.tC:"title_"+g.lT,dC:"description_"+g.lT,cT:h.cT?h.cT:"",lM:j,dMl:o})}o={onLoadComplete:function(){b(d,
j,h)},onNoData:function(){$("#"+d).html("No data found to display.").show()},onLoadError:function(b){$("#"+d).html('<p style="color:red;font-weight:bold;text-align:left;margin-top:10px;margin-bottom:10px;">'+b+"</p>").show()}};$.extend(o,V,g);$(this).yoxview(o)}})});

	return stack;
})(stacks.stacks_in_101_page0);


// Javascript for stacks_in_104_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_104_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_104_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_104_page0 .stacks_in_104_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_104_page0 .stacks_in_104_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_104_page0 .stacks_in_104_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_104_page0);


// Javascript for stacks_in_110_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_110_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_110_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_110_page0 .stacks_in_110_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_110_page0 .stacks_in_110_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_110_page0 .stacks_in_110_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_110_page0);


// Javascript for stacks_in_116_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_116_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_116_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_116_page0 .stacks_in_116_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_116_page0 .stacks_in_116_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_116_page0 .stacks_in_116_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_116_page0);


// Javascript for stacks_in_122_page0
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_122_page0 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_122_page0 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
// Background Stack by http://www.doobox.co.uk
// Copyright@2010 Mr JG Simpson, trading as Doobox.
// all rights reserved.



$(document).ready(function() {
jQuery.url = function()
{
	var segments = {};
	
	var parsed = {};
	
	/**
    * Options object. Only the URI and strictMode values can be changed via the setters below.
    */
  	var options = {
	
		url : window.location, // default URI is the page in which the script is running
		
		strictMode: false, // 'loose' parsing by default
	
		key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], // keys available to query 
		
		q: {
			name: "queryKey",
			parser: /(?:^|&)([^&=]*)=?([^&]*)/g
		},
		
		parser: {
			strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,  //less intuitive, more accurate to the specs
			loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
		}
		
	};
	
    /**
     * Deals with the parsing of the URI according to the regex above.
 	 * Written by Steven Levithan - see credits at top.
     */		
	var parseUri = function()
	{
		str = decodeURI( options.url );
		
		var m = options.parser[ options.strictMode ? "strict" : "loose" ].exec( str );
		var uri = {};
		var i = 14;

		while ( i-- ) {
			uri[ options.key[i] ] = m[i] || "";
		}

		uri[ options.q.name ] = {};
		uri[ options.key[12] ].replace( options.q.parser, function ( $0, $1, $2 ) {
			if ($1) {
				uri[options.q.name][$1] = $2;
			}
		});

		return uri;
	};

    /**
     * Returns the value of the passed in key from the parsed URI.
  	 * 
	 * @param string key The key whose value is required
     */		
	var key = function( key )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		} 
		if ( key == "base" )
		{
			if ( parsed.port !== null && parsed.port !== "" )
			{
				return parsed.protocol+"://"+parsed.host+":"+parsed.port+"/";	
			}
			else
			{
				return parsed.protocol+"://"+parsed.host+"/";
			}
		}
	
		return ( parsed[key] === "" ) ? null : parsed[key];
	};
	
	/**
     * Returns the value of the required query string parameter.
  	 * 
	 * @param string item The parameter whose value is required
     */		
	var param = function( item )
	{
		if ( ! parsed.length )
		{
			setUp(); // if the URI has not been parsed yet then do this first...	
		}
		return ( parsed.queryKey[item] === null ) ? null : parsed.queryKey[item];
	};

    /**
     * 'Constructor' (not really!) function.
     *  Called whenever the URI changes to kick off re-parsing of the URI and splitting it up into segments. 
     */	
	var setUp = function()
	{
		parsed = parseUri();
		
		getSegments();	
	};
	
    /**
     * Splits up the body of the URI into segments (i.e. sections delimited by '/')
     */
	var getSegments = function()
	{
		var p = parsed.path;
		segments = []; // clear out segments array
		segments = parsed.path.length == 1 ? {} : ( p.charAt( p.length - 1 ) == "/" ? p.substring( 1, p.length - 1 ) : path = p.substring( 1 ) ).split("/");
	};
	
	return {
		
	    /**
	     * Sets the parsing mode - either strict or loose. Set to loose by default.
	     *
	     * @param string mode The mode to set the parser to. Anything apart from a value of 'strict' will set it to loose!
	     */
		setMode : function( mode )
		{
			strictMode = mode == "strict" ? true : false;
			return this;
		},
		
		/**
	     * Sets URI to parse if you don't want to to parse the current page's URI.
		 * Calling the function with no value for newUri resets it to the current page's URI.
	     *
	     * @param string newUri The URI to parse.
	     */		
		setUrl : function( newUri )
		{
			options.url = newUri === undefined ? window.location : newUri;
			setUp();
			return this;
		},		
		
		/**
	     * Returns the value of the specified URI segment. Segments are numbered from 1 to the number of segments.
		 * For example the URI http://test.com/about/company/ segment(1) would return 'about'.
		 *
		 * If no integer is passed into the function it returns the number of segments in the URI.
	     *
	     * @param int pos The position of the segment to return. Can be empty.
	     */	
		segment : function( pos )
		{
			if ( ! parsed.length )
			{
				setUp(); // if the URI has not been parsed yet then do this first...	
			} 
			if ( pos === undefined )
			{
				return segments.length;
			}
			return ( segments[pos] === "" || segments[pos] === undefined ) ? null : segments[pos];
		},
		
		attr : key, // provides public access to private 'key' function - see above
		
		param : param // provides public access to private 'param' function - see above
		
	};
	
}();


var yourfolder = jQuery.url.attr("directory");
if(yourfolder == "/"){yourfolder = ""};


var rptx = "0";
var rpty = "0";
var axisrepeat = "repeat";
var positionlmr = "2";
var positiontmb = "2";




if(rptx == 0 && rpty == 0){
    axisrepeat = "no-repeat";
}
else if(rptx == 0 && rpty == 1){
    axisrepeat = "repeat-y";
}
else if(rptx == 1 && rpty == 0){
    axisrepeat = "repeat-x";
}
else{
    axisrepeat = "repeat";
}



                switch (positiontmb) {
                	case "1":
                        positiontmb = "top";
                        break;
                    case "2":
                        positiontmb = "center";
                        break;
                    case "3":
                        positiontmb = "bottom";
                        break;  
                    default:
                        positiontmb = "center";
                };
                
                switch (positionlmr) {
                	case "1":
                        positionlmr = "left";
                        break;
                    case "2":
                        positionlmr = "center";
                        break;
                    case "3":
                        positionlmr = "right";
                        break;  
                    default:
                        positionlmr = "center";
                };




var bgimage = $("#stacks_in_122_page0 .stacks_in_122_page0bgimage img").attr("src");

var bgcolor = "";
if (bgcolor == "") {var bgcolor = "#E6E6E6";}
else {
	var bgcolor = "";
}

var itsIEnine = navigator.userAgent.match(/MSIE 9/i) != null;


if(itsIEnine){
	$("#stacks_in_122_page0 .stacks_in_122_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px"
    });
}
else{
    $("#stacks_in_122_page0 .stacks_in_122_page0bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "8px",
    "-moz-border-radius" : "8px",
    "border-radius" : "8px",
    "behavior":"url(" + yourfolder + "files/RBPIE.htc)" 
    });
}

     
});

	return stack;
})(stacks.stacks_in_122_page0);



