﻿function top_wanichan(){
now = new Date();
month = now.getMonth()+1;
if (month <=2) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/snowman.gif alt=snowman></td><td valign=bottom><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></tr></table>";
else if (month <=4) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/cherry.gif alt='Cherry Blossoms'></td><td valign=bottom><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></tr></table>";
else if (month <=5) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/koinobori.gif alt='carp streamers'></td><td valign=bottom><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></tr></table>";
else if (month <=7) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/teruteru.gif alt=teruteru></td><td valign=bottom><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></tr></table>";
else if (month ==8) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/suika.gif alt=watermelon></td><td nowrap>Do you know what it is?</td></tr><tr><td></td><td><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></td></table>";
else if (month ==9) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/moon.gif alt=moon></td><td>It is full moon...</td></tr><tr><td></td><td><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></td></table>";
else if (month ==10) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/halloween.gif width=185 height=158 alt='Halloween'></td><td valign=bottom>Happy Halloween<br>Trick or Treat!<p><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></tr></table>";
else if (month ==11) wanichan="<table cellpadding=20><tr><td><img src=common/images/top_wani/turkey.gif alt=turkey></td><td valign=bottom>Enjoy the Thanksgiving<br>and wait for Christmas!<br><img src=common/images/top_wani/miniwani.gif width=90 height=36></td></tr></table>";
else wanichan="<div align=center><img src=common/images/top_wani/xmas.gif alt='Merry Christmas'></div>";
document.write(wanichan);
}
function wanichan_status(){
dt = new Date(); 
h=dt.getUTCHours()+9; 
if (h >=24) h -= 24; 
	if (h <= 4) 	 wanichan="It is late at night here.<BR>I am sleeping now...<br><IMG SRC='../common/images/wani_status/sleep.gif' alt='I am sleeping...'>"; 
	else if (h <= 6) wanichan="It is early in the morning here.<br>What time is it there? I am still sleeping...<BR><IMG SRC='../common/images/wani_status/sleep.gif' alt='I am sleeping...'>"; 
	else if (h < 12) wanichan="Good morning! How are you doing?<br><img src='../common/images/wani_status/wanichan.gif' alt='Pinky the Crocodile'>";
	else if (h == 12) wanichan="It is lunch time!<br>I am eating now.<br><img src='../common/images/wani_status/rice.gif' alt='I am eating'>";
	else if (h <= 14) wanichan="Welcome to Pinky the Crocodile.<BR>I want to make friends all over the world.<BR>How are you doing?<BR><IMG SRC='../common/images/wani_status/wani.gif' alt='How are you doing?'>"; 
	else if (h <= 15) wanichan="Welcome to Pinky the Crocodile.<BR>It is time to eat a cake! <BR>I am happy.<BR><IMG SRC='../common/images/wani_status/cake.gif' alt='I am eating a cake'>"; 
	else if (h <= 21) wanichan="Welcome to Pinky the Crocodile.<BR>I want to make friends all over the world.<BR>How are you doing?<BR><IMG SRC='../common/images/wani_status/wanichan.gif' alt='How are you doing?'>"; 
	else wanichan="Hi! I am Pinky the Crocodile...<br>How are you doing now?<br>it is night here.<br><IMG SRC='../common/images/wani_status/wanichan1.gif' alt='Yahho...!'>"; 
document.write (wanichan);
}

function top_last_update(){
now = new Date(document.lastModified);
if(navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE",0)+5) <= 4) {
 now.setTime(now.getTime() + 9*60*60*1000); }
year = now.getYear();
month = now.getMonth();
day = now.getDate();
week = now.getDay();
hour = now.getHours();
min = ((now.getMinutes() < 10) ? "0" : "") + now.getMinutes();
sec = ((now.getSeconds() < 10) ? "0" : "") + now.getSeconds();
wk = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
mh = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
if (year < 2000) { year = year+1900 }
document.write("<strong>- LAST UPDATE -</strong><br>"+wk[week]+", "+mh[month]+" "+day+", "+year+" "+hour+":"+min+":"+sec+" JST<br>"); 
document.write("<img src='http://hpcgi3.nifty.com/wanichan/report/report_other.cgi?"); 
document.write(document.referrer+"' width=1 height=1>"); 
}

function sysTime(){
now = new Date();
year = now.getFullYear();
month = now.getMonth()+1;
day = now.getDate();
week = now.getDay();
hour = now.getHours();
min = ((now.getMinutes() < 10) ? "0" : "") + now.getMinutes();
sec = ((now.getSeconds() < 10) ? "0" : "") + now.getSeconds();
wk = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
}

function lastupdate(){
now = new Date(document.lastModified); 
if(navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE",0)+5) <= 4) { 
 now.setTime(now.getTime() + 9*60*60*1000); } 
year = now.getFullYear(); 
month = now.getMonth(); 
day = now.getDate(); 
week = now.getDay(); 
hour = now.getHours(); 
min = ((now.getMinutes() < 10) ? "0" : "") + now.getMinutes(); 
sec = ((now.getSeconds() < 10) ? "0" : "") + now.getSeconds(); 
wk = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 
mh = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); 
document.write("<strong>Last Update:</strong> "+wk[week]+", "+mh[month]+" "+day+", "+year+" "+hour+":"+min+":"+sec+" JST<br />"); 
}
function JapanTime(){
//Japan Time Display (Japan Time Zone = GMT + 9:00) 
JapanHour = now.getUTCHours()+9; 
if (JapanHour >=24) JapanHour -= 24; 
document.write(" <br /> <strong>Japan Time:</strong> "+JapanHour+":"+min+":"+sec+""); 
}

function log_other(){
document.write("<img src='http://hpcgi3.nifty.com/wanichan/report/report_other.cgi?"); 
document.write(document.referrer+"' width=1 height=1>"); 
}

