//alert($().jquery);

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

function getSlider() {
	$('#slider_rotb').anythingSlider({
		theme           : 'default',
		easing          : 'swing',
		width			: 468,
		height			: 62,
		autoPlay        : true,     // If true, the slideshow will start running; replaces "startStopped" option
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 10000, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		resizeContents      : false,      // If true, solitary images/objects in the panel will expand to fit the viewport
		buildArrows         : false,      // If true, builds the forwards and backwards buttons
		buildNavigation     : false,      // If true, builds a list of anchor links to link to each panel
		buildStartStop      : false,      // If true, builds the start/stop button
		appendForwardTo     : null,      // Append forward arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null
		appendBackTo        : null,      // Append back arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null
		appendControlsTo    : null,      // Append controls (navigation + start-stop) to a HTML element (jQuery Object, selector or HTMLNode), if not null
		appendNavigationTo  : null,      // Append navigation buttons to a HTML element (jQuery Object, selector or HTMLNode), if not null
		toggleArrows        : false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
		toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
		delay               : 5000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
		animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)

		onSlideComplete : function(slider){
			//alert('Welcome to Slide #' + slider.currentPage);
			
			if(document.getElementById('rotb_slide-jump' + slider.currentPage + ''))
			{
				document.getElementById('rotb_slide-jump' + slider.currentPage + '').className	= 'rotb_link_active';
			}

			var tags = document.getElementsByTagName("a");
			
			for(var i = 0; i < tags.length; i++)
			{
				if(tags[i].id.indexOf("rotb_slide-jump") != -1)
				{
					if(tags[i].id != 'rotb_slide-jump' + slider.currentPage + '')
					{
						tags[i].className	= 'rotb_link';
					}
				}
			}
			
		}
	});

	$("#rotb_slide-jump1").click(function(){
	  $('#slider_rotb').anythingSlider(1);
	});
	
	$("#rotb_slide-jump2").click(function(){
	  $('#slider_rotb').anythingSlider(2);
	});
	
	$("#rotb_slide-jump3").click(function(){
	  $('#slider_rotb').anythingSlider(3);
	});	
}

/*
$(function(){

	$('#slider_rotb').anythingSlider({
		theme           : 'metallic',
		easing          : 'linear',
		autoPlay        : true,     // If true, the slideshow will start running; replaces "startStopped" option
		autoPlayLocked  : true,  // If true, user changing slides will not stop the slideshow
		resumeDelay     : 10000, // Resume slideshow after user interaction, only if autoplayLocked is true (in milliseconds).
		resizeContents      : false,      // If true, solitary images/objects in the panel will expand to fit the viewport
		buildArrows         : false,      // If true, builds the forwards and backwards buttons
		buildNavigation     : false,      // If true, builds a list of anchor links to link to each panel
		buildStartStop      : false,      // If true, builds the start/stop button
		appendForwardTo     : null,      // Append forward arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null
		appendBackTo        : null,      // Append back arrow to a HTML element (jQuery Object, selector or HTMLNode), if not null
		appendControlsTo    : null,      // Append controls (navigation + start-stop) to a HTML element (jQuery Object, selector or HTMLNode), if not null
		appendNavigationTo  : null,      // Append navigation buttons to a HTML element (jQuery Object, selector or HTMLNode), if not null
		toggleArrows        : false,     // If true, side navigation arrows will slide out on hovering & hide @ other times
		toggleControls      : false,     // if true, slide in controls (navigation + play/stop button) on hover and slide change, hide @ other times
		delay               : 5000,      // How long between slideshow transitions in AutoPlay mode (in milliseconds)
		animationTime       : 600,       // How long the slideshow transition takes (in milliseconds)

		onSlideComplete : function(slider){
			//alert('Welcome to Slide #' + slider.currentPage);
			
			if(document.getElementById('rotb_slide-jump' + slider.currentPage + ''))
			{
				document.getElementById('rotb_slide-jump' + slider.currentPage + '').className	= 'rotb_link_active';
			}

			var tags = document.getElementsByTagName("a");
			
			for(var i = 0; i < tags.length; i++)
			{
				if(tags[i].id.indexOf("rotb_slide-jump") != -1)
				{
					if(tags[i].id != 'rotb_slide-jump' + slider.currentPage + '')
					{
						tags[i].className	= 'rotb_link';
					}
				}
			}
			
		}
	});

	$("#rotb_slide-jump1").click(function(){
	  $('#slider_rotb').anythingSlider(1);
	});
	
	$("#rotb_slide-jump2").click(function(){
	  $('#slider_rotb').anythingSlider(2);
	});
});
*/
