function checkChina(str)
{
  var i,j
  for (i=0; i<str.length; i++)
  { 
   j=str.charCodeAt(i);
   if (j<128) return false;
  }
  return true;
}

//中文、英文字母、数字、下划线、减号
function checkstr(str) 
{
  var i,j,k,intL;
  intL=str.length;

  if (intL==0) return false;

  for (i=0; i<intL; i++)
  { 
   j=str.charCodeAt(i);
   k=((j>=128) || (j>=97 && j<=122) || (j>=65 && j<=90) || (j>=48 && j<=57) || (j==45) || (j==95));
   if (!k) return false;
  }
  return true;
}

function checkdate(sDate)
{
  var dateRegExp = /\d{4}-\d{1,2}-\d{1,2}/gi;
  var strDate = sDate;
  
  if (strDate.search(dateRegExp) == -1) {
    return false;
  }
  return true;
}

function checkDay(y,m,d)
{
 switch (m) {
   case "2":
     intY=parseInt(y);
     if (intY%4==0) endD=29; else endD=28;
     break;
   case "4":
   case "6":
   case "9":
   case "11":endD=30; break;
   default:endD=31;  }
 if (parseInt(d)>endD) return false;
 return true;
} 

function checkpost(sDate)
{
  var dateRegExp = /\d{6}/gi;
  var strDate = sDate;
  
  if (strDate.search(dateRegExp) == -1) {
    return false;
  }
  return true;
}

function checknumber(data)
{
  var datastr = data;
  if (datastr.search(/\D/gi) != -1) return false;
  if (datastr.search(/\S/gi) == -1) return false;
  return true;
}

function checkemail(email)
{
  var semail = email;
  var myRegExp = /[a-z0-9](([_\.a-z0-9]|-)*)@(([_a-z0-9]|-)+)((\.([_a-z0-9]|-)+)+)/gi;
  var answerind = semail.search(myRegExp);
  var answerarr = semail.match(myRegExp);
  var arremail = new String("");
  if (answerind == 0 && answerarr[0].length == semail.length) return true;
  return false;
}

function checkchar(str)
{
  var myStrExp = /([_\.a-z0-9]|-)+/gi;
  var answerind = str.search(myStrExp);
  var answerarr = str.match(myStrExp);
  if (answerind == 0 && answerarr[0].length == str.length) return true;
  return false;
}

function checkblank(str)
{
  if (str.replace(/[ ]/g,"")=="") return true;
  return false;
}

function CutSpace(string) 
{
 var temp = "";
 string = '' + string;
 splitstring = string.split(" ");
 for(i = 0; i < splitstring.length; i++) temp += splitstring[i];
 return temp;
}

function checkNum(str)
{
 var temp;
 temp=CutSpace(str);
 if (isNaN(temp) || temp=="") return false;
 return true;
}

function openWindow(url,w,h,l,t)
{ 
var focusok=false;
if (navigator.appName == "Netscape") focusok=true;

WinC='toolbar=no,resizable=yes,top='+t+',left='+l+',directories=no,status=no,scrollbars=yes,menubar=yes,width='+w+',height='+h; 
popupWin = window.open(url,'_blank',WinC); 
if (focusok) popupWin.focus();
return false;
}

function smallphoto(photo,maxW,maxH)
{
 width=photo.width;
 height=photo.height;
 if (width<=maxW && height<=maxH) return;
 if (width/maxW<=height/maxH) 
 { photo.height=maxH;
   photo.width=width*(maxH/height); } 
 else 
 { photo.width=maxW;
   photo.height=height*(maxW/width); } 
}

function layerwrite(id,text,color)
{
 document.all[id].innerHTML='<font color="'+color+'">'+text+'</font>'
}
function TOfunc(){
  var s, d;
  var x = new Array(" [周日] ", " [周一] ", " [周二] ", " [周三] "," [周四] ", " [周五] ", " [周六] ");

  window.setTimeout("TOfunc()",1000);
  d = new Date();

  s = d.getFullYear() + ".";
  //if(d.getMonth()<10){ s += "0" };
  s += (d.getMonth() + 1) + ".";
  if(d.getDate()<10){ s += "0" };
  s += d.getDate() + "";
  s += x[d.getDay()] + "";
  if(d.getHours()<10){ s += "0" };
  s += d.getHours() + ":";
  if(d.getMinutes()<10){ s += "0" };
  s += d.getMinutes() + ":";
  if(d.getSeconds()<10){ s += "0" };
  s += d.getSeconds();

  frmTime3.disp.value = s;
}