﻿document.write("<script src='js/validator.js' type='text/javascript' language='javascript'></script>");
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 day  = new Array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
var month  = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

var minutes = now.getMinutes(); 
var seconds = now.getSeconds() 
//var timeValue = "" +((hours >= 12) ? "PM" : "AM" ) 
//timeValue += ((hours >12) ? hours -12 :hours) 
//timeValue += ((minutes < 10) ? ":0" : ":") + minutes 
//timeValue += ((seconds < 10) ? ":0" : ":") + seconds 
//timeValue+= day[now.getDay()];
//timeValue+= month[now.getMonth()];
var timeValue ="";

timeValue +=now.getFullYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日";
timeValue +=" ";
timeValue +=day[now.getDay()];

document.getElementById("thetime").innerHTML=timeValue;  
//document.thetime.innerHTML  = timeValue; 
timerID = setTimeout("showtime()",1000); 
timerRunning = true;} 





var flag=false; 

function DrawImage(ImgD,awidth,aheight){ 

var image=new Image(); 

image.src=ImgD.src; 

if(image.width>0 && image.height>0){ 

  flag=true; 

  if(image.width/image.height>= awidth/aheight){ 

   if(image.width>awidth){

    ImgD.width=awidth; 

    ImgD.height=(image.height*aheight)/image.width; 

   }else{ 

    ImgD.width=image.width;

    ImgD.height=image.height; 

   }

   /*ImgD.alt="bigpic"  */

  } 

  else{ 

   if(image.height>aheight){

    ImgD.height=aheight; 

    ImgD.width=(image.width*awidth)/image.height; 

   }else{ 

    ImgD.width=image.width;

    ImgD.height=image.height; 

   } 

    /*ImgD.alt="bigpic"  */ 

  } 

}

}



function locahref(){
	 username = document.getElementById("cusername").value;
	 window.open("check.php?username="+username);
}


function getlicense()
{
  if (document.getElementById('viewlicense').checked==true)
  {
    document.getElementById('license').style.display='';
  }
  else
  {
   document.getElementById('license').style.display='none';
  }
}


function regetImage(obj) {
    var today = new Date();
	var today_ms = ""
		+ today.getFullYear() + (today.getMonth() + 1) + today.getDate()
		+ today.getMinutes() + today.getSeconds() + today.getMilliseconds();
    obj.src = 'include/auth/getimg.php?' + today_ms;
}

function checkLength(which) { 
var maxChars = 1000; 
if (which.value.length > maxChars) 
which.value = which.value.substring(0,maxChars); 
var curr = maxChars - which.value.length; 
document.getElementById("chLeft").innerHTML = curr.toString(); 
} 