  var http_request=false;
  function send_request(method,url,date){//初始化，指定处理函数，发送请求的函数
    http_request=false;
        //开始初始化XMLHttpRequest对象
        if(window.XMLHttpRequest){//Mozilla浏览器
         http_request=new XMLHttpRequest();
         if(http_request.overrideMimeType){//设置MIME类别
           http_request.overrideMimeType("text/xml");
         }
        }
        else if(window.ActiveXObject){//IE浏览器
         try{
          http_request=new ActiveXObject("Msxml2.XMLHttp");
         }catch(e){
          try{
          http_request=new ActiveXobject("Microsoft.XMLHttp");
          }catch(e){}
         }
    }
        if(!http_request){//异常，创建对象实例失败
         window.alert("创建XMLHttp对象失败！");
         return false;
        }
        http_request.onreadystatechange=processrequest1;
        //确定发送请求方式，URL，及是否同步执行下段代码
		if(method=="GET"){
    	http_request.open("GET",url,true);
        http_request.send(null);
		}else if(method=="POST"){
		http_request.open("POST",url,true);	
    	http_request.setRequestHeader("content-length",date.length);
    	http_request.setRequestHeader("content-type","application/x-www-form-urlencoded");
		http_request.send(date);
		}
  }
  
  //处理返回信息的函数
  function processrequest1(){
   if(http_request.readyState==4){//判断对象状态
     if(http_request.status==200){//信息已成功返回，开始处理信息
          var text=http_request.responseText;
		  if(text==1){
			  showWin('url','unitlogin.html','',300,200);
			  }else if(text == 2){
				alert("用户名或密码输入错误!");  
			  }else if(text == 3){
			  showWin('html','登录成功!','',300,100);
			  window.setTimeout("closeWin();",1000);
   			  }else if(text == 4){
   			  showWin('html','成功放入人才夹!','',300,100);
   			  window.setTimeout("closeWin();",1000); 
   			  }
   			  else{
   			  
   			  var win=window.open('','_blank');
			  win.location.href="tj_resume.html?stuid="+text;
   			  //window.location.href="resume.html?stuid="+text;
			 }
         }
         else{//页面不正常
          alert("您所请求的页面不正常！");
         }
   }
}

  function employ(stuid){
   var id = stuid;
   var url = "unitlogin.html?action=login&stuid="+id+"&rand="+Math.random();
   send_request("GET",url);
  }
 
  function hrfolder(stuid){
   var id = stuid;
   var url = "unitlogin.html?action=hrfolder&stuid="+id+"&rand="+Math.random();
   send_request("GET",url);
  }
