/*显示年月日*/
function y2k(number) { return (number < 1000) ? number + 1900 : number; } 
 
function dispdate(){ 
     var now = new Date(); 
     var dd = now.getDate() , mt = now.getMonth() + 1 , yy = y2k(now.getYear()) , weekVal = now.getDay(); 
 
        if (weekVal==0) 
       msg1="星期日"; 
    else if (weekVal==1) 
        msg1="星期一";  
    else if (weekVal==2) 
        msg1="星期二";  
    else if (weekVal==3) 
            msg1="星期三";  
    else if (weekVal==4) 
            msg1="星期四";  
    else if (weekVal==5) 
            msg1="星期五";  
    else if (weekVal==6) 
            msg1="星期六";  
 
   document.write(yy+"年"+mt+"月"+dd+"日"+" "+msg1); 
}

function dispdate2(){ 
     var now = new Date(); 
     var dd = now.getDate() , mt = now.getMonth() + 1 , yy = y2k(now.getYear()) , weekVal = now.getDay(); 

   document.write(yy+"年"+mt+"月"+dd+"日"); 
}

/*显示时间*/
var timerID = null
var timerRunning = false
function stopclock(){
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}
function startclock(){
    stopclock()
    showtime()
}
function showtime(){
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    var seconds = now.getSeconds()
    var timeValue = "" + hours
    //= "" + ((hours > 12) ? hours - 12 : hours)
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds
    document.clock.face.value = timeValue 
    timerID = setTimeout("showtime()",1000)
    timerRunning = true
}
/*显示welcome*/
function welcome()
   {
    var newnow = new Date()
    var nowhours=newnow.getHours()
    var welcome=""
    if(nowhours>=6 && nowhours<=12)
       {welcome += ("上午好:)")}
    if(nowhours>12 && nowhours<=18) 
       {welcome += ("下午好:)")}
    if(nowhours>18 && nowhours <=24)
       {welcome +=("晚上好:)")}
    if(nowhours<6) 
       {welcome += ("深夜好 :)")}
    document.write(welcome)
}
/*翻转颜色*/
  function mOvr(src,clrOver) {
    if (!src.contains(event.fromElement)) {
	  src.style.cursor = 'hand';
	  src.bgColor = clrOver;
	}
  }
  function mOut(src,clrIn) {
	if (!src.contains(event.toElement)) {
	  src.style.cursor = 'default';
	  src.bgColor = clrIn;
	}
  }
  function mClk(src) {
    if(event.srcElement.tagName=='TD'){
	  src.children.tags('A')[0].click();
    }
  }