<!--
var BEGtime = new Array(2,10,24,19,30,0);
var NOWtime = new Array(6);
var DIFtime = new Array(6);
var AMTtime = new Array(100,12,30,24,60,60);
var TYPtime = new Array("Year", "Month", "Day", "Hour", "Minute", "Second");
var TEXT = "";
var timerID = null;

function counter() {
	now = new Date();
	NOWtime = new Array( now.getYear(), now.getMonth()+1, now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds() );
//	NOWtime = new Array(  4, 10, 24, 19, 30, 1 );

	TEXT = "";
	STATUS = 0;

	NOWtime[0] = NOWtime[0] % 100;

	for ( countx = 0; countx <= 5; countx++ ) {
		createDif(countx);
	}

	for ( countx = 0; countx <= 5; countx++ ) {
		if (V_COUNTTYPE == "Text")
			displayTEXT(countx);
		else
			displayDIGIT(countx);
	}

	if (V_COUNTPOS == "Left") {
		if (V_COUNTTYPE == "Text")
			document.getElementById("countleft").innerHTML = TEXT;
		else
			document.getElementById("countleft").innerHTML = "[" + TEXT + "]";
		timerID = setTimeout("counter()",1000);
	} else if (V_COUNTPOS == "Bottom") {
		if (V_COUNTTYPE == "Text")
			document.getElementById("countbottom").innerHTML = TEXT;
		else
			document.getElementById("countbottom").innerHTML = "[" + TEXT + "]";
		timerID = setTimeout("counter()",1000);
	}

	timerID = null;
}

function createDif ( which ) {
	if ( NOWtime[which] > BEGtime[which] ) {
		if ( toSuborNot(which) ) {
			DIFtime[which] = NOWtime[which] - BEGtime[which];
		} else {
			DIFtime[which] = ( NOWtime[which] - BEGtime[which] ) - 1;
		}
	} else if ( NOWtime[which] < BEGtime[which] ) {
		if ( toSuborNot(which) ) {
			DIFtime[which] = AMTtime[which] - ( BEGtime[which] - NOWtime[which] );
		} else {
			DIFtime[which] = AMTtime[which] - ( BEGtime[which] - NOWtime[which] ) - 1;
		}
	} else {
		if ( toSuborNot(which) ) {
			DIFtime[which] = 0;
		} else {
			DIFtime[which] = AMTtime[which] - 1;
		}
	}
}

function toSuborNot ( which ) {
	if ( which == 5 ) {
		return ( 1 );
	} else {
		if ( NOWtime[which+1] > BEGtime[which+1] )
			return ( 1 );
		else if ( NOWtime[which+1] < BEGtime[which+1] )	
			return ( 0 );
		else {
			return ( toSuborNot(which+1) );
		}
	}
}

function displayTEXT(countx) {
	if ( DIFtime[countx] != 0 ) {
		if ( checklast(countx) == 1 )
			TEXT = TEXT + ", and ";
		else if ( checklast(countx) == 0 )
			TEXT = TEXT + ", ";

		TEXT = TEXT + DIFtime[countx] + " " + TYPtime[countx];
		if ( DIFtime[countx] > 1 )
			TEXT = TEXT + "s";
	}
}

function displayDIGIT(countx) {
	if ( countx > 0 )
		TEXT = TEXT + ":";
	if ( DIFtime[countx] < 10 )
		TEXT = TEXT + "0" + DIFtime[countx];
	else
		TEXT = TEXT + DIFtime[countx];
}

function checklast(countx) {
	var count = 0;
	var first = 5;

	for ( county = 0; county <= 5; county++ ) {
		if ( DIFtime[county] ) {
			count++;
			last = county;
			if ( first == 5 )
				first = county;
		}
	}

	if ( count == 1 || first == countx )
		return ( 2 );
	else if ( countx == last )
		return ( 1 );
	else
		return ( 0 );
}
// -->
