//Images and related information to include in the marqueevar dataSource = [   	{		text: 'Learn effective strategies for relieving stress.', 				title: 'Learn effective strategies for relieving stress.', 		url: 'http://www.counseling.eku.edu/students/selfhelp/101ways.php', 		img: 'http://www.counseling.eku.edu/img/marquee/relieve_stress.png',		thumb: 'http://www.counseling.eku.edu/img/marquee/thumbs/relieve_stress_tn.png',		top: '-15'	},  	{		text: 'Discover methods for improving self-esteem.', 		title: 'Discover methods for improving self-esteem.', 		url: 'http://www.counseling.eku.edu/', 		img: 'http://www.counseling.eku.edu/img/marquee/esteem3.png',		thumb: 'http://www.counseling.eku.edu/img/marquee/thumbs/esteem2_tn.png',				top: '-15' 	},	{		text: 'Gain new insights for making effective decisions.', 		title: 'Gain new insights for making effective decisions.', 		url: 'http://www.counseling.eku.edu', 		img: 'http://www.counseling.eku.edu/img/marquee/effective_decisions.png',		thumb: 'http://www.counseling.eku.edu/img/marquee/thumbs/effective_decisions_tn.png',				top: '-15'	},		{		text: 'Find ways to improve self confidence.', 		title: 'Find ways to improve self confidence.', 		url: 'http://www.counseling.eku.edu', 		img: 'http://www.counseling.eku.edu/img/marquee/confidence3.png',		thumb: 'http://www.counseling.eku.edu/img/marquee/thumbs/confidence2_tn.png',				top: '-15'	}];//Preload Imagesvar preloaded = new Array();function preload_images() {    for (var i = 0; i < dataSource.length; i++){        preloaded[i] = document.createElement('img');        preloaded[i].setAttribute('src',dataSource[i]["img"]);    };};preload_images();var hashSize=dataSource.length;var currentHash=0;var intval="";var timeForInterval=10000; // 1000 = 1 second$(function(){    	$("#nextRight").click(function()    {		//stop interval				if(intval!="")		{          window.clearInterval(intval);			}        //var imageSource = $(this).children("img").attr("src");		if(currentHash<(hashSize-1))		{			currentHash++;			showImage(currentHash);			}        //return false;     });	$("#nextLeft").click(function()    {		//stop interval		if(intval!="")		{          window.clearInterval(intval);			}		        //var imageSource = $(this).children("img").attr("src");		if((currentHash-1)>=0)		{			currentHash--;				showImage(currentHash);			}        //return false;     }); });function startRotation(){	showImage(0);    intval=window.setInterval("nextImage()",timeForInterval);}function nextImage(){		//clear hash after one loop		if(currentHash>=(hashSize-1))		{          window.clearInterval(intval);			  //showImage(0);		  //currentHash=0;		}				else if(currentHash<(hashSize-1))		{			//show next image			currentHash++;			showImage(currentHash);			}			else //do nothing		{}	}function showImage(currentItem){	var buttonHTML="";	//buttonHTML+=leftButton;	/* Normal Routine	for(var i=0; i<hashSize; i++)	{		if(currentItem==i)			buttonHTML+='<img src="http://www.eku.edu/img/whiteMarqueeButton.png" />';		else 			buttonHTML+='<img src="http://www.eku.edu/img/darkMarqueeButton.png" />';	}	*/		buttonHTML	for(var i=0; i<hashSize; i++)	{		if(currentItem==i)			buttonHTML+='<a class="marqThumbCurrent" style="float: left; background: url('+dataSource[i]["thumb"]+'); background-position: center; " onclick="showMarqThumb('+i+');"></a>';		else 			buttonHTML+='<a class="marqThumb" style="float: left; background: url('+dataSource[i]["thumb"]+'); background-position: center;" href="javascript:showMarqThumb('+i+');  "></a>';	}	//To add the fade effect exchange the two following lines of code	//$("#marquee").fadeOut('fast', function() 	$("#subMarquee").fadeIn('fast', function() 	{		$("#subMarquee").attr("src",dataSource[currentItem]["img"]).fadeIn('fast');		$("#subMarquee").css('margin-top', dataSource[currentItem]['top']+"px");			//$("#subMarquee").css("background-image", "url("+dataSource[currentItem]["img"]+")").fadeIn('fast');			//$("#marqueeBarLeft p").html(dataSource[currentItem]["text"]+"").fadeIn('fast');		$("#imageDotRow").html(""+buttonHTML+"").fadeIn('fast');		//$("#clickableMarqueeLink").attr("href", dataSource[currentItem]["url"]);				//$("#clickableMarqueeLink").attr("title", function () { return dataSource[currentItem]["title"]});		$("#subMarquee").click(function () { window.location=""+dataSource[currentItem]["url"]+"";});				$("#subMarquee").attr("title", function () { return dataSource[currentItem]["title"]});				if(dataSource[currentItem]["url"]!="")		{						$("#subMarquee").css('cursor', 'pointer');		}	});}function showMarqThumb(specificThumb){	//stop interval			if(intval!="")	{        window.clearInterval(intval);		}	showImage(specificThumb);	currentHash=specificThumb;}