function textCounter(field, countfield, maxlimit) {
if (field.value.length >maxlimit) 
field.value = field.value.substring(0,maxlimit);
else 
countfield.value = maxlimit - field.value.length;
}

function doGo(url,ColId,id){
  var enpId;
  enpId=form1.EnpId.value;
  if(enpId!="")
  {
   location.href=url+"?EnpId="+enpId+"&ColId="+ColId+"&id="+id;
   }
}


function SelCol(theform,theurl)
  {
   theform.action=theurl;
   theform.submit();
  }
function ShowPic(PicPath,ThePic)
{
  box = eval(ThePic);
  if(PicPath.length==0) return;
  box.src=PicPath;
  box.style.display="";
}
function ShowPic1(PicPath,ThePic)
{
  box = eval(ThePic);
  if(PicPath.length==0) 
    {
	box.style.display="none";
	return;
	}
  box.src="../../written/upfile/gykw/"+PicPath;
  box.style.display="";
}

 function caidan(id)
{
 if (id.style.display!="")
   {
    id.style.display="";
   }
 else
 {
    id.style.display="none";
  }
}
  function hid(id)
{
    id.style.display="none";
}

  function show(id)
{
    id.style.display="";
}

//日历函数
function selectDate(objID,theform)
{
	var obj = eval('document.'+theform+'.'+objID);
	result = window.showModalDialog('../../js/Calendar.htm',obj.value,'dialogWidth=185px;dialogHeight=230px');
	if (result!=null)
	{
		obj.value = result;
	}

}
//日历函数
function IsDate(DateString , Dilimeter)
{
   if (DateString==null) return false;
   if (Dilimeter=='' || Dilimeter==null)
      Dilimeter = '-';
   var tempy='';
   var tempm='';
   var tempd='';
   var tempArray;
   if (DateString.length<8 && DateString.length>10)
       return false;       
   tempArray = DateString.split(Dilimeter);
   if (tempArray.length!=3)
      return false;
   if (tempArray[0].length==4)
   {
      tempy = tempArray[0];
      tempd = tempArray[2];
   }
   else
   {
      tempy = tempArray[2];
      tempd = tempArray[0];
   }
   tempm = tempArray[1];
   var tDateString = tempy + '/'+tempm + '/'+tempd+' 8:0:0';//加八小时是因为我们处于东八区
   var tempDate = new Date(tDateString);
   if (isNaN(tempDate))
      return false;
  if (((tempDate.getUTCFullYear()).toString()==tempy) && (tempDate.getMonth()==parseInt(tempm,10) - 1) && (tempDate.getDate()==parseInt(tempd,10)))
   {
      return true;
   }
   else
   {
      return false;
   }
}

