function InitAjax() //Ajax实例初始化
{
　var ajax=false;
　try {
　　ajax = new ActiveXObject("Msxml2.XMLHTTP");
     　} catch (e) {
　try {
　　　ajax = new ActiveXObject("Microsoft.XMLHTTP");
　　   } catch (E) {
　　ajax = false;
　　}
　}
　if (!ajax && typeof XMLHttpRequest!='undefined') {
　　ajax = new XMLHttpRequest();
　}
　return ajax;
}

function Loginreg(msgdc,fn,tp)
{
  var msgdc;
  var fn;
　var msg = document.getElementById(msgdc);
　var f = document.regform;

   if(fn=='username')		var fnv = f.username.value;
   if(fn=='email')　  	 	var fnv = f.email.value;
   if(fn=='spassword')　   	var fnv = f.spassword.value;
   if(fn=='rimgcode')　   	var fnv = f.rimgcode.value;

  if(fn=='spassword'&&(fnv.length<6||fnv=='')){
   	msg.innerHTML = "<font color=red>错误! 密码要求大于六位"; return false; }
  if(fn=='username'&&(fnv.length<3||fnv=='')){
   	msg.innerHTML = "<font color=red>错误! 用户名必须在3-25个字符"; return false; }
  if(fn=='email'&&fnv==''){
   	msg.innerHTML = "<font color=red>错误! 电子邮件不能为空"; return false; }

　var url = "ajax.inc.php";
　var postStr = "register="+tp+"&"+fn+"="+ fnv;

　var ajax = InitAjax();
　ajax.open("POST", url, true);
　ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
　ajax.onreadystatechange = function() {
　　if (ajax.readyState == 4 && ajax.status == 200) {
　　msg.innerHTML = ajax.responseText;
　　   }
　  }

}
function Passcheck(){
 var msg = document.getElementById('rpshow');
 var f = document.regform;
 var spassword = f.spassword.value;
 var repassword = f.repassword.value;
   if(spassword!=repassword){
	   msg.innerHTML = "<font color=red>密码不相同";
	   }else{
	   msg.innerHTML = "";
	   }
}

function Wantadcheck(){
    alert("该条招聘信息正常审核中……");
	return false
}



//验证用户通过情况
function Showsub(){
	var ushow=document.getElementById("ushow").innerHTML=='√';
	var eshow=document.getElementById("eshow").innerHTML=='√';
	var pshow=document.getElementById("pshow").innerHTML=='';
    var rpshow=document.getElementById("rpshow").innerHTML=='';
	var authcode=document.regform.authcode.value!='';
    var rp=document.regform.repassword.value!='';
	var zcxy=document.regform.zcxy.checked=='1';

	if(ushow && eshow && pshow && rpshow && authcode && rp && zcxy){ return true;
	 }else{
		 document.getElementById("showsub").innerHTML = "<font color=red>错误！请正确填写以上信息";
	     return false;
	 }

}
function Showsubcom(){
	var ushow=document.getElementById("ushow").innerHTML=='√';
	var eshow=document.getElementById("eshow").innerHTML=='√';
	var pshow=document.getElementById("pshow").innerHTML=='';
    var rpshow=document.getElementById("rpshow").innerHTML=='';
	var authcode=document.regform.authcode.value!='';
    var rp=document.regform.repassword.value!='';

	if(ushow && eshow && pshow && rpshow && authcode && rp){ return true;
	 }else{
		 document.getElementById("showsub").innerHTML = "<font color=red>错误！请正确填写以上信息";
	     return false;
	 }

}



function favorite_check(type,job_id,job_name,com_name,com_id)
{
  var type,job_id,job_name,com_name,com_id;
　var url = "ajax.inc.php";
　var postStr = type+"=ok&job_id="+job_id+"&job_name="+job_name+"&com_name="+com_name+"&com_id="+com_id;

　var ajax = InitAjax();
　ajax.open("POST", url, true);
　ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
　ajax.onreadystatechange = function() {
　　if (ajax.readyState == 4 && ajax.status == 200) {
     alert(ajax.responseText);
　　   }
　  }

}

function ShowTemp() { 
   var eless = document.getElementsByName("p1"); 
   for(var i=0;i<eless.length;i++) 
   { 
     if(eless[i].checked) 
     { 
     colorid=eless[i].value; 
     break; 
     } 
   } 
var orderid=document.alipayment.dingdan.value;
　var url = "ajax.inc.php";
　var postStr = "pay=ok&ordertype="+colorid+"&orderid="+orderid;

　var ajax = InitAjax();
　ajax.open("POST", url, true);
　ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
　ajax.onreadystatechange = function() {
　　if (ajax.readyState == 4 && ajax.status == 200) {
        var allcon =  ajax.responseText;
			document.getElementById(type).innerHTML = allcon;
　　   }
　  }


} 

function update_check(type,id)
{
  var type,id;
　var url = "ajax.inc.php";
　var postStr = type+"=ok&id="+id;

　var ajax = InitAjax();
　ajax.open("POST", url, true);
　ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
　ajax.onreadystatechange = function() {
　　if (ajax.readyState == 4 && ajax.status == 200) {
    // alert(ajax.responseText);
　　   }
　  }
}


function login_msg(types,emails,usernames,passwords){
  var types,emails,usernames,passwords;
　var url = "email.php";
　var postStr = "type="+types+"&email="+emails+"&username="+usernames+"&password="+passwords;

　var ajax = InitAjax();
　ajax.open("POST", url, true);
　ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
　ajax.onreadystatechange = function() {
　　if (ajax.readyState == 4 && ajax.status == 200) {

　　   }
　  }
	}




function hit_check(type,id,url)
{
  var type,id;
　var weburl = url+"/ajax.inc.php";
　var postStr = type+"=ok&id="+id+"&url="+url;

　var ajax = InitAjax();
　ajax.open("POST",weburl, true);
　ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  ajax.send(postStr);
　ajax.onreadystatechange = function() {
　　if (ajax.readyState == 4 && ajax.status == 200) {
  			var allcon =  ajax.responseText;
			document.getElementById(type).innerHTML = allcon;
　　   }
　  }

}








/*弹出窗口*/
function ok(ba,names,cids)
{
document.getElementById('gzd').value = ba;
document.getElementById('gzdid').value = cids;
if(names!=0){
document.getElementById(names).style.display='none';
}
document.getElementById('light').style.display='none';
document.getElementById('fade').style.display='none';

}
function dakai(bid){
document.getElementById('light').style.display='block';
document.getElementById('fade').style.display='block';
}
function v(name,sid){

	if(sid==1){
	document.getElementById(name).style.display='block';
		}else{
	document.getElementById(name).style.display='none';
		}
	}





function checkmsg(id){
	var a=document.getElementById(id).style.display;
	if(a=='none'){
	 document.getElementById(id).style.display="block";
	}else{
		document.getElementById(id).style.display="none";
		}
	}


    function check_payd(pay,company){
    if(pay<0){
    alert('竟价不能小于0');
    }
    if(pay>company){
    alert('对不起！你的余额不够支付本次招聘');
    }else{
    var payy=company-pay;
    document.getElementById('xuanshang').innerHTML=payy;
    } 
    } 




<!-- 
// 说明：用 JavaScript 实现网页图片等比例缩放 
function DrawImage(ImgD,FitWidth,FitHeight){ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if(image.width>0 && image.height>0){ 
    if(image.width/image.height>= FitWidth/FitHeight){ 
        if(image.width>FitWidth){ 
        ImgD.width=FitWidth; 
        ImgD.height=(image.height*FitWidth)/image.width; 
        }else{ 
        ImgD.width=image.width; 
        ImgD.height=image.height; 
        } 
    } else{ 
        if(image.height>FitHeight){ 
        ImgD.height=FitHeight; 
        ImgD.width=(image.width*FitHeight)/image.height; 
        }else{ 
        ImgD.width=image.width; 
        ImgD.height=image.height; 
        } 
    } 
    } 
} 
//--> 

