function oUPFile(tid,fmode)
{
		switch(fmode){
		case "File":
		 res = showModalDialog('/userupFile.asp', null, 'dialogWidth: 530px; dialogHeight: 435px; center: yes; resizable: no; scroll: no; status: no;');
 		break;
		default:
		 res = showModalDialog('/userupFile.asp', null, 'dialogWidth: 500px; dialogHeight: 435px; center: yes; resizable: no; scroll: no; status: no;');
		break;
		}
  if(res)
   document.all.item(tid).value=res;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function doPrint() {
	if (window.print != null) { 
		window.print();
	} else { 
		alert('Your browser does not support this feature. Please select Print from the File menu.'); 
	}
}

  function countlen(z,l){  
      if   (document.all.item(z).value.length>l){   
          alert("Can not input any more!")   
          document.all.item(z).value=document.all.item(z).value.substring(0,l)   
      }   
    
      return   true   
  }   

function IsDigit(){
  return ((event.keyCode >= 46) && (event.keyCode <= 57));
}
function IszDigit(){
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}


function del(des,src)
{
if(confirm("Will you "+des+" ?"))
	{
	window.location=src
}
}

function notnull(theid,t){
  if (Trimstring(document.all.item(theid).value)==""){

  {
   alert(t+" need to input!");
  document.all.item(theid).focus();
    }
}
}
function Trimstring(str)
{
	resultStr="";
	i=0;
	while (i<str.length && str.charAt(i)==" ")
	  i++;
	j=i;
	i=str.length-1;
	while (i>=0 && str.charAt(i)==" ")
	  i--;
	if (j<=i)
		resultStr=str.substring(j,i+1);
	return resultStr;

}

function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=no' );
}

function fPopUpCalDlg(ctrlobj,lei)
{
	showx = event.screenX - event.offsetX - 4 - 10 ; // + deltaX;
	showy = event.screenY - event.offsetY -168; // + deltaY;
	newWINwidth = 210 + 4 + 18;
   if (lei==0){
	retval = window.showModalDialog("/js/Calendar.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	if( retval != null ){
	//	alert(retval);
		ctrlobj.value = retval;
	}else{
		//alert("canceled");
	}
	}else{
	retval = window.showModalDialog("/js/Calendar1.htm", "", "dialogWidth:257px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	if( retval != null ){
	//	alert(retval);
		ctrlobj.value = retval;
	}else{
		//alert("canceled");
	}
	}
}

function fPopUpCalendarDlg(ctrlobj)
{
	showx = event.screenX - event.offsetX - 4 - 10 ; // + deltaX;
	showy = event.screenY - event.offsetY -168; // + deltaY;
	newWINwidth = 210 + 4 + 18;

	retval = window.showModalDialog("/js/Calendar.htm", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; "  );
	if( retval != null ){
	//	alert(retval);
		ctrlobj.value = retval;
	}else{
		//alert("canceled");
	}
}