$(function () {
	var checkasia2010 = new Date(); 
	checkasia2010 = new Date(checkasia2010.getFullYear(), 11 - 1, 24, 19); 
	
	var check2010 = new Date(); 
	check2010 = new Date(check2010.getFullYear(), 9 - 1, 8, 19); 	
	
	$('#checkasia2010-countdown').countdown({
		until: checkasia2010,
		timezone: +8,
		compact: true,
		format: 'dhMS',
		timeSeparator: '',
		compactLabels: ['', '', '', ''],
		layout: '<div class="count-days">{dnnn}</div>' + 
						'<div class="count-hours">{hnn}</div>' + 
						'<div class="count-mins">{mnn}</div>' + 
						'<div class="count-secs">{snn}</div>',
		serverSync: serverTime						
	}); 
	
	$('#check2010-countdown').countdown({
		until: check2010,
		timezone: -7,
		compact: true,
		format: 'dhMS',
		timeSeparator: '',
		compactLabels: ['', '', '', ''],
		layout: '<div class="count-days">{dnnn}</div>' + 
						'<div class="count-hours">{hnn}</div>' + 
						'<div class="count-mins">{mnn}</div>' + 
						'<div class="count-secs">{snn}</div>',
		serverSync: serverTime						
	});	

	function serverTime() { 
    var time = null; 
    $.ajax({url: '/wp-content/themes/checkinV2/includes/time.php', 
        async: false, dataType: 'text', 
        success: function(text) { 
            time = new Date(text); 
        }, error: function(http, message, exc) { 
            time = new Date(); 
    }}); 
    return time; 
}
	
});