/*
	NOTES
		<rotateHomeImage>
			fileBase and urlLinks set through backend
*/
function showAllEvents(){
	document.getElementById('allEvents').style.display = 'block';
	document.getElementById('allEventsLink').style.display = 'none';
	document.productSelect.goProductSelect.style.visibility = 'hidden';
}
function closeAllEvents(){
	document.getElementById('allEvents').style.display = 'none';
	document.getElementById('allEventsLink').style.display = 'block';
	document.productSelect.goProductSelect.style.visibility = 'visible';
}
function rotateHomeImage(fileBase,urlLinks){
	var imageRotation;
	var rotationSpeed = 6000;
	var urlArray = urlLinks.split("|");
	var myLinks = new Array(totalRotation)
	var totalRotation = urlArray.length;

	bytefx.fade(document.getElementById('BigImage'), 100, 0,100, function(){
		if(getCookie('nanoHome') == null){
			SetGetCookie('nanoHome',1);
		}else{
			if(parseFloat(getCookie('nanoHome')) >= parseFloat(totalRotation)){
				SetGetCookie('nanoHome',1)
			}else{
				SetGetCookie('nanoHome',(parseFloat(getCookie('nanoHome'))+1))
			}
		}
		imageRotation = fileBase + getCookie('nanoHome');
		document.images["BigImage"].src = '/images/' + imageRotation + '.jpg';
		//document.images["BigImage"].src = '/images/bi_rot_c_2.jpg';				//Test
		document.images["BigImage"].alt = urlArray[getCookie('nanoHome')-1] + isDotNet();
		bytefx.fade(document.getElementById('BigImage'), 0,100,3, function(){
			setTimeout('rotateHomeImage(\'' + fileBase + '\',\'' + urlLinks + '\')',rotationSpeed);
		});
	});
	document.getElementById('BigImage').onclick = function(){
		if(urlArray[getCookie('nanoHome')-1].length > 0){
			urlGo = urlArray[getCookie('nanoHome')-1] + isDotNet();
			window.location.href = urlGo;
		}
	}
}
function loadPr(){
	xmlhttpPost('/include/scrape/getPr.aspx','getPr');
}
function loadEvents(){
	if(document.getElementById('ulPr')){
		xmlhttpPost('/include/scrape/getEvents.aspx','getEvents');
		setTimeout('fixEvents()',700);
	}else{
		setTimeout('loadEvents()',500);
	}
}
function goGetUrl(formName,selectName){
	window.location.href = eval('document.' + formName + '.' + selectName).options[eval('document.' + formName + '.' + selectName).selectedIndex].value;
}
function fixEvents(){
	//manual overide
	//document.getElementById('dateStrt0').innerHTML = '08/14/08';
	//document.getElementById('dateEnd0').innerHTML = '';
	//document.getElementById('through0').style.display = 'none'; 
	//document.getElementById('dateStrt1').innerHTML = '09/03/08';
	//document.getElementById('through1').style.display = 'none'; 
}
