	function SubmitForm(strAction)
	{
		document.all("hdnAction").value = strAction;
		document.frmTheForm.submit();
	}
	function EditRecord(RecordID)
	{
		document.all("SelectRecordID").value = RecordID;
		SubmitForm("edit");
	}
	function CancelEdit()
	{
		document.all("SelectRecordID").value = "";
		SubmitForm("");
	}
	function RecordSort(str)
	{
		document.all("SortType").value = str;
		SubmitForm("sort");
	}
	function SwitchPosition(PreID,PreShowIndex,NextID,NextShowIndex)
	{
		document.all("hdnPreID").value = PreID;
		document.all("hdnPreShowIndex").value = PreShowIndex;
		document.all("hdnNextID").value = NextID;
		document.all("hdnNextShowIndex").value = NextShowIndex;
		SubmitForm("switch");
	}
    function chkNumber(obj)
    {
        if(isNaN(obj.value))
        {
            alert("请输入数字！");
			obj.focus();
        }
    }

	function popwin(strUrl)	
	{
		window.open(strUrl,null,"height=600,width=800,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");	
	}
	
	function popwin(strUrl,winname)	
	{
		window.open(strUrl,winname,"height=600,width=800,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");	
	}
	
	function OpenWindow(strUrl)
	{
        var newWin;
		newWin = window.open(strUrl,null,"height=400,width=450,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");		
		newWin.moveTo(window.screen .availWidth/2 - 225,window.screen .availHeight/2 - 225)
		newWin.focus();	
    }
    
    
    function AdjustWindow(w,h)
    {
	    self.focus();
	    curWidth = w;
	    curHeight = h;
	    self.resizeTo(curWidth,curHeight);
	    width = window.screen.width ;
	    height = window.screen.height; 
	    wPos = (width-curWidth)/2;
	    hPos = (height-curHeight)/2;
	    self.moveTo(wPos,hPos);
    }
    
        
    function CheckMail(mail)
    {
          var strr;
          //re=/(\w+@\w+\.\w+)(\.{0,1}\w*)(\.{0,1}\w*)/i; //\w表示数字，字符及下划线
          re=/(.+@.+.)/;
          re.exec(mail);
          if (RegExp.$3!=""&&RegExp.$3!="."&&RegExp.$2!="."){
        	 strr=RegExp.$1+RegExp.$2+RegExp.$3
          }else{
        		if (RegExp.$2!=""&&RegExp.$2!="."){
        			 strr=RegExp.$1+RegExp.$2
        		}else{
        			  strr=RegExp.$1
        		}	  
        		if(strr!=mail){
        			alert("请填写正确的邮件地址")
        			return false
        		}	
          }
          return true;
    }
    