//integer format
var formatInt="^[0-9]+$";
var nwin=-1;

var week,day,month,year;
 function do_week()
 {
  function initArray()
  {
  this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++)
  this[i+1] = initArray.arguments[i];
  }
  var LastModDate = new Date();
  var WeekArray = new initArray("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
  var MonthArray = new initArray("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月");
  document.write ("<font color=#FFFFFF>");
  day = LastModDate.getDate() + "日";
  year = LastModDate.getFullYear() +"年";
  week = WeekArray[(LastModDate.getDay()+1)];
  month = MonthArray[(LastModDate.getMonth()+1)];
  document.write(year,month,day," ",week);
  document.write("</font>");
}

//定义一个变量用于存放XMLHttpRequest对象
var xmlHttp; 
	
//该函数用于创建一个XMLHttpRequest对象
function createXMLHttpRequest() {
	if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} 
	else if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function do_load(){
MM_preloadImages('image/frame/bt-t1-2.gif','image/frame/bt-t2-2.gif','image/frame/bt-t3-2.gif','image/frame/bt-t4-2.gif','image/frame/bt1-2.gif','image/frame/bt2-2.gif','image/frame/bt3-2.gif','image/frame/bt4-2.gif','image/frame/bt5-2.gif','image/frame/bt6-2.gif','image/frame/bt7-2.gif','image/frame/bt8-2.gif','image/frame/bt9-2.gif','image/frame/go2.gif','image/frame/more1-2.gif','image/frame/b-dl2.gif','image/frame/b-zc2.gif');
}

function do_qfcx(){
  
  var username=document.qfcxfrm.usr_no.value;
  var password=document.qfcxfrm.pass.value;
  //document.all.Image74.disabled=true;
  if(username.trim()==""||username.trim().length==0)
  {
    alert("请输入您的客户编号！");
    document.qfcxfrm.usr_no.focus();
    return false;
  }
  else if(username.match(formatInt)==null)
  {
    alert("客户编号只能输入整数！");
    document.qfcxfrm.usr_no.focus();
    return false;
  }
  else if(password.trim()==""||password.trim().length==0)
  {
    alert("请输入您的密码，初始密码888888！");
    document.qfcxfrm.pass.focus();
    return false;
  }
  else{
    document.qfcxfrm.submit();
  }
}

function do_cx(){
    //document.all.Image74.disabled=true; 
    document.qfcxfrm.submit();
}

function do_pass(checkName){
  //document.all.Image75.disabled=true;
  if(document.pass.usr_no.value.trim()==""||document.pass.usr_no.value.trim().length==0)
  {
    alert("请输入您的客户编号！");
    document.pass.usr_no.focus();
    return false;
  }
  else if(document.getElementById(checkName).value.match(formatInt)==null)
  {
    alert("客户编号只能输入整数！");
    document.pass.usr_no.focus();
    return false;
  }
  else if(document.pass.oldpass.value.trim()==""||document.pass.oldpass.value.trim().length==0)
  {
    alert("请输入您的旧密码");
    document.pass.oldpass.focus();
    return false;
  }
  else if(document.pass.newpass1.value.trim()==""||document.pass.newpass1.value.trim().length==0)
  {
    alert("请输入您的新密码");
    document.pass.newpass1.focus();
    return false;
  }
  else if(document.pass.newpass2.value.trim()==""||document.pass.newpass2.value.trim().length==0)
  {
    alert("请确认您的新密码");
    document.pass.newpass2.focus();
    return false;
  }
  else{
    return true;
  }
}

function openWin(url,winName,wid,hei,top,left)
{
  if(nwin==-1||nwin.closed==true)
  {
    var sFeature='width='+wid+',height='+hei+',top='+top+',left='+left;
        sFeature+=',scrollbars=no,resizable=no,location=no,menubar=no,status=no,titlebar=no';
    nwin=window.open(url,winName,sFeature);
//    nwin.moveTo(600,280);
    nwin.focus();
  }
  else
  {
    nwin.focus();
  }
}

 function view_vote(nId)
 {
 	openWin('pzxcx.go?view=?&id='+nId,'votewin',320,240,50,50);
 }
 
  String.prototype.trim= function()   
{ 
 var str; 
 str=this.replace(/(^\s*)|(\s*$)/g, "");     
 str=str.replace(/(^[^u4e00-u9fa5])|([^u4e00-u9fa5]$)/g,"");   
 return str; 
} 

 
