function addLeadZero(v)
{
	if(v < 10) {
		v = "0" + v;
	}
	return v;
}

function cTick()
{
 
	if(cHours == 0 && cMinutes == 0 && cSeconds == 0) {
		clearInterval(hTimer);
		return;
	}

	cSeconds --;
	if(cSeconds < 0) {
		cSeconds = 59;
		
		cMinutes --;
		if(cMinutes < 0) {
			cMinutes = 59;
			
			cHours --;
			document.getElementById('ci_hours').innerHTML = addLeadZero(cHours);
		}
		document.getElementById('ci_minutes').innerHTML = addLeadZero(cMinutes);
	}
	document.getElementById('ci_seconds').innerHTML = addLeadZero(cSeconds);
}

