//以下是年月日星期显示
tmpDate = new Date();date=tmpDate.getDate();month=tmpDate.getMonth()+1;year=tmpDate.getYear();document.write(year);document.write(" 年 ");document.write(month);document.write(" 月");document.write(date);document.write(" 日 &nbsp;");myArray=new Array(6);myArray[0]="星期日&nbsp;&nbsp; "
myArray[1] = "星期一&nbsp;&nbsp; "
myArray[2] = "星期二&nbsp;&nbsp; "
myArray[3] = "星期三&nbsp;&nbsp; "
myArray[4] = "星期四&nbsp;&nbsp; "
myArray[5] = "星期五&nbsp;&nbsp; "
myArray[6] = "星期六&nbsp;&nbsp; "
weekday = tmpDate.getDay();
if (weekday == 0 | weekday == 6)
{
    document.write(myArray[weekday])
}
else
{
    document.write(myArray[weekday])
};


//以下是时间显示
var tags_before_clock = "";
var tags_after_clock = "";

if (navigator.appName == "Netscape")
{
    document.write('<layer id="clock"></layer>');
}

if (navigator.appVersion.indexOf("MSIE") != -1)
{
    document.write('<span id="clock"></span>');
}

function showclock()
{ 
    var date = new Date();
    var hour = date.getHours();
    var min = date.getMinutes(); 
    var sec = date.getSeconds();
    var col = ":";
    var spc = " ";
    var apm; 

    if (hour > 24) 
    { 
        apm = "P.M.";
        hour = hour-24;
    }
    else 
    {
        apm = "A.M.";
    }

    if (hour == 0) hour = 24;
    if (min <= 9) min = "0" + min;
    if (sec <= 9) sec = "0" + sec;

    if (navigator.appName == "Netscape") 
    {
        document.clock.document.write(tags_before_clock + hour + col + min + col + sec + spc + tags_after_clock);
        document.clock.document.close();
    }

    if (navigator.appVersion.indexOf("MSIE") != -1)
    {
        clock.innerHTML = tags_before_clock+hour
        +col+min+col+sec;
    }
} 

setInterval("showclock()", 1000);