﻿function clock(){
	nowDate = new Date();
	theD = String(nowDate.getDate());
	theMon = nowDate.getMonth() + 1;
	theY = String(nowDate.getFullYear());
	theH = String(nowDate.getHours());
	theMin = String(nowDate.getMinutes());
	theS =String(nowDate.getSeconds());
	
	nowDate = "";
	if(theD < 10){
		theD10 = 0;
	}else{
		theD10 = theD.charAt(0);
		theD = theD.charAt(1);
	}
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theD10 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theD + '.gif" /></p>';
	
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/mon' + theMon + '.gif" /></p>';
	
	theY1000 = theY.charAt(0);
	theY100 = theY.charAt(1);
	theY10 = theY.charAt(2);
	theY = theY.charAt(3);
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theY1000 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theY100 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theY10 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theY + '.gif" /></p>';
	
	if(theH < 13){
		nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/am.gif" /></p>';
	}else{
		nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/pm.gif" /></p>';	
	}
	theH = String(theH % 12);
	if(theH < 10){
		theH10 = 0;
	}else{
		theH10 = theH.charAt(0);
		theH = theH.charAt(1);
	}
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theH10 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theH + '.gif" /></p>';
	
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/colon.gif" /></p>';
	
	if(theMin < 10){
		theMin10 = 0;
	}else{
		theMin10 = theMin.charAt(0);
		theMin = theMin.charAt(1);
	}
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theMin10 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theMin + '.gif" /></p>';
	
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/colon.gif" /></p>';
	
	if(theS < 10){
		theS10 = 0;
	}else{
		theS10 = theS.charAt(0);
		theS = theS.charAt(1);
	}
	nowDate += '<p><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theS10 + '.gif" /><img src="http://jille.jp.move.siteserve.jp/common/images/clock/' + theS + '.gif" /></p>';
	
	$("#clock").html(nowDate);
	setTimeout("clock()",1000);
}

$(function(){
	clock();
});
