/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//																								COUNTDOWN    ///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var iMainPhotoSelectedIndex=1;
var iMainPhotoTimer=0;
var iMainPhotoMaxItems=1;

var oOneSecondInterval = null;
function fnShowRemainingTime() {
	
  	var clngMLeft = Math.floor(clngSLeft / 60);
  	var clngHLeft = Math.floor(clngMLeft / 60);
  	var clngDLeft = Math.floor(clngHLeft  / 24);
  	var strDisplay = '', strCounterDesc = '';

	if (document.getElementById('timeLeft', 0) != null) {
		
		strDisplay += (clngDLeft > 0) ? ('<span class="Day">' + ((clngDLeft <10) ? '0' : '') + clngDLeft + '</span>') : '<span class="Day">00</span>';
		
		
		
		var iTemp 
		iTemp = clngHLeft - (clngDLeft*24)
		strDisplay += (iTemp > 0) ? ('<span class="Hour">' + ((iTemp <10) ? '0' : '') + iTemp + '</span>') : '<span class="Hour">00</span>';
		
		iTemp = (clngMLeft - (clngHLeft*60))
		strDisplay += (iTemp > 0) ? ('<span class="Min">' + ((iTemp <10) ? '0' : '') + iTemp + '</span>') : '<span class="Min">00</span>';
	
						
		document.getElementById('timeLeft').innerHTML = strDisplay;
	}
	if (blnCountDown) {	clngSLeft--; } else {clngSLeft++;}
	if (oOneSecondInterval == null) { oOneSecondInterval = window.setInterval("fnShowRemainingTime()", 1000); }
	if (clngSLeft < 0) { fnMarathonStart(); }
	if (iMainPhotoTimer>0) {doChangeMainPhoto();}
}
function fnMarathonStart() {
	blnCountDown = false;
	clngSLeft=1;
	document.getElementById('timeLeft').style.display = 'none'
}




function doChangeMainPhoto(){
	iMainPhotoTimer = iMainPhotoTimer + 1;
	if (iMainPhotoTimer>12){
		iMainPhotoTimer=1;
		iMainPhotoSelectedIndex = iMainPhotoSelectedIndex + 1;
		if (iMainPhotoSelectedIndex>iMainPhotoMaxItems) {iMainPhotoSelectedIndex=1}
			for (var i=1;i <= iMainPhotoMaxItems;i++){
						if (iMainPhotoSelectedIndex==i){
							document.getElementById('MainHeaderItem' + i).style.display='block';
						}else {
							document.getElementById('MainHeaderItem' + i).style.display='none';
						}
			}
	}
}


