function KeyIn(obj)
{
	
	if(obj.value == '请输入查询内容') {
		obj.value = '';
	}
}
function KeyOut(obj)
{
if(obj.value == '') {
		obj.value = '请输入查询内容';
	}
}
function KeyDown(evt)
{
	if(evt.keyCode==13){dosearch();}
}
function dosearch()
{
		var search_type = document.getElementById("qstype").value;
		var keyword = document.getElementById("keyword").value;
		var url="/index.html";
		
		if(keyword == '请输入查询内容') { keyword=''; }
		if(search_type == 'per')
		{
			url="/rc/index.html?qzyx="+keyword;
		}
		if(search_type == 'job')
		{
			url="/zp/zw.html?zpzw="+keyword;
		}
		if(search_type == 'com')
		{
			url="/zp/index.html?company="+keyword;
		}
		location.href =url;

}

function $AddFavorite(sURL, sTitle){
   try{
       window.external.addFavorite(sURL, sTitle);
   }
   catch (e){
       try{
           window.sidebar.addPanel(sTitle, sURL, '');
       }
       catch (e){
           alert('加入收藏失败，请使用Ctrl+D进行添加');
       }
   }
}
function MM_openBrWindow(theURL,winName,features) { //v2.0

window.open(encodeURI(theURL),winName,features);}


//以下ajax类
function Ajax(url,recvT,stringS,resultF) {
	this.url = url;
	this.stringS = stringS;
	this.xmlHttp = this.createXMLHttpRequest();
	if (this.xmlHttp == null) {
		//alert("Error");
		return;
	}
	var objxml = this.xmlHttp;
	objxml.onreadystatechange = function (){Ajax.handleStateChange(objxml,recvT,resultF)};
}

Ajax.prototype.createXMLHttpRequest = function() {
	try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {}
	try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {}
	try { return new XMLHttpRequest(); } catch(e) {}
	return null;
}

Ajax.prototype.createQueryString = function () {
	var queryString = this.stringS;
	return queryString;
}

Ajax.prototype.get = function () {
	var url = this.url;
	this.xmlHttp.open("GET",url,true);
	this.xmlHttp.send(null);
}

Ajax.prototype.post = function() {
	var url = this.url;
	var queryString = this.createQueryString();
	this.xmlHttp.open("POST",url,true);
	this.xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	this.xmlHttp.send(queryString);
}

Ajax.handleStateChange = function (xmlHttp,recvT,resultF) {
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200) {
			resultF(recvT?xmlHttp.responseXML:xmlHttp.responseText);
		} else {
			//alert("Accident");
		}
	}
}

function cun(cid) {
	var ajax = new Ajax("/user/checkusername.php?username="+cid, 0, "", cunb);
	ajax.post();
}

function cunb(rexm){
	if (rexm != "")
	{			//alert(rexm);
		document.regform.un.value=rexm;

	}
}

function cue(cid,un) {
	var ajax = new Ajax("/user/checkemail.php?username="+un+"&email="+cid, 0, "", cueb);
	ajax.post();
}

function cueb(rexm){
	if (rexm != "")
	{		
		//alert(rexm);
		document.regform.ue.value=rexm;

	}
}
function cum(cid) {
	var ajax = new Ajax("/user/checkmail.php?email="+cid, 0, "", cumb);
	ajax.post();
}

function cumb(rexm){
	if (rexm != "")
	{		
		//alert(rexm);
		document.regform.uee.value=rexm;

	}
}
