function getRndmImg() {
	var n = 6;
	var m = Math.floor(Math.random() * n) + 1;
	document.write('<td class="cls_top_logo" colspan="2" background="image/top_img_10'+m+'.jpg" height="224">');
}

function getTtlImg() {
	var tm = new Date();
	var hr = tm.getHours(); 
	if ((hr > 7) && (hr < 21)) {
		document.write('<td colspan="3" background="image/top_img_0.jpg" height="223">');
	} else {
		document.write('<td colspan="3" background="image/top_img_0.jpg" height="223">');
	}
}


function xyDay(by,bm,bd,ey,em,ed,strng)
{
	var today, xday, yday, dayMS, n, m;

	today = new Date();
	xday  = new Date(by,bm-1,bd);
	dayMS = 24*60*60*1000;
	n = Math.ceil((xday.getTime()-today.getTime())/dayMS);
	if ((ey == 0) && (em == 0) && (ed == 1)) {
		if (n < -30) {
		} else {
			document.write("<font color='red'>"+by+"/"+bm+"/"+bd+"〜</font>　");
			document.write(strng);
			if (n > 0) {
				document.write("<b> 開催まであと・・<font color='red'>" + n + "</font></b>日");
			} else {
				document.write("<b><font size='+1' color='red'> 開催中！</font></b>");
			}
			document.write("<br>");
		}
  }
	if ((ey == 0) && (em == 0) && (ed == 0)) {
		if (n < -30) {
		} else {
			document.write("<font color='red'>"+by+"/"+bm+"/"+bd+"〜</font>　");
			document.write(strng);
			if (n > 0) {
				document.write("<b> 開業まであと・・<font color='red'>" + n + "</font></b>日");
			} else {
				document.write("<b><font size='+1' color='red'> 開業！</font></b>");
			}
			document.write("<br>");
		}
	} else {
		yday  = new Date(ey,em-1,ed);
		m = Math.ceil((yday.getTime()-today.getTime())/dayMS);

		if (m < 0) {
		} else {
			document.write("<font color='red'>"+by+"/"+bm+"/"+bd+"〜"+ey+"/"+em+"/"+ed+"</font>　");
			document.write(strng);
			if (n > 0) {
				document.write("<b> 開催まであと・・<font color='red'>" + n + "</font></b>日");
			} else {
				document.write("<b><font size='+1' color='red'> 現在開催中</font></b>");
			}
			document.write("<br>");
		}
	}
}
