function clockwork(h, m, s, url) {
	var output = "";
	s = s*1+1;
	if(s>=60)
		m = m*1+1;
	if(m>=60)
		h = h*1+1;
	h = h % 24;
	m = m % 60;
	s = s % 60;
	
	h=h+''; m=m+'';
	
	if (h <= 9) {
		output += '<img src="'+url+'images/clock_digits/0.png" />';
		output += '<img src="'+url+'images/clock_digits/' + h + '.png" />';
	} else {
		output += '<img src="'+url+'images/clock_digits/' + h.substring(0, 1) + '.png" />';
		output += '<img src="'+url+'images/clock_digits/' + h.substring(1, 2) + '.png" />';
	}
	
	output += '<img src="'+url+'images/clock_digits/sep.png" />';
	
	if (m <= 9) {
		output += '<img src="'+url+'images/clock_digits/0.png" />';
		output += '<img src="'+url+'images/clock_digits/' + m + '.png" />';
	} else {
		output += '<img src="'+url+'images/clock_digits/' + m.substring(0, 1) + '.png" />';
		output += '<img src="'+url+'images/clock_digits/' + m.substring(1, 2) + '.png" />';
	}
	
	$("#ghclock").html(output);
	setTimeout("clockwork("+h+", "+m+", "+s+", '"+url+"')", 1000);
}

function switchTimeWether() {
	if($("#ghclock").css('display') == 'none') {
		$("#ghwether").hide();
		$("#ghclock").show();
	} else {
		$("#ghclock").hide();
		$("#ghwether").show();
	}
	setTimeout("switchTimeWether()", 5000);
}

switchTimeWether();
