
// '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_6_page20
// ---------------------------------------------------------------------

// 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_6_page20 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_6_page20 = (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_6_page20 .stacks_in_6_page20bgimage img").attr("src");

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

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


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

     
});

	return stack;
})(stacks.stacks_in_6_page20);


// Javascript for stacks_in_11_page20
// ---------------------------------------------------------------------

// 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_11_page20 = {};

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

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
//-- Totem Stack v1.1.0 by Joe Workman --//

/*  Totem Ticker Plugin
 *	Copyright (c) 2011 Zach Dunn / www.buildinternet.com
 *	Released under MIT License */
(function(a){if(!a.omr){a.omr=new Object()}a.omr.totemticker=function(c,b){var d=this;d.el=c;d.$el=a(c);d.$el.data("omr.totemticker",d);d.init=function(){d.options=a.extend({},a.omr.totemticker.defaultOptions,b);d.ticker;d.format_ticker();d.setup_nav();d.start_interval()};d.start_interval=function(){clearInterval(d.ticker);if(d.options.direction=="up"){d.ticker=setInterval(function(){d.$el.find("li:last").detach().prependTo(d.$el).css("marginTop","-"+d.options.row_height);d.$el.find("li:first").animate({marginTop:"0px",},d.options.speed,function(){})},d.options.interval)}else{d.ticker=setInterval(function(){d.$el.find("li:first").animate({marginTop:"-"+d.options.row_height,},d.options.speed,function(){a(this).detach().css("marginTop","0").appendTo(d.$el)})},d.options.interval)}};d.reset_interval=function(){clearInterval(d.ticker);d.start_interval()};d.stop_interval=function(){clearInterval(d.ticker)};d.format_ticker=function(){if(typeof(d.options.max_items)!="undefined"&&d.options.max_items!=null){var f=d.options.row_height.replace(/px/i,"");var e=f*d.options.max_items;d.$el.css({height:e+"px",overflow:"hidden",})}else{d.$el.css({overflow:"hidden",})}};d.setup_nav=function(){if(typeof(d.options.stop)!="undefined"&&d.options.stop!=null){a(d.options.stop).click(function(){d.stop_interval();return false})}if(typeof(d.options.start)!="undefined"&&d.options.start!=null){a(d.options.start).click(function(){d.start_interval();return false})}if(typeof(d.options.previous)!="undefined"&&d.options.previous!=null){a(d.options.previous).click(function(){d.$el.find("li:last").detach().prependTo(d.$el).css("marginTop","-"+d.options.row_height);d.$el.find("li:first").animate({marginTop:"0px",},d.options.speed,function(){d.reset_interval()});return false})}if(typeof(d.options.next)!="undefined"&&d.options.next!=null){a(d.options.next).click(function(){d.$el.find("li:first").animate({marginTop:"-"+d.options.row_height,},d.options.speed,function(){a(this).detach().css("marginTop","0px").appendTo(d.$el);d.reset_interval()});return false})}if(typeof(d.options.mousestop)!="undefined"&&d.options.mousestop===true){d.$el.mouseenter(function(){d.stop_interval()}).mouseleave(function(){d.start_interval()})}};d.debug_info=function(){console.log(d.options)};d.init()};a.omr.totemticker.defaultOptions={message:"Ticker Loaded",next:null,previous:null,stop:null,start:null,row_height:"100px",speed:800,interval:4000,max_items:null,mousestop:false,direction:"down",};a.fn.totemticker=function(b){return this.each(function(){(new a.omr.totemticker(this,b))})}})(jQuery);

jQuery.fn.exists = function(){return jQuery(this).length>0;}

$(document).ready(function() {	
	var bg_color = $('#stacks_in_11_page20').css('background-color');
	if (bg_color) { 
		$('#stacks_in_11_page20').css({'background-color': 'transparent'});	
		$('#totem_stacks_in_11_page20').css({'background-color': bg_color });	
	}
	var bg_border_style = $('#stacks_in_11_page20').css('border-bottom-style');
	if (bg_border_style) { 
		var bg_border_color  = $('#stacks_in_11_page20').css('border-bottom-color');
		var bg_border_top 	 = $('#stacks_in_11_page20').css('border-top-width');
		var bg_border_right  = $('#stacks_in_11_page20').css('border-right-width');
		var bg_border_bottom = $('#stacks_in_11_page20').css('border-bottom-width');
		var bg_border_left 	 = $('#stacks_in_11_page20').css('border-left-width');
		$('#stacks_in_11_page20').css({'border-width':0});	
		$('#stacks_in_11_page20 .totem_wrapper').css({	'border-style':bg_border_style,
							 			'border-color':bg_border_color,
										'border-top-width':bg_border_top,
										'border-right-width':bg_border_right,
										'border-bottom-width':bg_border_bottom,	
										'border-left-width':bg_border_left
		});	
	}
	// Remove the Nav containers if images were not used.
	if (! $('#totem_next_stacks_in_11_page20 img').exists()) {
	    $('#totem_next_stacks_in_11_page20').remove();
	}
	if (! $('#totem_prev_stacks_in_11_page20 img').exists()) {
	    $('#totem_prev_stacks_in_11_page20').remove();
	}
	
	$('#totem_stacks_in_11_page20').totemticker({
		row_height	:	'125px',
		next		:	'#totem_next_stacks_in_11_page20',
		previous	:	'#totem_prev_stacks_in_11_page20',
		stop		:	'#totem_stop',
		start		:	'#totem_start',
		mousestop	:	true,
        speed       :   1000,
        interval    :   5000,
        max_items   :   1
	});	
	// Take the bottom borders into effect when calculating the height
	$('#totem_stacks_in_11_page20').height( (1 * 125) + (1 - 1));
});


//-- End Totem Stack --//
	return stack;
})(stacks.stacks_in_11_page20);


// Javascript for stacks_in_32_page20
// ---------------------------------------------------------------------

// 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_32_page20 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_32_page20 = (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 Stretcher jQuery Plugin
	� 2009 ajaxBlender.com
	For any questions please visit www.ajaxblender.com 
	or email us at support@ajaxblender.com
	
	Version: 1.3 (adapted to Stacks by Mauricio Sabene at RWExtras.com)
*/

	/*  Variables  */
	var container = null;
	var allImgs = '', allLIs = '', containerStr = '';	
	var element = this;
	var _bgStretcherPause = false;
	var _bgStretcherTm = null;
	
	jQuery.fn.bgStretcher = function(settings){
		settings = jQuery.extend({}, jQuery.fn.bgStretcher.defaults, settings);
		jQuery.fn.bgStretcher.settings = settings;
		
		function _build(){
			if(!settings.images.length){ return; }
			
			_genHtml();
			
			containerStr = '#' + settings.imageContainer;
			container = jQuery(containerStr);
			allImgs = '#' + settings.imageContainer + ' IMG';
			allLIs = '#' + settings.imageContainer + ' LI';

			jQuery(allLIs).hide();
			var bgrandom = Math.round(Math.random() * jQuery(allLIs).length);
			if(settings.randomFirst) {
			jQuery(allLIs + ':eq(' + bgrandom + ')').fadeIn(1000).addClass('bgs-current');
			} else {
			jQuery(allLIs + ':first').fadeIn(1000).addClass('bgs-current');}
			
			if(!container.length){ return; }
			jQuery(window).resize(_resize);
			
			if(settings.slideShow && jQuery(allImgs).length > 1){
				_bgStretcherTm = setTimeout( bgSlideshow , settings.nextSlideDelay);
			}
			_resize();
		};
		
		function _resize(){
			var winW = jQuery(window).width();
			var winH = jQuery(window).height();
			var imgW = 0, imgH = 0;

			//	Update container's height
			container.width(winW);
			container.height(winH);
			
			//	Non-proportional resize
			if(!settings.resizeProportionally){
				imgW = winW;
				imgH = winH;
			} else {
				var initW = settings.imageWidth, initH = settings.imageHeight;
				var ratio = initH / initW;
				
				imgW = winW;
				imgH = winW * ratio;
				
				if(imgH < winH){
				imgH = winH;
				imgW = imgH / ratio;
				}
			}
			
			//	Apply new size for images
			if(!settings.resizeAnimate){
				jQuery(allImgs).width(imgW).height(imgH);
			} else {
				jQuery(allImgs).animate({width: imgW, height: imgH}, 'normal');
			}
		};
		
		function _genHtml(){
			var code = '<div id="' + settings.imageContainer + '" class="bgstretcher"><ul>';
			for(i = 0; i < settings.images.length; i++){
				code += '<li><img src="' + settings.images[i] + '" alt="" /></li>';
			}
			code += '</ul></div>';
			jQuery(settings.codeLocation).prepend(code);
		};

		function bgSlideshow (){
			var current = jQuery(containerStr + ' LI.bgs-current');
			var next = current.next();
			if(!next.length){
			if(settings.stopEnd)	
			{ return false; }
			else { next = jQuery(containerStr + ' LI:first'); }
			}

			jQuery(containerStr + ' LI').removeClass('bgs-current');
			next.addClass('bgs-current');

			next.fadeIn( jQuery.fn.bgStretcher.settings.slideShowSpeed );
			current.fadeOut( jQuery.fn.bgStretcher.settings.slideShowSpeed );
			_bgStretcherTm = setTimeout( bgSlideshow, jQuery.fn.bgStretcher.settings.nextSlideDelay);
		};
		
		/*  Start bgStretcher  */
		_build();
	};

	/*  Default Settings  */
	jQuery.fn.bgStretcher.defaults = {
		imageContainer:             'bgstretcher',
		resizeProportionally:       true,
		resizeAnimate:              false,
		images:                     [],
		imageWidth:                 1024,
		imageHeight:                768,
		nextSlideDelay:             3000,
		slideShowSpeed:             'slow',
		codeLocation: 				'body',
		randomFirst: 				false,
		slideShow:                  true
	};
	jQuery.fn.bgStretcher.settings = {};

jQuery(document).ready(function(){
	var bg_images = [];
	jQuery('div#inputimages img').each(function() {
		bg_images.push(jQuery(this).attr('src'))
	});

		jQuery(document).bgStretcher({
			images: bg_images,
			imageWidth: 1024,
			imageHeight: 768,
			imageContainer: 'stretcher',
			nextSlideDelay: 3000,
			slideShowSpeed: 'slow',
			resizeAnimate: false,
			codeLocation: 'body',
			randomFirst: false,
			slideShow: false,
			stopEnd: false
		});
});
	return stack;
})(stacks.stacks_in_32_page20);


// Javascript for stacks_in_47_page20
// ---------------------------------------------------------------------

// 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_47_page20 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_47_page20 = (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_47_page20 .stacks_in_47_page20bgimage img").attr("src");

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

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


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

     
});

	return stack;
})(stacks.stacks_in_47_page20);


// Javascript for stacks_in_59_page20
// ---------------------------------------------------------------------

// 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_59_page20 = {};

// A closure is defined and assined to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for refering
// to this object from elsewhere.
stacks.stacks_in_59_page20 = (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_59_page20 .stacks_in_59_page20bgimage img").attr("src");

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

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


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

     
});

	return stack;
})(stacks.stacks_in_59_page20);



