function greeting()
{
   var today = new Date();
   var hrs = today.getHours();
document.write("<TABLE BORDER=0 WIDTH=150><TR><TD ALIGN=\"center\" BGCOLOR=\"#000000\">");
document.write("<font style=\"color: #FFFFFF; font-size: 8pt;\">");
   if (hrs < 1)
      document.write("日付が変わりました!!");
   else if (hrs < 2)
      document.write("今夜は夜更かし？");
   else if (hrs < 3)
      document.write("オバケの出る時間だよぉ");
   else if (hrs < 4)
      document.write("今夜は徹夜ですか？");
   else if (hrs < 5)
      document.write("早朝からおつかれさまっ");
   else if (hrs < 6)
      document.write("おはよう！お早いですね!!");
   else if (hrs < 7)
      document.write("朝ご飯の支度がんばって!!");
  else if (hrs < 8)
       document.write("いってらっしゃい!!");
   else if (hrs < 10)
      document.write("家事も仕事もがんばって!!");
   else if (hrs < 12)
      document.write("お昼ご飯の準備しましょう!!");
   else if (hrs < 13)
      document.write("お昼ご飯いただきま〜す");
   else if (hrs < 14)
      document.write("お腹いっぱい、眠いねっ!!");
   else if (hrs < 15)
      document.write("すやすや・・・・お昼寝!!");
   else if (hrs < 16)
      document.write("子供のお迎え? 帰宅の準備?");
   else if (hrs < 17)
      document.write("お洗濯取り込んだかな？");
   else if (hrs < 18)
      document.write("晩ご飯の用意しなきゃ!!");
   else if (hrs < 19)
      document.write("今夜のおかずは何かな？");
   else if (hrs < 20)
      document.write("いっただきま〜す!!");
   else if (hrs < 21)
      document.write("お風呂入んなきゃ!!");
   else if (hrs < 22)
      document.write("子供はもう寝る時間だよ!!");
   else if (hrs < 23)
      document.write("子供が寝たら・・・");
   else
      document.write("インターネットＴＩＭＥです");
document.writeln("<BR><\/FONT>");
   document.write("<FONT COLOR=#ff5555 style=\"font-size: 10pt;\">");
   document.write("<CENTER>login: ",today.getHours(),":",today.getMinutes(),":",today.getSeconds());
   document.write("[your PC]");
document.write("<\/FONT>");
document.write("<\/TD><\/TR><\/TABLE>");

}





function calendar(){

   var date = new Date();
   var Monthdays = new Array (31, 28, 31, 30, 31, 30, 31, 31, 30,31, 30, 31);
   var Days=new Array ("<FONT COLOR=#FF0000>日<\/FONT>","月","火","水","木","金","<FONT COLOR=#0000FF>土<\/FONT>");
   year = date.getYear();
   today = date.getDate(); 

   //２０００年問題
   if (year<2000){year = year+1900;}
   
   // 閏年問題
   if (((year%4==0) && (year%100!=0)) || (year%400==0)){
      Monthdays[1] = 29;
      }

   // 月の日数は？
   thisMonthDays = Monthdays[date.getMonth()];

   // 何曜日から始まるの？
   date.setDate(1);
   Startday = date.getDay();

   //テーブル処理開始
   document.write("<TABLE BORDER=\"2\" CELLSPACING=\"1\" CELLPADDING=\"0\"  BORDERCOLORLIGHT=\"#8080FF\" BORDERCOLORDARK=\"#8000FF\" BGCOLOR=\"#FFFFFF\" style=\"font-size: 11pt;\">");

   // 年月日を表示
   document.write("<TR><TH COLSPAN=7>");
   document.write(year,'年',date.getMonth()+1,'月');
   document.write("<\/TH><\/TR>");

   // 曜日を表示
   document.write("<TR>");
   for (i=0 ; i<7 ; i++){
      document.write("<TH>",Days[i],"<\/TH>");
   }
   document.write("<\/TR>");

   // 開始日まで空白の表示
   document.write("<TR>");
   col=0;
   for (i=0; i<Startday;i++){
      document.write("<TD><\/TD>");
      col++;
   }

  // 日にちの表示
   for (i=1; i<=thisMonthDays; i++){
      if (i==today){
      document.write("<TD BGCOLOR=\"#00ee00\" ALIGN=\"center\">");
      }
      else{
      document.write("<TD ALIGN=\"center\">");
      }
      if (col==0){
         document.write("<FONT COLOR=\"#FF0000\"><B>");
      }
      if (col==6){
         document.write("<FONT COLOR=\"#0000FF\"><B>");
      }

      document.write(i);

      if (col==0 || col==6){
         document.write("<\/B><\/FONT>");
      }
      document.write("<\/TD>");
      col++;
      if (col==7){
         document.write("<\/TR>\n<TR>");
         col=0;
      }
   }

   // テーブル処理終了
   document.write("<\/TABLE>");
}


var delay = 500 //点滅周期
var timerId, flash = true, clockDisp, amPm
function clock() {
      var now = new Date()
      var theHour = now.getHours()
      var theMin = now.getMinutes()
      amPm = ((theHour < 12) ? " am" : " pm")
      theHour = ((theHour >= 12) ? theHour-12 : theHour)
      clockDisp = " " + ((theHour < 10) ? " " : "") + theHour
      clockDisp += ((flash) ? ":" : " ")
      clockDisp += ((theMin <10) ? "0" : "")
      clockDisp += theMin + amPm
      document.getElementById("clock").innerHTML = clockDisp
      flash = !flash
      timerId = setTimeout("clock()", delay)
}


function chphoto(){
myLinkCnt = 8;
myLink = new Array(
 "<a href=\"http://www.sikoku.info/01machi/tokushima/index.html\" target=\"_top\"><img src=\"bizan.jpg\" border=\"0\" alt=\"眉山ローフーウエイと阿波おどり会館\"></a>",
 "<a href=\"http://www.sikoku.info/01machi/tokushima/index.html\" target=\"_top\"><img src=\"kazura.jpg\" border=\"0\" alt=\"祖谷のかずら橋\"></a>",
 "<a href=\"http://www.sikoku.info/01machi/kochi/index.html\" target=\"_top\"><img src=\"genryu.jpg\" border=\"0\" alt=\"四万十川　源流の森\"></a>",
 "<a href=\"http://www.sikoku.info/01machi/kochi/index.html\" target=\"_top\"><img src=\"ryoma.jpg\" border=\"0\" alt=\"桂浜にある坂本龍馬像\"></a>",
 "<a href=\"http://www.nanyo.info/\" target=\"_top\"><img src=\"warei_1.jpg\" border=\"0\" alt=\"愛媛県宇和島市の祭り「和霊さん」\"></a>",
 "<a href=\"http://www.sikoku.info/01machi/ehime/index.html\" target=\"_top\"><img src=\"kagaku.jpg\" border=\"0\" alt=\"愛媛県新居浜市にある県立科学博物館\"></a>",
 "<a href=\"http://www.sikoku.info/01machi/kagawa/index.html\" target=\"_top\"><img src=\"setooohasi.jpg\" border=\"0\" alt=\"瀬戸大橋\"></a>",
 "<a href=\"http://www.sikoku.info/01machi/kagawa/index.html\" target=\"_top\"><img src=\"yashima.jpg\" border=\"0\" alt=\"屋島神社から高松市街地を\"></a>"
);

myRndo = Math.floor(Math.random()*myLinkCnt);
document.write(myLink[myRndo]);
}
