   	var rotationOn;
	var pic;
	var nextImg = new Image();
	var prevImg = new Image();
	var newImg = new Image();
	var picIndex;
	var imgLink;
	var picDiv;
	var stopButton;
	var nextButton;
	var prevButton;
	var timeoutID;
	var picFolder = "images/imageslider/";
	
	function initHome (){
		if (typeof(document.all) == 'object') {
			var isIE = true;
			if (navigator.userAgent.indexOf("Mac") != -1) 
				var isIEMac = true;
		}
		
		if (document.getElementById) {
			pic = document.getElementById("featurePic");
			picDiv = document.getElementById("featurePicDiv");
			imgLink = document.getElementById("featureLink");
			
			if (isIE && !isIEMac) { // IE PC only 
				initPicRotation();
			}
			
			if (isIEMac) {
				adjustFeaturePicOnMacIE();
				window.onresize = adjustFeaturePicOnMacIE;
			}
		}
		else {
			for (i=0;i<document.styleSheets.length;i++) {
				document.styleSheets(i).disabled = true;
			}
		}
	}
	
	/********* HACK FOR IE5 MAC featurePic SIZE AS OVERFLOW:HIDDEN DOES NOT WORK ************/
	
	function adjustFeaturePicOnMacIE () {
		pic.style.width = "100%";
		if (pic.offsetWidth > 700)
			pic.style.width = "700px";
		picDiv.style.height = pic.offsetHeight + "px";
	}
	
	/*********** IE/PC-ONLY IMAGE-ROTATION SCRIPTS START HERE *************/
	
	function initPicRotation () {
		stopButton = document.getElementById("stopButton");
		
		if (noRotationURL == "true") {
			rotationOn = false;
		}
		else if (getCookie("stopRotation") == "true") {
			rotationOn = false;
			showPlayButton();
		}
		else {
			rotationOn = true;
			showStopButton();
			timeoutID = setTimeout("changePic('next');", 7000);
		}
		
		nextButton = document.getElementById("nextButton");
		nextButton.onclick = showNextPic;
		
		prevButton = document.getElementById("prevButton");
		prevButton.onclick = showPreviousPic;
		
		preloadPics();
	}
   
    function preloadPics () {
		var newIndex;
		newIndex = picIndex + 1;
		if (newIndex >= picArr.length) 
			newIndex = 0;
		nextImg.src = picFolder + picArr[newIndex][0];
	
		newIndex = picIndex - 1;
		if (newIndex < 0) 
			newIndex = picArr.length - 1;
		prevImg.src = picFolder + picArr[newIndex][0];
	}
	
	function changePic (direction) {
		if (direction == "next") {
			newImg = nextImg;
			picIndex++;
			if (picIndex >= picArr.length) 
				picIndex = 0;
		}
		else {
			newImg = prevImg;
			picIndex--;
			if (picIndex < 0) 
				picIndex = picArr.length - 1;
		}
		
		if (newImg.readyState) {
			//if image is cached
			if (newImg.readyState == "complete") {
				showImage();
			}
			//if images is *not* cached
			else {
				newImg.onload = showImage;
			}
		}
	}
	
	function showImage () {
		if (pic.filters) {
			pic.style.filter="blendTrans()";
			pic.filters.blendTrans.Apply();
		}
		pic.src = newImg.src;
			
		changeLink();
		if (pic.filters && pic.filters.blendTrans) 
			pic.filters.blendTrans.Play();
		if (rotationOn) {
			clearTimeout(timeoutID);
			timeoutID = setTimeout("changePic('next');", 7000);
		}
		preloadPics();
	}
	
	function changeLink () {
		imgLink.href = picArr[picIndex][1];
	}
	
	
	function showNextPic () {
		clearTimeout(timeoutID);
		changePic("next");
		return false;
	}
	
	function showPreviousPic () {
		clearTimeout(timeoutID);
		changePic("prev");
		return false;
	}
	
	function showPlayButton () {
		stopButton.innerHTML = "| <a class='moreLinks' href='/' onclick='startRotation(); return false;'>PLAY</a> ";
	}
	
	function showStopButton () {
		stopButton.innerHTML = "| <a class='moreLinks' href='/' onclick='stopRotation(); return false;'>STOP</a> ";
	}
	
	function stopRotation () {
		document.cookie = "stopRotation=true;";
		if (getCookie("stopRotation") != "true")
			window.location.href = "index.php?norotate";
		rotationOn = false;
		clearTimeout(timeoutID);
		showPlayButton();
	}
	
	function startRotation () {
		if (getCookie("stopRotation"))
			document.cookie = "stopRotation=; expires=Thu, 01-Jan-70 00:00:01 GMT";
		rotationOn = true;
		showNextPic();
		clearTimeout(timeoutID);
		timeoutID = setTimeout("changePic('next');", 7000);
		preloadPics();
		showStopButton();
	}
	
	function getCookie(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) 
				return null;
		} 
		else
			begin += 2;
		var end = document.cookie.indexOf(";", begin);
		if (end == -1)
			end = dc.length;
		return unescape(dc.substring(begin + prefix.length, end));
	}
