var secondsDiff;

$(document).ready(function() {
	
	var now = new Date();
	var end = new Date(2010, 8, 14, 0, 0, 0, 0);
	secondsDiff =  Math.floor((end-now)/1000);	
	setInterval("countdown()", 1000);
	
	$("#logos img").mouseover(function() {
		var src = $(this).attr("src");
		$(this).attr("src", src.replace("-off", "-on"));
	});
	$("#logos img").mouseout(function() {
		var src = $(this).attr("src");
		$(this).attr("src", src.replace("-on", "-off"));
	});

});

function countdown() {
	secondsDiff--;
	var minutes = Math.floor((secondsDiff/60));
	var hours = Math.floor((secondsDiff/60/60));
	var days = Math.floor((secondsDiff/24/60/60));
	hours = hours-(days*24);
	minutes = minutes-((days*24*60)+(hours*60));
	var seconds = secondsDiff-((days*24*60*60)+(hours*60*60)+(minutes*60));
	if($("#days").html() == "" && $("#hours").html() == "" && $("#minutes").html() == "" && $("#seconds").html() == "") {
		$("#days").fadeIn();
		$("#hours").fadeIn();
		$("#minutes").fadeIn();
		$("#seconds").fadeIn();
	}
	$("#days").html(days);
	$("#hours").html(hours);
	$("#minutes").html(minutes);
	$("#seconds").html(seconds);
}