/*
Author: Marco Chiodetti
Email: devilmark84 at hotmail dot it

Require jQuery!

Add class "k_digitalclock" to object containing the time!

<div class="k_digital_clock">
	<span class="hour">12</span>
	<span class="sep">:</span>
	<span class="minutes">13</span>
	<span class="sep">:</span>
	<span class="seconds">55</span>
</div>
*/



jQuery(document).ready(function() {
	//CONFIGURATION AREA
	
	//END OF CONFIGURATION AREA
	/////////////////////////DO NOT EDIT BELOW THIS LINE!!!////////////////////////////////
	jQuery.fn.incr_time = function() {
		$seconds++;
		if ($seconds==60) {
			$seconds = 0;
			$minutes++;
		}
		if ($minutes==60) {
			$minutes = 0;
			$hour++;
		}
		if ($hour==24) {
			$hour = 0;
		}
		jQuery("span.hour").html((String($hour).length==1) ? "0"+$hour : $hour);
		jQuery("span.minutes").html((String($minutes).length==1) ? "0"+$minutes : $minutes);
		//jQuery("span.seconds").html((String($seconds).length==1) ? "0"+$seconds : $seconds);
		if ($seconds % 2) jQuery("span.sep:first").css("visibility","visible");
		else jQuery("span.sep:first").css("visibility","hidden");
	}
	
	
	$hour = jQuery("span.hour").html();
	$minutes = jQuery("span.minutes").html();
	$seconds = jQuery("span.seconds").hide().html();
	jQuery("span.sep:not(:first)").hide();
	
	//incr_time();
	timer = setInterval('jQuery(document).incr_time()',1000);
	
})