﻿// JScript 文件
  function onlogin(str,name,pwd,code)
  {
      var tName=document.getElementById(name);
      var tPwd=document.getElementById(pwd);
      var tCode=document.getElementById(code);
      var vName=tName.value;
      var vPwd=tPwd.value;
      var vCode=tCode.value;
      var vTxt=str;
      var vUrl="../zqjh/login2.aspx";
      if("1"==vTxt)
      {
         if(""==vCode)
         {
            alert("机构代码不能为空！");
            tCode.focus();
            return;
         }
         vUrl="../zqjh/login2.aspx";
      }
      else
      {
         vUrl="../login_in2.aspx";
      }
      if(vName=="")
      {
         alert("用户名不能为空！");
         tName.focus();
      }
      else if(vPwd=="")
      {
         alert("密码不能为空！");
         tPwd.focus();
      }
      else
      {         
         var vUrl="<form id='form1' target='_self' action='" + vUrl + "' method='post'>";
         if("1"==vTxt)
         {
            vUrl+="<input   type='hidden'   name='code'   value='" + vCode + "'>";
         }
         vUrl+="<input   type='hidden'   name='username'   value='" + escape(vName) + "'>";
         vUrl+="<input   type='hidden'   name='passwd'   value='" + vPwd + "'>";
         vUrl+="</form>";
         vUrl+="<script   language='javascript'>";
         vUrl+="document.getElementById('form1').submit();";
         vUrl+="<\/script>";
         tCode.value="";
         tName.value="";
         tPwd.value="";
         newlog=window.open("");
         newlog.document.write(vUrl);
      }
  }

