﻿function clock(){
	nowDate = new Date();
	theD = String(nowDate.getDate());
	theMon = nowDate.getMonth() + 1;
	theMonNum = String(nowDate.getMonth() + 1);
	theY = String(nowDate.getFullYear());
	
	nowDate = "";
	
	nowDate += '<div class="dateimg"><p><img src="/common/images/date/autumn.gif" /></p></div>';
	
	if(theMonNum < 10){
		theMonNum10 = 0;
	}else{
		theMonNum10 = theMonNum.charAt(0);
		theMonNum = theMonNum.charAt(1);
	}
	
	if(theD < 10){
		theD10 = 0;
	}else{
		theD10 = theD.charAt(0);
		theD = theD.charAt(1);
	}
	nowDate += '<div class="date1"><p><img src="/common/images/date/b' + theMonNum10 + '.gif" /><img src="/common/images/date/b' + theMonNum + '.gif" /></p></div>';
	
	nowDate += '<div class="line"><p><img src="/common/images/date/line.gif" /></p></div>';
	
	nowDate += '<div class="date2"><p><img src="/common/images/date/today.gif" /></p></div>';
	
	nowDate += '<div class="date3"><p><img src="/common/images/date/m' + theMon + '.gif" /></p><p class="dot"><img src="/common/images/date/dot.gif" /></p>';
	
	nowDate += '<p><img src="/common/images/date/s' + theD10 + '.gif" /><img src="/common/images/date/s' + theD + '.gif" /></p><p class="dot"><img src="/common/images/date/dot.gif" /></p>';
	
	theY1000 = theY.charAt(0);
	theY100 = theY.charAt(1);
	theY10 = theY.charAt(2);
	theY = theY.charAt(3);
	nowDate += '<p><img src="/common/images/date/s' + theY1000 + '.gif" /><img src="/common/images/date/s' + theY100 + '.gif" /><img src="/common/images/date/s' + theY10 + '.gif" /><img src="/common/images/date/s' + theY + '.gif" /></p></div>';
	
	nowDate += '<div class="date4"><p><img src="/common/images/date/rideurl.gif" /></p></div>';
	
	$("#clock").html(nowDate);
}

$(function(){
	clock();
});
