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

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

// 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_1_page6 = (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 = "1";
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_1_page6 .stacks_in_1_page6bgimage img").attr("src");

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

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


if(itsIEnine){
	$("#stacks_in_1_page6 .stacks_in_1_page6bgimagestack").css({
    "background":"url("+bgimage+") " + axisrepeat + " " + bgcolor,
    "background-position": positionlmr + " " + positiontmb,
    "-webkit-border-radius" : "0px",
    "-moz-border-radius" : "0px",
    "border-radius" : "0px"
    });
}
else{
    $("#stacks_in_1_page6 .stacks_in_1_page6bgimagestack").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_1_page6);


// Javascript for stacks_in_4_page6
// ---------------------------------------------------------------------

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

// 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_4_page6 = (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 rpt = "2";
var posy = "99";
var posx = "50";

if (rpt == 1) {var userpt = "repeat";}
if (rpt == 2) {var userpt = "no-repeat";}


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

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



    $("#stacks_in_4_page6 .bgimagestack").css({
    "background":"url(" + bgimage + ") " + userpt + " " + bgcolor,
    "background-position": posx + "%" + " " + posy + "%",
    "-webkit-border-radius" : "0px",
    "-moz-border-radius" : "0px",
    "border-radius" : "0px",
    "behavior":"url(" + yourfolder + "/files/PIE.htc)"
    });

          
});
	return stack;
})(stacks.stacks_in_4_page6);


// Javascript for stacks_in_47_page6
// ---------------------------------------------------------------------

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

// 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_page6 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	
/*
 *
 * RapidWeaver Newsticker Styled stack by Tsooj Media
 * Version 1.3.0
 *
 * Visit http://www.tsooj.net for more information on how to use this stacks product for RapidWeaver.
 *
 */
 
/*
News ticker plugin (BBC news style)
Bryan Gullan,2007-2011
version 2.3.6
updated 2011-03-16
Documentation at http://www.makemineatriple.com/news-ticker-documentation/
Demo at http://www.makemineatriple.com/jquery/?newsTicker
Use and distrubute freely with this header intact.
*/

(function($) {
	
	var name='newsTicker';
	var debugMode = false; // enabling this turns on console logging for interactions
	
	function runTicker(settings) {
		
		tickerData = $(settings.newsList).data('newsTicker');
		
		if(tickerData.currentItem > tickerData.newsItemCounter){
			// if we've looped to beyond the last item in the list, start over
			tickerData.currentItem = 0;
		}
		else if (tickerData.currentItem < 0) {
			// if we've looped back before the first item, move to the last one
			tickerData.currentItem = tickerData.newsItemCounter;
		}
		
		if(tickerData.currentPosition == 0) {
			if(tickerData.newsLinks[tickerData.currentItem].length > 0) {
				$(tickerData.newsList).empty().append('<li><a '+ tickerData.newsAttributes[tickerData.currentItem] +'></a></li>');
			}
			else {
				$(tickerData.newsList).empty().append('<li></li>');
			}
		}
		
		//only start the ticker itself if it's defined as animating: otherwise it's paused or under manual advance
		if (tickerData.animating) {
			
			if( tickerData.currentPosition % 2 == 0) {
					var placeHolder = tickerData.placeHolder1;
			}
			else {
				var placeHolder = tickerData.placeHolder2;
			}
			
			if( tickerData.currentPosition < tickerData.newsItems[tickerData.currentItem].length) {
				// we haven't completed ticking out the current item
				
				var tickerText = tickerData.newsItems[tickerData.currentItem].substring(0,tickerData.currentPosition);
				if(tickerData.newsLinks[tickerData.currentItem].length > 0) {
					$(tickerData.newsList + ' li a').text(tickerText + placeHolder);
				}
				else {
					$(tickerData.newsList + ' li').text(tickerText + placeHolder);
				}
				tickerData.currentPosition ++;
				setTimeout(function(){runTicker(settings); settings = null;},tickerData.tickerRate);
			}
			
			else {
				// we're on the last letter of the current item
				
				if(tickerData.newsLinks[tickerData.currentItem].length > 0) {
					$(tickerData.newsList + ' li a').text(tickerData.newsItems[tickerData.currentItem]);
				}
				else {
					$(tickerData.newsList + ' li').text(tickerData.newsItems[tickerData.currentItem]);
				}
				
				setTimeout(function(){
					if (tickerData.animating) {
						tickerData.currentPosition = 0;
						tickerData.currentItem ++;
						runTicker(settings); settings = null;
					}
				},tickerData.loopDelay);
				
			}
		}
		
		else {// settings.animating == false 
			
			// display the full text of the current item
			var tickerText = tickerData.newsItems[tickerData.currentItem];
			
			if(tickerData.newsLinks[tickerData.currentItem].length > 0) {
				$(tickerData.newsList + ' li a').text(tickerText);
			}
			else {
				$(tickerData.newsList + ' li').text(tickerText);
			}
					
		}
		
	}

	
	// Core plugin setup and config
	jQuery.fn[name] = function(options) {
 
	  // Add or overwrite options onto defaults
	  var settings = jQuery.extend({}, jQuery.fn.newsTicker.defaults, options);
	 
    var newsItems = new Array();
		var newsLinks = new Array();
		var newsAttributes = new Array();
		var newsItemCounter = 0;
		
		// Hide the static list items
		$(settings.newsList + ' li').hide();
		
		// Store the items and links in arrays for output
		$(settings.newsList + ' li').each(function(){
			if($(this).children('a').length) {
				newsItems[newsItemCounter] = $(this).children('a').text();
				newsLinks[newsItemCounter] = $(this).children('a').attr('href');
				
				var linkAttributes = new Object();
			  	var attrs = $(this).children('a')[0].attributes;
					for (var i=0;i<attrs.length;i++) {
					linkAttributes[attrs[i].nodeName] = attrs[i].nodeValue;
				}
				if (debugMode){ 
					console.log(linkAttributes);
				}
				
		    var linkAttributesProcessed = '';
 				for (var prop in linkAttributes) {
 					// print out the attributes as a string ready for output within the anchor tag
    			linkAttributesProcessed = linkAttributesProcessed + prop + '="' + linkAttributes[prop] + '" ';
 				}
 				if (debugMode){ 
					console.log(linkAttributesProcessed);
				}
 				
				newsAttributes[newsItemCounter] = linkAttributesProcessed;
				
			}
			else {
				newsItems[newsItemCounter] = $(this).text();
				newsLinks[newsItemCounter] = '';
				newsAttributes[newsItemCounter] = '';
			}
			newsItemCounter ++;
		});
        
        var tickerElement = $(settings.newsList); // for quick reference below
        
        tickerElement.data(name, {
        	newsList: settings.newsList,
					tickerRate: settings.tickerRate,
					startDelay: settings.startDelay,
					loopDelay: settings.loopDelay,
					placeHolder1: settings.placeHolder1,
					placeHolder2: settings.placeHolder2,
					controls: settings.controls,
					ownControls: settings.ownControls,
					stopOnHover: settings.stopOnHover,
					resumeOffHover: settings.resumeOffHover,
          newsItems: newsItems,
					newsLinks: newsLinks,
					newsAttributes: newsAttributes,
					newsItemCounter: newsItemCounter - 1, // -1 because we've incremented even after the last item (above)
					currentItem: 0,
					currentPosition: 0,
					firstRun:1
        })
        .bind({
			stop: function(event) {
				// show remainder of the current item immediately
		    	tickerData = tickerElement.data(name);
		    	if (tickerData.animating) { // only stop if not already stopped
            		tickerData.animating = false;
            		if (debugMode){ 
            			console.log('stop'+tickerData.currentItem + ' ' + tickerData.animating);
            		}
               	}
		  	},
		  	play: function(event) {
		  		// show 1st item with startdelay
		    	tickerData = tickerElement.data(name);
		    	if (!tickerData.animating) { // if already animating, don't start animating again
	            	tickerData.animating = true;
	            	if (debugMode){ 
            			console.log('play'+tickerData.currentItem + ' ' + tickerData.animating);
            		}
	            	setTimeout(function(){runTicker(tickerData); tickerData = null;},tickerData.startDelay);
	            }
		  	},
		  	resume: function(event) {
		  		// start from next item, with no delay
		    	tickerData = tickerElement.data(name);
		    	if (!tickerData.animating) { // if already animating, don't start animating again
	            	tickerData.animating = true;
	            	// set the character position as 0 to ensure on resume we start at the right point
					tickerData.currentPosition = 0;
	            	tickerData.currentItem ++;
	            	if (debugMode){ 
            			console.log('resume'+tickerData.currentItem + ' ' + tickerData.animating);
            		}
		            runTicker(tickerData); // no delay when resuming.
		        }
		  	},
		  	next: function(event) {
		  		// show whole of next item
		  		tickerData = tickerElement.data(name);
		  		// stop (which sets as non-animating), and call runticker
		  		$(tickerData.newsList).trigger("stop");
		  		// set the character position as 0 to ensure on resume we start at the right point
				tickerData.currentPosition = 0;
	            tickerData.currentItem ++;
	            if (debugMode){ 
            			console.log('next'+tickerData.currentItem + ' ' + tickerData.animating);
            		}
		  		runTicker(tickerData);
		  	},
		  	previous: function(event) {
				// show whole of previous item
				tickerData = tickerElement.data(name);
		  		// stop (which sets as non-animating), and call runticker
		  		$(tickerData.newsList).trigger("stop");
		  		// set the character position as 0 to ensure on resume we start at the right point
				tickerData.currentPosition = 0;
	            tickerData.currentItem --;
	            if (debugMode){ 
            			console.log('previous'+tickerData.currentItem + ' ' + tickerData.animating);
            		}
		  		runTicker(tickerData);
			}
		}); 	
		if (settings.stopOnHover) {
	    	tickerElement.bind({			    	
			  	mouseover: function(event) {
			  		tickerData = tickerElement.data(name);
			    	if (tickerData.animating) { // stop if not already stopped
				  		$(tickerData.newsList).trigger("stop");
				  		if (tickerData.controls) { // ensure that the ticker can be resumed if controls are enabled
				  			$('.stop').hide();
			        		$('.resume').show();
				  		}
			  		}
			  	}
			});
			if (settings.resumeOffHover) { // only allowed if stopOnHover enabled
		    	tickerElement.bind({			    	
				  	mouseout: function(event) {
				  		tickerData = tickerElement.data(name);
				    	if (!tickerData.animating) { // if already animating, don't start animating again
			            	$(tickerData.newsList).trigger("resume");
			            	if (debugMode){ 
		            			console.log('resumeoffhover'+tickerData.currentItem + ' ' + tickerData.animating);
		            		}
				        }
				  	}
				});
    		}
    	}
    	
    	tickerData = tickerElement.data(name);
    	
    	// set up control buttons if the option is on
		if (tickerData.controls || tickerData.ownControls) {
			if (!tickerData.ownControls) {
				$('<ul class="ticker-controls"><li class="play"><a href="#play">Play</a></li><li class="resume"><a href="#resume">Resume</a></li><li class="stop"><a href="#stop">Stop</a></li><li class="previous"><a href="#previous">Previous</a></li><li class="next"><a href="#next">Next</a></li></ul>').insertAfter($(tickerData.newsList));
			}
			$('.play').hide();
		    $('.resume').hide();
			
		    $('.play').click(function(event){
		        $(tickerData.newsList).trigger("play");
		        $('.play').hide();
		        $('.resume').hide();
		        $('.stop').show();
		        event.preventDefault();
		    });
		    $('.resume').click(function(event){
		        $(tickerData.newsList).trigger("resume");
		        $('.play').hide();
		        $('.resume').hide();
		        $('.stop').show();
		        event.preventDefault();
		    });
			$('.stop').click(function(event){
		        $(tickerData.newsList).trigger("stop");
		        $('.stop').hide();
		        $('.resume').show();
		        event.preventDefault();
		    });
		    $('.previous').click(function(event){
		        $(tickerData.newsList).trigger("previous");
		        $('.stop').hide();
			    $('.resume').show();
		        event.preventDefault();
		    });
		    $('.next').click(function(event){
		        $(tickerData.newsList).trigger("next");
		        $('.stop').hide();
			    $('.resume').show();
		        event.preventDefault();
		    });

	    };
    	
    	// tell it to play
    	$(tickerData.newsList).trigger("play");
	};

	// News ticker defaults 
	jQuery.fn[name].defaults = {
		newsList: ".atm-Newsticker ul",
		tickerRate: 30,
		startDelay: 100,
		loopDelay: 3000,
		placeHolder1: "",
		placeHolder2: "",
		controls: false,
		ownControls: false,
		stopOnHover: true,
		resumeOffHover: true
	}

})(jQuery);


$(document).ready(function() {
	$().newsTicker();
});

	return stack;
})(stacks.stacks_in_47_page6);



