﻿var rnd_time = new Date().getTime();
//var now = new Date("Jan 1 2004 14:00:00").getTime();
var now = new Date(time_now).getTime();
var end_date = new Date("dec 7 2009 00:00:00").getTime();

getTime();

$(document).ready(function(){
	setInterval(function() {getTime()}, 1000);
});

function getTime() {
	now = now + 1000;
	days = (now - end_date) / 1000 / 60 / 60 / 24;
	daysRound = Math.floor(days+1);
	hours = (end_date - now) / 1000 / 60 / 60 - (24 * daysRound);
	hoursRound = Math.floor(hours);
	minutes = (end_date - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
	minutesRound = Math.floor(minutes);
	seconds = (end_date - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
	secondsRound = Math.round(seconds);
	if ( hoursRound < 10 )
	{
		hoursRound = "0" + hoursRound;
	}
	if ( minutesRound < 10 )
	{
		minutesRound = "0" + minutesRound;
	}
	if ( secondsRound < 10 )
	{
		secondsRound = "0" + secondsRound;
	}
	min = "&nbsp;&nbsp;&nbsp;";
	hr = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	dy = "&nbsp;&nbsp;&nbsp;&nbsp;";
	dypre = "&nbsp;&nbsp;";
	if (daysRound>100)
	{
	    dypre="";
	}	
//	$("#lost_time").html('');
}




// 初始化 - Jquery_auto.js
$.auto = {
	init: function() {
		for (module in $.auto) {
			if ($.auto[module].init)
				$.auto[module].init();
		}
	}
};

$(document).ready($.auto.init);


// 鼠标移动显示
$.auto.hover = {
	init: function() {
		$('IMG.Hover')
			.bind('mouseover', this.enter)
			.bind('mouseout', this.exit)
			.each(this.preload);
	},
	preload: function() {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
	},
	enter: function() {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
	},
	exit: function() {
		this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");
	}
};