{	var Ajax_prefix = '/';
	var Ajax_mtrand = '1';



var uagent    = navigator.userAgent.toLowerCase();
var is_safari = ( (uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc.") );
var is_ie     = ( (uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) && (!is_webtv) );
var is_ie4    = ( (is_ie) && (uagent.indexOf("msie 4.") != -1) );
var is_moz    = (navigator.product == 'Gecko');
var is_ns     = ( (uagent.indexOf('compatible') == -1) && (uagent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_safari) );
var is_ns4    = ( (is_ns) && (parseInt(navigator.appVersion) == 4) );
var is_opera  = (uagent.indexOf('opera') != -1);
var is_kon    = (uagent.indexOf('konqueror') != -1);
var is_webtv  = (uagent.indexOf('webtv') != -1);
var is_win    =  ( (uagent.indexOf("win") != -1) || (uagent.indexOf("16bit") !=- 1) );
var is_mac    = ( (uagent.indexOf("mac") != -1) || (navigator.vendor == "Apple Computer, Inc.") );
var ua_vers   = parseInt(navigator.appVersion);

if (typeof jslang == 'undefined'){
	var jslang = {}
}
/*
+--------------------------------------------------------
+	Get element by id as simple style
+--------------------------------------------------------
*/
function $(id){
	if (document.getElementById(id)){
		return document.getElementById(id);
	}else{
		return false;
	}
}

/*
+--------------------------------------------------------
+	Get element by tagname
+--------------------------------------------------------
*/
function getags(name){
	if (document.getElementsByTagName(name)){
		return document.getElementsByTagName(name);
	}else{
		var ruturns = new Array();
		return returns;
	}
}


function Ajax_object(){
	/*
	+-------------------------------------------
	+	Create request object
	+-------------------------------------------
	*/
	this.request = function(){
		this.create = null;
		if(window.XMLHttpRequest){
			this.create = new XMLHttpRequest();
			if(this.create.overrideMimeType){
				this.create.overrideMimeType('text/xml');
			}
		}else if(window.ActiveXObject){
			var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
			for(var i=0; i<versions.length; i++){
				try{
					this.create = new ActiveXObject(versions[i]);
					if(this.create){
						return this.create;
					}
				}catch(e){
					// Throw
				}
			}
		}
	}
	/*
	+-------------------------------------------
	+	Define
	+-------------------------------------------
	*/
	this.target = '';
	this.tarvar = ['action','option','extent','info','null'];
	this.url = function(urls){
		if (!urls || urls == ''){
			return false;
		}
		this.tmp = urls.split('|');
		this.comma = '';
		this.target = Ajax_prefix + 'ajax.php?';
		for (var i = 0; i < this.tmp.length; i++){
			if (this.tmp[i] != ''){
				if (i > 3){
					this.target += this.comma + this.tmp[i].replace(/&amp;/g,'&');
				} else {
					this.target += this.comma + this.tarvar[i] + '=' + this.tmp[i];
					this.comma = '&';
				}
			}
			if (i >= 4){
				break;
			}
		}
		if (Ajax_mtrand == 1){
			this.target += '&' + Math.ceil(Math.random(0,9) * 100000);
		}
		//alert(this.target);
	}
	this.server = 'xml';
	this.xml = function(urls,id){
		this.url(urls);
		this.server = 'xml';
		this.get(id);
	}
	this.htm = function(urls,id){
		this.url(urls);
		this.server = 'htm';
		this.get(id);
	}
	this.framer = function(urls){
		this.url(urls);
		if ($('ajaxform')){
			$('ajaxform').src = this.target;
		}
	}
	/*
	+-------------------------------------------
	+	Method query
	+-------------------------------------------
	*/
	this.container = '';
	this.ismsger = false;
	this.get = function(id){
		if(Ajax.create == null){
			alert('Request Fail.');
			return false;
		}
		if (id && id != '' && $(id)){
			this.container = id;
		} else {
			this.container = '';
		}
		if (this.ismsger && $('ajaxloading')){
			$('ajaxloading').style.display = '';
		}
		if(window.XMLHttpRequest){
			Ajax.create.open('GET',this.target);
			Ajax.create.send(null);
		}else{
			Ajax.create.open("GET",this.target,true);
			Ajax.create.send();
		}
		Ajax.create.onreadystatechange = function(){
			if(Ajax.create.readyState == 4){
				if(Ajax.create.status == 200){
					var Ajax_getsource = Ajax.create.responseText;
					if (Ajax_getsource.substr(2,3) == 'xml' && Ajax.server == 'xml'){
						Ajax.parser(Ajax.create.responseXML.lastChild.firstChild.nodeValue);
					} else {
						Ajax.parser(Ajax_getsource);
					}
					if ($('ajaxloading')){
						$('ajaxloading').style.display = 'none';
					}
				}
			}
		};
	}
	this.parser = function(sources){
		sources = sources ? sources : '';
		if (Ajax.container){
			$(Ajax.container).innerHTML = sources;
		}
		if (sources.indexOf('<script') == -1){
			return false;
		}
		var JsTmp;
		var JsReg = /<script>.*?<\/script>/ig;
		while ( (JsTmp = JsReg.exec(sources)) != null){
			eval(JsTmp[0].replace(/<[a-z\/]+>/ig,''));
		}
	}
	this.security = function(fname,secode){
		var certform = eval('document.' + fname);
		if (!fname || !certform || !$(fname + '_security')){
			return false;
		}
		if (secode){
			certform.formhash.value = secode;
			$(fname + '_security').src = Ajax_prefix + 'ajax.php?action=security&option=' + secode;
		}else{
			Ajax.xml('security|||&create=1&fname=' + fname);
		}
	}
}
Ajax = new Ajax_object();
Ajax.request();
document.write("<div style=\"display:none\"><iframe name=\"ajaxform\" id=\"ajaxform\" src=\"\" width=\"0\" height=\"0\"></iframe></div>");


var jslang = {

	'nojwords'					: '您还没有填写职位名称的关键字',
	'nocwords'					: '您还没有填写企业名称的关键字',
	'noschdata'					: '暂无符合您的搜索条件的职位记录',

	'login_uu'					: '您还没有填写您的用户名',
	'login_iu'					: '该用户不存在, 请检查您的输入是否有误',
	'login_up'					: '您还没有填写您的密码',
	'login_ip'					: '您的密码不正确, 请检查\n\n注意: 密码区分大小写',
	'login_uc'					: '您还没有填写图形码',
	'login_ic'					: '您的图形码不正确, 请检查\n\n注意: 单击图片替换图形码'

}
function indexerobject(){
	this.userinfo = function(){
		Ajax.xml('userinfo','userinfo');
	}
	this.vlogincper = true;
	this.vlogin = function(results,urls){
		var theform = document.wane_login;
		if (results){
			var altmsg = '';
			var extjav = '';
			switch (results){
				case 'uu' : altmsg = jslang.login_uu; extjav = 'theform.username.focus()';	break;
				case 'up' : altmsg = jslang.login_up; extjav = 'theform.password.focus()';	break;
				case 'uc' : altmsg = jslang.login_uc; extjav = 'theform.certid.focus()';	break;
				case 'iu' : altmsg = jslang.login_iu; extjav = 'theform.username.focus()';	break;
				case 'ip' : altmsg = jslang.login_ip; extjav = 'theform.password.focus()';	break;
				case 'ic' : altmsg = jslang.login_ic; extjav = 'theform.certid.focus()';	break;
				case 'ss' : this.vlogincper ? window.location = urls : this.userinfo();		break;
			}
			if (altmsg != ''){
				alert(altmsg);
				if (theform.Submit.disabled){
					theform.Submit.disabled = false;
				}
			}
			if (extjav != ''){
				eval(extjav);
			}
		}else{
			if (theform.username.value == ''){
				this.vlogin('uu');
				return false;
			}else if (theform.password.value == ''){
				this.vlogin('up');
				return false;
			}else if (theform.certid && theform.certid.value == ''){
				this.vlogin('ic');
				return false;
			}else{
				theform.Submit.disabled = true;
			}
		}
	}
	this.vlogout = function(results){
		if (results){
			this.userinfo();
		}else{
			Ajax.xml('logout');
		}
	}
	this.schjname = function(results,url){
		var theform = document.wane_search_jname;
		if (results){
			this.tmpmsg = '';
			switch (results){
				case 'nojwords' 	: this.tmpmsg = jslang.nojwords;	theform.keywords.focus();	break;
				case 'noschdata'	: this.tmpmsg = jslang.noschdata;	theform.keywords.focus();	break;
			}
			if (this.tmpmsg != ''){
				alert(this.tmpmsg);
				if (theform.Submit.disabled){
					theform.Submit.disabled = false;
				}
			}
		}else{
			if (theform.keywords.value == ''){
				this.schjname('nojwords');
				return false;
			}else{
				theform.Submit.disabled = true;
			}
		}
	}
	this.schcname = function(results,url){
		var theform = document.wane_search_cname;
		if (results){
			this.tmpmsg = '';
			switch (results){
				case 'nocwords' 	: this.tmpmsg = jslang.nocwords;	theform.keywords.focus();	break;
				case 'noschdata'	: this.tmpmsg = jslang.noschdata;	theform.keywords.focus();	break;
			}
			if (this.tmpmsg != ''){
				alert(this.tmpmsg);
				if (theform.Submit.disabled){
					theform.Submit.disabled = false;
				}
			}
		}else{
			if (theform.keywords.value == ''){
				this.schcname('nocwords');
				return false;
			}else{
				theform.Submit.disabled = true;
			}
		}
	}
	this.location = function(url){
		window.location = url;
	}
}
indexer = new indexerobject();