$(document).ready(function(){
	
	//Show the paging and activate its first link
	$("#ix_slideshow_nav a:first").addClass("selected");

	//Get size of the image, how many images there are, then determine the size of the image reel.
	var imageWidth = $("#ix_slideshow_window").width();
	var imageSum = $("#ix_slideshow_reel .ixss dt").size();
	var imageReelWidth = imageWidth * imageSum;

	//Adjust the image reel to its new size
	$("#ix_slideshow_reel").css({'width' : imageReelWidth});
	
	
	//Slider Function
	rotate = function(){
	    var triggerID = $selected.attr("rel") ; //Get number of times to slide
	    var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

	    $("#ix_slideshow_nav a").removeClass('selected'); //Remove all selected class
	    $selected.addClass('selected'); //Add selected class (the $selected is declared in the rotateSwitch function)

	    //Slider Animation
	    $("#ix_slideshow_reel").animate({
	        left: -image_reelPosition
	    }, 500 );

	}; 

	//Slider Function
	seek = function(){
	    var triggerID = $selected.attr("rel") ; //Get number of times to slide
	    var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

	    $("#ix_slideshow_nav a").removeClass('selected'); //Remove all selected class
	    $selected.addClass('selected'); //Add selected class (the $selected is declared in the rotateSwitch function)

	    //Slider Animation
	    $("#ix_slideshow_reel").animate({
	        left: -image_reelPosition
	    }, 100 );

	}; 

	//Rotation  and Timing Event
	rotateSwitch = function(){
	    play = setInterval(function(){ //Set timer
	        $selected = $('#ix_slideshow_nav li a.selected').parent().next().find('a'); //Move to the next nav item
	        if ( $selected.length === 0) { //If slideshow nav reaches the end...
	            $selected = $('#ix_slideshow_nav li a:first'); //go back to first
	        }
	        rotate(); //Trigger the paging and slider function
	    }, 6500); //Timer speed in milliseconds 
	};

	rotateSwitch(); //Run function on launch
		
	//On Hover
	$("#ix_slideshow_nav li a").hover(function() {
		$selected = $(this);
	    clearInterval(play); //Stop the rotation
		seek();
	}, function() {
	    rotateSwitch(); //Resume rotation timer
	});	

});

// Bing

var WLSearchBoxConfiguration=
{
	"global":{
		"serverDNS":"www.bing.com",
		"market":"en-US"
	},
	"appearance":{
		"autoHideTopControl":false,
		"width":800,
		"height":550,
		"theme":"Blue"
	},
	"scopes":[
		{
			"type":"web",
			"caption":"&#x43;&#x69;&#x63;&#x65;&#x72;&#x6f;&#x20;&#x53;&#x65;&#x61;&#x72;&#x63;&#x68;",
			"searchParam":"site:www.ciceroinc.com"
		}
		,
		{
			"type":"web",
			"caption":"&#x57;&#x65;&#x62;",
			"searchParam":""
		}
	]
}
