$(document).ready(function(){
	
	var Temp2;
	var timerID = null;
	var timerRunning = false;
	function arry() {
		this.length = 12;
		this[0] = 31;
		this[1] = 28;
		this[2] = 31;
		this[3] = 30;
		this[4] = 31;
		this[5] = 30;
		this[6] = 31;
		this[7] = 31;
		this[8] = 30;
		this[9] = 31;
		this[10] = 30;
		this[11] = 31;
	}
	var date = new arry();

	function stopclock() {
		if(timerRunning){
			clearTimeout(timerID);
			timerRunning = false;
		}
	}

	function startclock() {
		stopclock();
		showtime();
	}

	function showtime() {
		now = new Date();
		var CurMonth = now.getMonth();
		var CurDate = now.getDate();
		var CurYear = now.getFullYear();
		now = null;
		if (22 < CurDate) {
			CurDate -= date[CurMonth]; CurMonth++;
		}
		if (3 < CurMonth) {
			CurMonth -= 12; CurYear++;
		}
		var Yearleft = 2012 - CurYear;
		var Monthleft = 3 - CurMonth;
		var Dateleft = 22 - CurDate;
		
		$(".london2012 p.time span span.m").empty().append(Monthleft);
		$(".london2012 p.time span span.d").empty().append(Dateleft);

		timerID = setTimeout("showtime()",1000);
		timerRunning = true;

	}
	
	startclock();
	
	
});
