//constant for  search fields and cookie restore

var SEARCH_FIELD_STORE_FLAG					= true;
var SEARCH_FIELD_RESTORE_FLAG				= true;

var SEARCH_FIELD_RESTORE_DATA				= "SEARCH_FIELD_RESTORE_DATA";
var SEARCH_FIELD_KEYWORD						= "KEYWORD";
var SEARCH_FIELD_KEYWORD_TYPE				= "KEYWORD_TYPE";
var SEARCH_FIELD_LOCATION						= "LOCATION";
var SEARCH_FIELD_LOCATION_LABEL			= "LOCATION_LABEL";
var SEARCH_FIELD_TOWN								= "TOWN";
var SEARCH_FIELD_AROUND_CITY				= "AROUND_CITY";
var SEARCH_FIELD_MORE_OPTION				= "MORE_OPTION";
var SEARCH_FIELD_FUNCTION_SUP				= "FUNCTION_SUP";
var SEARCH_FIELD_FUNCTION_SUP_LABEL	= "FUNCTION_SUP_LABEL";
var SEARCH_FIELD_FUNCTION_SUB				= "FUNCTION_SUB";
var SEARCH_FIELD_FUNCTION_SUB_LABEL	= "FUNCTION_SUB_LABEL";
var SEARCH_FIELD_CALLING						= "CALLING";
var SEARCH_FIELD_CALLING_LABEL			= "CALLING_LABEL";
var SEARCH_FIELD_DATE								= "DATE";
var SEARCH_FIELD_DATE_LABEL					= "DATE_LABEL";

function storeSearchField(){
	if(!SEARCH_FIELD_STORE_FLAG) { Cookie.unset(SEARCH_FIELD_RESTORE_DATA); return; }

	//var form = document.getElementsByName("searchForm")[0];
	var keyword = document.getElementById("searchBar_keyword");
	var location = document.getElementById("searchBar_location");
	var locationLabel = document.getElementById("searchBar_zone");
	var workLocation = document.getElementById("searchBar_workLocation");
	var keywordType = document.getElementsByName("keywordType");
	var type = keywordType[1].checked?keywordType[1].value:(keywordType[2].checked?keywordType[2].value:keywordType[0].value);

	var jobMainCatalogry = document.getElementById("jobMainCatalogry");
	var btn_jobMainCatalogry = document.getElementById("btn_jobMainCatalogry");
	var jobFunction = document.getElementById("searchBar_jobFunction");
	var btn_jobfunction = document.getElementById("btn_jobfunction");
	var calling = document.getElementById("searchBar_calling");
	var btn_calling1 = document.getElementById("btn_calling1");
	var positionPostDate = document.getElementById("searchBar_positionPostDate");
	var btn_positionPostDate = document.getElementById("btn_positionPostDate");

	var around_city = document.getElementsByName("location_around_city");
	var around_city_label = '';
	for(var i=0;i<around_city.length;i++)	if(around_city[i].checked) around_city_label += around_city[i].label + ';';
	if(around_city_label.length>0) around_city_label = around_city_label.substring(0, around_city_label.length-1);

	var json = new Object();
	json[SEARCH_FIELD_KEYWORD] = keyword.value;
	json[SEARCH_FIELD_KEYWORD_TYPE] = type;
	json[SEARCH_FIELD_LOCATION] = location.value;
	json[SEARCH_FIELD_LOCATION_LABEL] = locationLabel.innerHTML;
	json[SEARCH_FIELD_TOWN] = workLocation.value;
	if(parseInt(moreOptionCollapse.divObj.style.height)==0){
		json[SEARCH_FIELD_MORE_OPTION] = false;
	}else{
		json[SEARCH_FIELD_MORE_OPTION] = true;
		json[SEARCH_FIELD_FUNCTION_SUP] = jobMainCatalogry.value;
		json[SEARCH_FIELD_FUNCTION_SUP_LABEL] = btn_jobMainCatalogry.value;
		json[SEARCH_FIELD_FUNCTION_SUB] = jobFunction.value;
		json[SEARCH_FIELD_FUNCTION_SUB_LABEL] = btn_jobfunction.value;
		json[SEARCH_FIELD_CALLING] = calling.value;
		json[SEARCH_FIELD_CALLING_LABEL] = btn_calling1.value;
		json[SEARCH_FIELD_DATE] = positionPostDate.value;
		json[SEARCH_FIELD_DATE_LABEL] = btn_positionPostDate.value;
		json[SEARCH_FIELD_AROUND_CITY] = around_city_label;
	}
	//Cookie.set(SEARCH_FIELD_RESTORE_DATA, Jobcn.JSON.stringify(json));
	Cookie.set(SEARCH_FIELD_RESTORE_DATA, jobcn.lang.json.stringify(json));
}


if(SEARCH_FIELD_RESTORE_FLAG)jobcn.ready(restoreSearchField);/*addEventHandler(window, 'load', restoreSearchField);*/
function restoreSearchField(){
	if(!SEARCH_FIELD_RESTORE_FLAG || !document.getElementsByName("searchForm")[0]) return;

	var json = Cookie.get(SEARCH_FIELD_RESTORE_DATA);
	//if(json) json = json.parseJSON();
	if(json) json = jobcn.lang.json.parse(json);
	else return;

	//var form = document.getElementById("searchForm");
	var keyword = document.getElementById("searchBar_keyword");
	var location = document.getElementById("searchBar_location");
	var locationLabel = document.getElementById("searchBar_zone");
	var workLocation = document.getElementById("searchBar_workLocation");
	var keywordType = document.getElementsByName("keywordType");
	var jobMainCatalogry = document.getElementById("jobMainCatalogry");
	var btn_jobMainCatalogry = document.getElementById("btn_jobMainCatalogry");
	var jobFunction = document.getElementById("searchBar_jobFunction");
	var btn_jobfunction = document.getElementById("btn_jobfunction");
	var calling = document.getElementById("searchBar_calling");
	var btn_calling1 = document.getElementById("btn_calling1");
	var positionPostDate = document.getElementById("searchBar_positionPostDate");
	var btn_positionPostDate = document.getElementById("btn_positionPostDate");

	if(json[SEARCH_FIELD_KEYWORD]) { keyword.value = json[SEARCH_FIELD_KEYWORD]; }
	else{	keyword.value = '';	}
	if(keyword.value=='') {
		keyword.value= '职位关键字…';
	} else {
		if(keyword.value!='职位关键字…') keyword.style.color='#000';
	}

	if(json[SEARCH_FIELD_TOWN]) { workLocation.value = json[SEARCH_FIELD_TOWN]; }
	else{	workLocation.value = ''; }
	if(workLocation.value=='') {
		workLocation.value= '区/镇…';
	} else {
		if(workLocation.value!='区/镇…') workLocation.style.color='#000';
	}

	if(json[SEARCH_FIELD_KEYWORD_TYPE]){
		for(var i=0;i<keywordType.length;i++) {
			if(keywordType[i].value == json[SEARCH_FIELD_KEYWORD_TYPE]){
				keywordType[i].checked = true; break;
			}
		}
	}

	if(json[SEARCH_FIELD_LOCATION]) {
		location.value = json[SEARCH_FIELD_LOCATION];
		locationLabel.innerHTML = json[SEARCH_FIELD_LOCATION_LABEL];
		genAroundCityForMoreOption(locationLabel.innerHTML);
	}

	if(json[SEARCH_FIELD_AROUND_CITY]){
		var around_city_labels = json[SEARCH_FIELD_AROUND_CITY].split(';');
		var around_city = document.getElementsByName("location_around_city");
		for(var i=0;i<around_city.length;i++){
			for(var j=0;j<around_city_labels.length;j++){
				if(around_city[i].label == around_city_labels[j]){
					around_city[i].checked = true;	break;
				}else{
					around_city[i].checked = false;
				}
			}
		}
	}

	if(json[SEARCH_FIELD_MORE_OPTION]){
		if(json[SEARCH_FIELD_FUNCTION_SUP]) {
			jobMainCatalogry.value = json[SEARCH_FIELD_FUNCTION_SUP];
			btn_jobMainCatalogry.value = json[SEARCH_FIELD_FUNCTION_SUP_LABEL];
		}
		if(json[SEARCH_FIELD_FUNCTION_SUB]) {
			jobFunction.value = json[SEARCH_FIELD_FUNCTION_SUB];
			btn_jobfunction.value = json[SEARCH_FIELD_FUNCTION_SUB_LABEL];
		}
		if(json[SEARCH_FIELD_CALLING]) {
			calling.value = json[SEARCH_FIELD_CALLING];
			btn_calling1.value = json[SEARCH_FIELD_CALLING_LABEL];
		}
		if(json[SEARCH_FIELD_DATE]) {
			positionPostDate.value = json[SEARCH_FIELD_DATE];
			btn_positionPostDate.value = json[SEARCH_FIELD_DATE_LABEL];
		}
	}

	/*
	//for city entrance
	var path = window.location.href;
	if(path.indexOf("/search/city_entrance.jsp")>0){
		for(var i=0;i<mainCitiesPinyin.length;i++){
			if(path.indexOf(mainCitiesPinyin[i])>0){
				document.getElementById('zone').value= mainCitiesLabel[i];
				document.getElementById('location').value= mainCitiesValue[i];
				genAroundCityForMoreOption(mainCitiesLabel[i]);
				return;
			}
		}
		if(!document.getElementById('location').value){
			document.getElementById('zone').value= '全国';
			document.getElementById('location').value= '';
		}
		return;
	}
	*/
}


/**
 *首页职位查询
 *Update: 2010-11-5
 *By:Lulu
 */
//
function positionSearch() {
	var form = document.getElementById("searchForm");
	var keyword = document.getElementById("searchBar_keyword");
	var location = document.getElementById("searchBar_location");
	var locationLabel = document.getElementById("searchBar_zone");
	var workLocation = document.getElementById("searchBar_workLocation");
	var provinces_and_cities = document.getElementById("provinces_and_cities");
	var keywordType = document.getElementsByName("keywordType");
	var type = keywordType[1].checked?keywordType[1].value:(keywordType[2].checked?keywordType[2].value:keywordType[0].value);
	var jobMainCatalogry = document.getElementById("jobMainCatalogry");
	var jobFunction = document.getElementById("searchBar_jobFunction");
	var calling = document.getElementById("searchBar_calling");
	var positionPostDate = document.getElementById("searchBar_positionPostDate");
	var around_city = document.getElementsByName("location_around_city");
	var jobLocation = document.getElementById("searchBar_jobLocation");

	var around_city_label = '';
	var around_city_value = '';

	if(keyword.value=='职位关键字…') keyword.value= '';
	if(workLocation.value=='区/镇…') workLocation.value= '';

	//check if the more option collapse is closed
	if(parseInt(moreOptionCollapse.divObj.style.height)==0){
		//set default value for more option
		jobMainCatalogry.value = '';
		jobFunction.value = "0";
		//for IE, reset the select of sub jobfunction
		//selectOnchange4d(form.jobMainCatalogry, form.jobfunction,'jobcatelog');
		calling.value = "0";
		positionPostDate.value = "366";
		provinces_and_cities.value = location.value;
		//genAroundCityForMoreOption(locationLabel.innerHTML);
	}else{
		for(var i=0;i<around_city.length;i++){
			if(around_city[i].checked) {
				around_city_label += around_city[i].label + ';';
				around_city_value += around_city[i].value + ';';
			}
		}
		if(around_city_label.length>0) around_city_label = around_city_label.substring(0, around_city_label.length-1);
		if(around_city_value.length>0) around_city_value = around_city_value.substring(0, around_city_value.length-1);
		if(around_city_value.length>0) provinces_and_cities.value = around_city_value;
		else provinces_and_cities.value = location.value;
	}
	/*
	*转换为新的搜索参数，update by mojiahui 2010-10-18
	*/
	jobLocation.value= provinces_and_cities.value.replace(/,/g,"@").replace(/;/g,",").replace(/@/g,";");

	//store search field in cookie
	storeSearchField();
	//form.submit();
	setTimeout(function(){
		if(keyword.value=='') {
			keyword.value= '职位关键字…';
		} else {
			if(keyword.value!='职位关键字…') keyword.style.color='#000';
		}

		if(workLocation.value=='') {
			workLocation.value= '区/镇…';
		} else {
			if(workLocation.value!='区/镇…') workLocation.style.color='#000';
		}
	},2000);
}


/*表单重复提交标识--全局变量*/
var hasSubmit = false;
/**用户登陆*/ //last update: 2008/1/3
function userLogin(){
	if(hasSubmit) return false;

	var form = null;
	if(document.getElementsByName("loginForm").length==2){
		form = document.getElementsByName("loginForm")[1];
	}else if(document.getElementsByName("loginForm").length==1){
		form = document.getElementsByName("loginForm")[0];
	}

	var userName = form.userName;
	var password = form.password;
	var memberType = form.MemberType;
	var chkCode = form.chkCode;

	if(userName.value.length<1) { alert("用户名不能为空!");  userName.focus();  return false; }
	if(password.value.length<1) { alert("密码不能为空!");   password.focus();  return false; }
	if (!isStr(userName.value)) { alert("注意：用户名不能使用汉字、汉字字符以及非法字符（包括：空格、#、%等）！\n请把非法字符去掉后再尝试登录。");	userName.focus(); return false;	}
	if (!isStr(password.value)) { alert("注意：密码不能使用汉字、汉字字符以及非法字符（包括：空格、@、#、%等）！\n请把非法字符去掉后再尝试登录。");	password.focus();	return false;	}

	if(memberType[1].checked){
		form.action="/company/CompanyLogin?action=login";
		if(chkCode.value.length<1) {	alert("请输入登录验证码!");	chkCode.focus();	return false;	}
	}	else { form.action="/loginform";	}

	form.target = '_self';
	//form.submit();
	//for ie6
	window.setTimeout( function(){ form.submit(); }, 0);

	hasSubmit = true;
	var button = document.getElementById('img_login_btn');
	if(button){
		button.src = '/images/jobcn/v95/login_v.gif';
		button.title = '登陆中，请稍候！';
		button.onclick = function(){ alert('登陆数据已经提交，请稍候！'); return false; }
	}
}


//add gateway and charset redirect links -- by zhangping
//addEventHandler(window, 'load', addGatewayRedirect);
function addGatewayRedirect() {
	if(!document.getElementById("div_gateway_redirect")) return;

	var urlCncBig = "/images/jobcn/v95/jobcn_07.jpg";
	var altCncBig = '網通用戶';
	var urlCncGB = "/images/jobcn/v95/jobcn_07.jpg";
	var altCncGB = "网通用户";
	var urlTeleBig = "/images/jobcn/v95/jobcn_07_1.jpg";
	var altTeleBig = '電信用戶';
	var urlTeleGB = "/images/jobcn/v95/jobcn_07_1.jpg";
	var altTeleGB = "电信用户";
	var urlCharBig = "/images/jobcn/v95/jobcn_09.jpg";
	var altCharBig = "BIG5繁體版";
	var urlCharGB = "/images/jobcn/v95/jobcn_09_1.jpg";
	var altCharGB = "GB2312简体版";

	var div = document.getElementById("div_gateway_redirect");
	var links = div.getElementsByTagName("A");
	var line = links[0].getElementsByTagName("IMG")[0];
	var gateway = links[1].getElementsByTagName("IMG")[0];

	var isCNC = false;
	var isBig5 = false;
	if(window.location.href.indexOf("cnc.jobcn")>-1  /* || window.location.href.indexOf("cnc2.jobcn")>-1*/) isCNC = true;
	if(window.location.href.indexOf("big5.jobcn")>-1 /* || window.location.href.indexOf("cnc2.jobcn")>-1*/) isBig5 = true;

	line.src = isBig5? (isCNC? urlTeleBig : urlCncBig) : (isCNC? urlTeleGB : urlCncGB) ;
	line.alt = isBig5? (isCNC? altTeleBig : altCncBig) : (isCNC? altTeleGB : altCncGB) ;

	gateway.src = isBig5? urlCharGB : urlCharBig;
	gateway.alt = isBig5? altCharGB : altCharBig;
}


var TOP_LOGIN_BOX_EXCLUDE_PAGE = [
	"/" + "default.jsp",
	"/" + "person/per_login.jsp",
	"/" + "company/login.jsp",
	"/" + "company/companyregs/",
	//"/" + "person/register/",
	"/" + "company/index.jsp",
	"/" + "person/Per_ManagementCenter.jsp",
	"/" + "person/PlaceToCollection.jsp",
	"/" + "search/city_entrance.jsp"	];

//add for top login box toggle -- by zhangping
//addEventHandler(window, 'load', toggleTopLoginBox);
jobcn.ready(toggleTopLoginBox);
function toggleTopLoginBox(){
	var div_top_login = document.getElementById('div_top_login');
	var path = location.pathname;
	var display = true;

	//for home page
	if(path == "/") {
		display = false;
	}else {
		for(var i=0;i<TOP_LOGIN_BOX_EXCLUDE_PAGE.length;i++){
			if(path.indexOf(TOP_LOGIN_BOX_EXCLUDE_PAGE[i])==0){
				display = false;
				break;
			}
		}
	}
	if(!display) div_top_login.parentNode.removeChild(div_top_login);
	else div_top_login.style.display = "block";

	//---- add 2008/03/26
	var radios = document.getElementsByName("MemberType");
	var chkCodeBox = document.getElementById("chkCodeBox");

	if(radios && chkCodeBox){
		var validCodeImg = chkCodeBox.getElementsByTagName("IMG")[0];
		radios[0].checked = true;
		radios[0].onclick = radios[1].onclick = function() {
			if(this.value == 1) {
				chkCodeBox.style.display = "none";
				validCodeImg.src = "";
			}else{
				validCodeImg.src = "/public/image.jsp?Rkey=" + Math.random();
				chkCodeBox.style.display = "block";
			}
		}
	}//---- add 2008/03/26

	addLoginToggle();//add login box or user info toggle
	addCheckCodeToggle();//add for check code box toggle
	addEnterLogin();//add for enter login event
}


//add login box or user info toggle -- by zhangping
//addEventHandler(window, 'load', addLoginToggle);
function addLoginToggle(){
	if(!Cookie.get('gawk_type') && !Cookie.get('perUserName') ) return; //not login

	var div_top_login = document.getElementById('div_top_login');
	var div_login_box = document.getElementById('div_login_box');
	//var div_reg_link = document.getElementById('div_reg_link');

	if(!div_top_login && !div_login_box) return;

	var nameLength = 12;
	var titleLength = 25;
	var URL_MSG_REQUEST = "/public/msgcacheservlet.jsp";	//消息缓存Servlet请求URL
	var COOKIE_NAME_SYS_MSG_VIEWED_LIST= "sys_msg_viewed_list";
	var URL_COM_INDEX = "/company/index.jsp"	//企业管理中心首页
	var URL_PER_INDEX_0 = "/person/Per_ManagementCenter.jsp";	//个人管理中心首页
	var URL_COM_MSG_LIST = "/company/message/list.jsp"; //企业消息列表页面
	var URL_PER_MSG_LIST_0 = "/person/Per_ManagementCenter.jsp?url=message/list.jsp"; //消息列表页面

	var gawk_type = Cookie.get('gawk_type');
	var m_class = Cookie.get('m_class');
	var gawk_name = Cookie.get('gawk_name') || Cookie.get('perUserName');
	gawk_name = gawk_name.replace('+',' ');
	var short_name = gawk_name;
	if(gawk_name.length>nameLength) short_name = gawk_name.getShort(nameLength);
	var title_name = gawk_name;
	if(gawk_name.length>titleLength) title_name = gawk_name.getShort(titleLength);
	var gawk_date = Cookie.get('gawk_date');
	if(gawk_date)	gawk_date = gawk_date.replace('+',' ').substring(0, gawk_date.indexOf('.'));

	var uType = gawk_type=='c'? '1' : '2';
	var uId = gawk_type=='c'? Cookie.get('comid') : Cookie.get('perAccountId')

	var url_index   = gawk_type=='c'?	URL_COM_INDEX :URL_PER_INDEX_0;
	var url_message = gawk_type=='c'?	URL_COM_MSG_LIST : URL_PER_MSG_LIST_0 ;

	var prompt_msg = '您好！<a href="' + url_index + '" title="' + gawk_name + '" style="font-weight:bold;">'+ short_name  + '</a>';
	if(gawk_date)  prompt_msg += '(登陆时间：' + gawk_date + ')';

	var temp_line_height = (gawk_date==null)? 'line-height:2.75em;' : '' ;
	var prompt_msg2 = '<div style="text-align:left;float:left;line-height:23px;padding-bottom:3px;' + temp_line_height + '"><b style="font-size:13px;">' + title_name + '</b> <br/>欢迎您进入<b>“卓博人才网”</b><br/>';

	if(gawk_date)  prompt_msg2 += '您最近登录的时间：' + gawk_date + '<br/>';

	var comLinks = '<a href="/company/index.jsp">企业管理中心</a>┊' +
								'<a href="/company/resumefind/Searcher.jsp">简历搜索器</a>┊' +
								'<a href="/company/resumestore/ApplyResume.jsp">收到应聘简历</a>┊' +
								'<a href="/company/companyjob/publishJobs.jsp">发布职位</a>┊' +
								'<a href="/company/companyjob/AdminJobs.jsp">职位管理</a> </div>';
	var perLinks = '<a href="/public/_head_redirect.jsp">个人管理中心</a>┊' +
								'<a href="/public/_head_redirect.jsp?key_str=basic_info">修改简历</a>┊' +
								'<a href="/public/_head_redirect.jsp?key_str=apply_his">应聘历史记录</a>┊' +
								'<a href="/public/_head_redirect.jsp?key_str=view_his">简历被查看历史</a> </div>';

	if(div_login_box){
		//div_login_box.style.width = parseInt(div_login_box.offsetWidth ) + 100 + 'px';
		//document.getElementById('div_reg_link').style.width = parseInt(document.getElementById('div_reg_link').offsetWidth ) - 100 + 'px';
		//div_login_box.innerHTML = prompt_msg2 + (gawk_type=='c' ? comLinks : perLinks);
		//div_reg_link.innerHTML = '<a href="'+ (gawk_type=='c' ? '/company/CompanyLogin?action=logout' : '/Logout?src=0') + '"><img src="/images/jobcn_loginout.gif" vspace="4" border="0" alt="人才招聘网|卓博人才网-退出" /></a>'

		div_login_box.innerHTML = prompt_msg2 + (gawk_type=='c' ? comLinks : perLinks) + '<div style="float:right;padding-right:30px;"><a href="'+ (gawk_type=='c' ? '/company/CompanyLogin?action=logout' : '/Logout?src=0') + '"><img src="/images/jobcn_loginout.gif" vspace="4" border="0" alt="人才招聘网|卓博人才网-退出" /></a></div>'
	}

	if(div_top_login){
		div_top_login.innerHTML =  prompt_msg;
		Ajax.dispatch(URL_MSG_REQUEST, {params:'uType=' + uType + '&uId=' + uId ,	onComplete: filRegDiv	});
	}

	function filRegDiv(transport){
		var cacheList = transport.responseText.split(",");
		var viewedList = Cookie.get(COOKIE_NAME_SYS_MSG_VIEWED_LIST);
		//var numTotal = parseInt(cacheList[1]);
		var numUser = parseInt(cacheList[0]);
		var numSys = cacheList.length - 2;
		if(viewedList && numSys > 0) {
			viewedList = viewedList.split(",");
			for(var i=2; i< cacheList.length; i++)
				for(var j=0; j< viewedList.length; j++)
					if(parseInt(cacheList[i]) == parseInt(viewedList[j])){ numSys--;	break; }
		}
		div_top_login.innerHTML = prompt_msg + '，<a href="' + url_message +
			'" style="color:#f00;">您共有<b>' + (numUser + numSys) + '</b>条新消息</a> ' +
			'<a href="'+ (gawk_type=='c' ? '/company/CompanyLogin?action=logout' : '/Logout?src=0') + '">[退出]</a>';
	}
}


//add for check code box toggle -- by zhangping
//addEventHandler(window, 'load', addCheckCodeToggle);
/*
function addCheckCodeToggle(){
	var radios = document.getElementsByName("MemberType");
	var chkCodeBox = document.getElementById("chkCodeBox");
	if(!radios || !chkCodeBox) return;

	var loginAdSpan = document.getElementById("loginAdSpan");
	var validCodeImg = chkCodeBox.getElementsByTagName("IMG")[0];

	radios[0].checked = true;
	radios[0].onclick = radios[1].onclick = function() {
		if(this.value == 1) {
			chkCodeBox.style.display = "none";
			validCodeImg.src = "";
			if(loginAdSpan) loginAdSpan.style.display = "block";
		}else{
			validCodeImg.src = "/public/image.jsp?Rkey=" + Math.random();
			chkCodeBox.style.display = "block";
			if(loginAdSpan) loginAdSpan.style.display = "none";
		}
	}
}
*/
function addCheckCodeToggle(){
	var form = null;
	if(document.getElementsByName("loginForm").length==2){
		form = document.getElementsByName("loginForm")[1];
	}else if(document.getElementsByName("loginForm").length==1){
		form = document.getElementsByName("loginForm")[0];
	}
	if(!form) return;
	var radios = form.MemberType;
	var chkCodeInput = form.chkCode;
	var checkcodeLabel = document.getElementById("checkcode_label_td");
	var checkimg = document.getElementById("checkimg");

	if(!radios || !chkCodeInput ||!checkcodeLabel ||!checkimg) return;

	radios[0].onclick = function(){check(1); };
	radios[1].onclick = function(){check(2); };
	function check(index) {
		//if(this.value == 1) chkCodeInput.disabled = true;
		//else	chkCodeInput.disabled = false;

		if(index==1) {
			chkCodeInput.style.background = "url(/images/jobcn/v95/chkCode_d.gif)";
			checkcodeLabel.style.color = "#CCC";
			checkimg.src = "/GBImage/jobcn/v95/chimg.gif"
	  	chkCodeInput.style.borderColor = "#eee";
	  	//chkCodeInput.style.fontWeight = "100";
	  	//chkCodeInput.style.color = "#eee";
			chkCodeInput.disabled = true;
			//chkCodeInput.value = '不用填写';
		}else {
			checkcodeLabel.style.color = "#000";
			checkimg.src = "/images/jobcn/v95/loading1.gif";
			checkimg.src = "/public/image.jsp?Rkey=" + Math.random();
			chkCodeInput.style.borderColor = "#CCC";
	  	chkCodeInput.style.fontWeight = "bold";
	  	chkCodeInput.style.color = "#000";
			chkCodeInput.disabled = false;
			chkCodeInput.style.background = "url()";
			chkCodeInput.style.backgroundColor = "#FFF";
			chkCodeInput.value = '';
		}
	}


	radios[0].checked = true;
	check(1);
}

//add for enter login event -- by zhangping
//addEventHandler(window, 'load', addEnterLogin);
function addEnterLogin(){
	var form = null;
	if(document.getElementsByName("loginForm").length==2){
		form = document.getElementsByName("loginForm")[1];
	}else if(document.getElementsByName("loginForm").length==1){
		form = document.getElementsByName("loginForm")[0];
	}
	if(!form) return;
	var userName = form.userName;
	var password = form.password;
	var memberType = form.MemberType;
	var chkCode = form.chkCode;

	if(!userName || !chkCode || !memberType) return;

 	userName.onkeyup = function(eve){
		if(!eve) eve = window.event;
		if(eve.keyCode==13) password.focus();
	}
 	password.onkeyup = function(eve){
		if(eve && !password.value) return;
		if(!eve) eve = window.event;
		if(eve.keyCode==13 && memberType[0].checked) userLogin();
		else if(eve.keyCode==13 && memberType[1].checked)	chkCode.focus();
	}
 	chkCode.onkeyup = function(eve){
		if(eve && !chkCode.value) return;
		if(!eve) eve = window.event;
		if(eve.keyCode==13) userLogin();
	}
}

//add for enter search event -- by zhangping
//addEventHandler(window, 'load', addEnterSearch);
jobcn.ready(addEnterSearch);
function addEnterSearch(){
	var keyword = document.getElementById("searchBar_keyword");
	var town = document.getElementById("searchBar_workLocation");

	if(!keyword || !town) return;
 	town.onkeyup = function(eve){
		if(!eve) eve = window.event;
		if(eve.keyCode==13) positionSearch();
	}
	addEventHandler(keyword, 'keyup', addKeywordEnterSearch);
}

function addKeywordEnterSearch(eve){
	if(!eve) eve = window.event;
	if(eve.keyCode==13) positionSearch();
}

//add for more option box toggle -- by zhangping
//addEventHandler(window, 'load', addMoreOptionToggle);
jobcn.ready(addMoreOptionToggle);
function addMoreOptionToggle(){
	var toggle = document.getElementById("button_more_option");
	if(!toggle) return;

	toggle.onclick = function(){
		var height = parseInt(moreOptionCollapse.divObj.style.height);
		if(height>0) {
			toggle.innerHTML = '[ 展开更多条件 <img src="/commimage/jobcn/v95/ico_1.gif" /> ]';
		}else {
			toggle.innerHTML = '[ 收起更多条件 <img src="/commimage/jobcn/v95/ico_2.gif" /> ]';
		}

		if(height==0){
			resetPositionPostDate();
			//setTimeout(function(){document.getElementsByName("btn_jobMainCatalogry")[0].focus();}, 400)
		} else {
			//var keyword = document.getElementsByName("keyword")[0];
			//keyword.focus();
		}
		moreOptionCollapse.slideit();
		jobcn.Analytics.Track("/main/menu/searchBar/more");
	}
}


//add area selector -- by zhangping
var areaselector = null;
//addEventHandler(window, 'load', addAreaSelector);
jobcn.ready(addAreaSelector);
function addAreaSelector(){
		var areaConfig = {
			id:"id_selector_area",
			className:"area_selector",
			width:"530px",

			top: "50px",
			//left: "400px",
			values: provinceValue,
			labels: provinceLabel,
			subValues: cityValue,
			subLabels: cityLabel,
			usableValues:	mainCitiesValue,
			usableLabels: mainCitiesLabel ,
			colunms: 6,

			title:	'请选择您想搜索的地区（仅能选择一项。若要选择多项，请使用“<a style="color:white;" href="/person/resume_search/Per_FullFuncSearcher.jsp">全能搜索</a>”）',
			mainCityLabel:	"主要城市及地区快速选择：",
			provinceLabel:	"选择省区：" ,//"省区范围：",
			cityLabel: 			"选择城市：",//"城市范围：",
			promptDefault: "工作地点…",
			superAllValue:	"",
			superAllLabel:	"全国[不限]",
			subAllLabel:	"[不限]",

			modelDialog: true,
			singleChoose: true,

			oddBgColor: "#F9F9F9", //"#FFFBF6"
			eveBgColor: "#F9F9F9", //"#FFFFFF"

			submit: function(value, label){
				if(value == '其他,其他') label = '其他省区';
				else if(label == '其他')  label = value.replace(',','');
				else if(value=='')  label = '全国';
				document.getElementById('provinces_and_cities').value = '';
				document.getElementById('searchBar_zone').innerHTML = label;
				document.getElementById('searchBar_location').value = value;
				genAroundCityForMoreOption(label)
				//alert("value: " + value + '\n' + "label: " + label)
			}
		};

		var zone = document.getElementById('searchBar_zone');
		if(zone){
			areaselector = new AreaSelector(areaConfig);
			areaselector.init();
			zone.onclick = function() { areaselector.show( new String(zone.innerHTML )) };
		}
}

var buttonTextLength = 12;
var catelogDailog = null;
//addEventHandler(window, 'load', addCatelogDailog);
jobcn.ready(addCatelogDailog);

function addCatelogDailog(){
	var catelogConfig = {
		className:"pop_dailog",
		width:"500px",
		//height:"450px",
		top: "100px",
		//left: "400px",
		title:"请选择您想搜索的岗位 ",
		searchLabel: "请输入您要查询的关键字  ",
		promptFlag:	true,
		promptLabel:"当前选择的岗位：",
		promptNull:	"[未选]",
		data: catelogs,
		allValue: 0,
		allLabel: '岗位不限',
		model: true,
		drag:  false,
		colunms: 3,
		oddBgColor: "#F9F9F9", //"#FFFBF6"
		eveBgColor: "#F9F9F9", //"#FFFFFF"

		submit: function(value,label){
			var form = document.getElementById("searchForm");
			var jobMainCatalogry = document.getElementById("jobMainCatalogry");
			var jobFunction = document.getElementById("searchBar_jobFunction");
			jobMainCatalogry.value = value.toString().substring(0,2) + "00";
			jobFunction.value = value;

			var btn_jobMainCatalogry = document.getElementById('btn_jobMainCatalogry');
			var btn_jobfunction = document.getElementById('btn_jobfunction');

			btn_jobMainCatalogry.value = catelogDailog.supCheckLabel.getShort(13);
			btn_jobMainCatalogry.title = catelogDailog.supCheckLabel;

			btn_jobfunction.value = catelogDailog.subCheckLabel.getShort(13);
			btn_jobfunction.title = catelogDailog.subCheckLabel;
		}
	};

	var button1 = document.getElementById('btn_jobMainCatalogry');
	var button2 = document.getElementById('btn_jobfunction');
	var supCatelog = document.getElementById('jobMainCatalogry');

	if(button1 && button2){
		catelogDailog = new CatelogDailog(catelogConfig);
		button1.onclick = function() { catelogDailog.listSupCatelog() ;catelogDailog.show();jobcn.Analytics.Track("/main/menu/searchBar/catelog/parent");};
		button2.onclick = function() { catelogDailog.listSubCatelog(supCatelog.value, button1.title); catelogDailog.show();jobcn.Analytics.Track("/main/menu/searchBar/catelog/sub"); };
	}
}

//addEventHandler(window, 'load', addCallingDailog);
jobcn.ready(addCallingDailog);
function addCallingDailog(){
	var callingConfig = {
		className:"pop_dailog",
		width:"500px",
		//height:"450px",
		top: "100px",
		//left: "400px",
		title:"请选择您想搜索的行业 ",
		promptFlag:	true,
		promptLabel:"当前选择的行业：",
		promptNull:	"[未选]",
		allValue: 0,
		allLabel: "[行业不限]",
		data: callings,
		model: true,
		drag:  true,
		colunms: 3,
		oddBgColor: "#F9F9F9", //"#FFFBF6"
		eveBgColor: "#F9F9F9", //"#FFFFFF""

		submit: function(value,label){
			var calling = document.getElementById("searchBar_calling");
			calling.value = value;
			document.getElementById('btn_calling1').value = label.length > buttonTextLength ? label.getShort(buttonTextLength) : label;
			document.getElementById('btn_calling1').title = label;
		}
	};

	var button = document.getElementById('btn_calling1');
	if(button){
		var callingdailog = new CallingDailog(callingConfig);
		button.onclick = function() { callingdailog.show() };
	}
}

//addEventHandler(window, 'load', addDaysDailog);
jobcn.ready(addDaysDailog);
function addDaysDailog(){
	var daysConfig = {
		className:"pop_dailog",
		width:"500px",
		//height:"450px",
		top: "200px",
		//left: "400px",
		title:"请选择职位发布日期范围 ",
		promptFlag:	true,
		promptLabel:"当前选择的日期范围：",
		promptNull:	"一周内",	//"[未选]",
		data: [[1,"1天内"],[3,"3天内"],[7,"一周内"],[15,"半月内"],[30,"一个月内"],
			[60,"二个月内"],[90,"三个月内"],[183,"半年内"],[366,"一年内"]],
		model: true,
		drag:  true,
		colunms: 3,
		oddBgColor: "#F9F9F9", //"#FFFBF6"
		eveBgColor: "#F9F9F9", //"#FFFFFF"

		submit: function(value,label){
			var form = document.getElementsByName("searchForm")[0];
			var positionPostDate = document.getElementById("searchBar_positionPostDate");
			positionPostDate.value = value;
			document.getElementById('btn_positionPostDate').value = label;
			document.getElementById('btn_positionPostDate').title = label;
		}
	};

	var button = document.getElementById('btn_positionPostDate');
	if(button){
		var daysDailog  = new DaysDailog(daysConfig);
		button.onclick = function() { daysDailog.show() };
	}
}


//add checkbox of around cities for more option box toggle -- by zhangping
var collapseHeight = 98;
//addEventHandler(window, 'load', function(){ if(document.getElementById('div_more_option') && moreOptionCollapse.contentheight) collapseHeight = moreOptionCollapse.contentheight;	} );
function genAroundCityForMoreOption(label){
	var array = null;
	var table = document.getElementById('div_more_option').getElementsByTagName('TBODY')[0];
	if(table.rows.length ==3 ) {
		table.deleteRow([2]);
		if(parseInt(moreOptionCollapse.divObj.style.height)!=0) moreOptionCollapse.divObj.style.height = collapseHeight + 'px';
		moreOptionCollapse.contentheight = collapseHeight;
	}
	for(var i=0;i<aroundCities.length;i++){ //aroundCities come from area.js
		if(aroundCities[i][0] == label){
			array = aroundCities[i];
			break;
		}
	}

	//for no arount city, return
	if(array==null) return;

	//add table row for around cities
	var columns = 9;
	var rowHeight = 25;
	var ie6LineOffset = 5;

	var tr = document.createElement('TR');
	var td = document.createElement('TD');
	td.appendChild(document.createTextNode("周边地区："));
	td.className = "font_12w2";
	td.style.textAlign = "right";
	td.style.verticalAlign = "top";
	tr.appendChild(td);
	td = document.createElement('TD');
	td.colSpan = 4;
	td.className = "font_12w2";
	td.style.textAlign = "left";
	tr.appendChild(td);
	table.appendChild(tr);

	var count = 0;
	var check = null;
	var checkAll = label=='珠三角'|| label=='长三角';

	for(var j=0;j<array[1].length;j++){
		if(count!=0 && count%columns==0)
			td.appendChild(document.createElement('BR'));
		check = document.createElement('INPUT');
		check.type = 'checkbox';
		check.name = 'location_around_city';
		check.id = 'location_around_city';//for ie getElementByName()
		check.value = array[2][j];
		check.label = array[1][j];
		td.appendChild(check);
		td.appendChild(document.createTextNode(check.label + ' '));
		//for ie, must after appendChild
		check.checked = checkAll ? true: (label==array[1][j]);
		count++;
	}

	var rows = (count%columns==0? count/columns: parseInt(count/columns)+1);
	var newHeight = (rows * rowHeight);
	//for ie6 line height offset
	if(navigator.appName.indexOf("Explorer") > -1 && navigator.appVersion.indexOf("6.") > -1){
			newHeight = newHeight - ie6LineOffset * (rows<2? 0 : rows);
	}
	if(parseInt(moreOptionCollapse.divObj.style.height)!=0) moreOptionCollapse.divObj.style.height = collapseHeight + newHeight + 'px';
	moreOptionCollapse.contentheight = collapseHeight + newHeight;
}


//add for fix position of the more option for search in inc_searchbar.jsp -- by zhangping
//addEventHandler(window, 'load', pointMoreOptionDiv);
jobcn.ready(pointMoreOptionDiv);
addEventHandler(window, 'resize', pointMoreOptionDiv);
function pointMoreOptionDiv() {
	if(!document.getElementById('div_more_option')) return;
	var div_main_menu = document.getElementById('main_menu');
	var div_more_option = document.getElementById('div_more_option');
	div_more_option.style.left = findPos(div_main_menu)[0] - 11 + "px";
	div_more_option.style.top = findPos(div_main_menu)[1] + 57 + "px";
}


//fill locatino for city_entrance.jsp -- by zhangping 2008/03/28
//addEventHandler(window, 'load', fillLocatinoForCityEntrance);
jobcn.ready(fillLocatinoForCityEntrance);
function fillLocatinoForCityEntrance(){
	var path = window.location.href;
	if(path.indexOf("/search/city_entrance.jsp")>0){
		for(var i=0;i<mainCitiesPinyin.length;i++){
			if(path.indexOf(mainCitiesPinyin[i])>0){
				document.getElementById('searchBar_zone').innerHTML= mainCitiesLabel[i];
				document.getElementById('searchBar_location').value= mainCitiesValue[i];
				genAroundCityForMoreOption(mainCitiesLabel[i]);
			}
		}
		if(!document.getElementById('searchBar_location').value){
			document.getElementById('searchBar_zone').innerHTML= '全国';
			document.getElementById('searchBar_location').value= '';
		}
	}
}




function addEventHandler (oTarget, sEventType, fnHandler) {
    if (oTarget.addEventListener) {
        oTarget.addEventListener(sEventType, fnHandler, false);
    } else if (oTarget.attachEvent) {
        oTarget.attachEvent("on" + sEventType, fnHandler);
    } else {
        oTarget["on" + sEventType] = fnHandler;
    }
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function isStr(s) {
	var _s = s;
	if (s.length == 0) return false;
	var regu = "^[0-9A-Za-z_]*$";
	var re   = new RegExp(regu);
	s = s.replace('@', '');
	s = s.replace('.', '');
	if (s.search(re) != -1)
	{
		return true;
	}
	else
	{
		if (isEmail(_s))
			return true;
		else
			return false;
	}
}


//String's get string length util method -- 2008/02/18
String.prototype.getLength = function() {
	var i,sum;
	sum=0;
	for(i=0;i<this.length;i++){
		if((this.charCodeAt(i)>=0) && (this.charCodeAt(i)<=255)) sum=sum+1;
		else sum=sum+2;
	}
	return sum;
}

//String's get short substring util method -- 2008/02/18
String.prototype.getShort = function(len) {
	if(!len) return '';
	if(this.getLength()<=len*2) return this;

	len = 2*(len-1);
	var a = 0;
	var i = 0;
	var temp = '';

	for (i=0;i<this.length;i++){
		if (this.charCodeAt(i)>255) a+=2;
		else a++;
		if(a > len) return temp + '...';
		temp += this.charAt(i);
	}
	return this;
}

/**下拉菜单选择*/
function selectOnchange4d(mainitem,subitem,catalog) {
    setSubSelectItem(catalog,mainitem,subitem);
}

function setSubSelectItem(catalog,mainitem,subitem)
{
	var itemCount;
	var items = new Array();
	var filterStr='北京天津上海重庆';
	var subvalue=mainitem.options[mainitem.selectedIndex].value;
	var szHref = document.location.href.toUpperCase();

	if(catalog=='jobcatelog')
	{
		subitem.length = 0;
		itemCount = catelogCount;
		items = catelogs;
		var opt=document.createElement("OPTION");
		if((subvalue == ''))
		{
			with(opt)
			{
				text="不限";
				value="";
				style.color="navy";
			}
			try{
			  subitem.add(opt);
		  } catch(e) {
		    subitem.add(opt, null);
		  }
		}
		var flag = false;
		for (i=0;i<itemCount; i++)
		{
			if ((items[i][2]).substring(0,2) == subvalue.substring(0,2))
			{
				flag = true;
				var opt=document.createElement("OPTION");
				opt.text=items[i][0];
				opt.value=items[i][2];
  				try{
	  				  subitem.add(opt);
		  		  } catch(e) {
	  				  subitem.add(opt, null);
  				  }
			}
			else{
				if (flag)
					{
						break;
					}
			}

		}
	}
	else if(catalog=='citys1')
	{
		subitem.length = 0;
		itemCount = cityCount;
		items = citys;
		var opt=document.createElement("OPTION");
		if((subvalue == ''))
		{
			with(opt)
			{
				text="不限";
				value="";
			}
			try{
			  subitem.add(opt);
		  } catch(e) {
		    subitem.add(opt, null);
		  }
		}
		for (i=0;i < itemCount; i++)
		{
			if (items[i][1] == subvalue)
			{
				var opt=document.createElement("OPTION");
				opt.text=items[i][0];
				opt.value=items[i][2];
  			try{
  			  subitem.add(opt);
  		  } catch(e) {
  		    subitem.add(opt, null);
  		  }
			}
		}
	}
	else if(catalog=='citys0')
	{
		subitem.length = 0;
		itemCount = cityCount;
		items = citys;
		var opt=document.createElement("OPTION");
		for (i=0;i < itemCount; i++)
		{
			var bOk = (flag==1 && items[i][1]!='' && subvalue!='' && subvalue.indexOf(items[i][1])>-1) ;
			var bMy = ((mainitem.name=='hometown_p' || mainitem.name=='location_p') && ((szHref.indexOf('PER_')>-1)||(szHref.indexOf('AUDIT')>-1)));
			var bJb = ((mainitem.name.indexOf('jobLocation')>-1) && ((szHref.indexOf('PER_')>-1)||(szHref.indexOf('AUDIT')>-1)));
			if (items[i][1] == subvalue || bOk)
			{
				var opt=document.createElement("OPTION");
				var tmp_v = items[i][1];
				if (flag==1) opt.text=items[i][3];
				else opt.text=items[i][2];
				opt.value=items[i][2];
				if (bMy && i<itemCount-1)
				{
					if (flag==1) opt.text=items[i+1][3];
					else opt.text=items[i+1][2];
					opt.value=items[i+1][2];
					tmp_v=items[i+1][1];
				}
				if (bMy && (subvalue.indexOf('北京')>-1 || subvalue.indexOf('天津')>-1 || subvalue.indexOf('上海')>-1 || subvalue.indexOf('重庆')>-1))
				{
					opt.text='';
					opt.value='';
				}
				if (bJb)
				{
					if (flag==1) opt.text=items[i][3];
					else opt.text=items[i][0].replace('├-','');
				}
				if(items[i][1] == tmp_v){
//					try{
						subitem.options.add(opt);
//					}catch(e){
//						subitem.add(opt,null);
//					}
				}
			}
		}
	}
}


/**打开一个不可见的窗口*/
function openHideWin(sPath) {
    window.open(sPath,'welcome','width=10px,height=10px,top=2000px,left=2000px');
}

/**检查是否为正确的电子邮件格式*/
function isEmail(s) {
	if (s.length > 100)	return false;
	if (s.indexOf("'")!=-1) return false;
	var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+(.+)$";
	var re = new RegExp(regu);
	if (s.search(re) != -1)	return true;
	else return false;
}
/**订阅与退订*/
function MagzineAct(bl) {
	var v=document.thisForm.email.value;
	var m=v.replace(' ','');
	var emailtype=document.thisForm.emailtype.value;
	if(m.length<6) {
		alert("请输入电子邮件地址！");
		return false;
	}
	if(!isEmail(m)) {
		alert("请输入正确的电子邮件地址!");
		document.thisForm.email.focus();
		return false;
	}
	document.thisForm.email.value=m;
	if(bl=='DingYue')	{
		openHideWin('/public/orderWeekly.jsp?strAct=yes&email='+m+'&emailtype='+emailtype);
	}	else {
		if(window.confirm("您确定要退订该卓博周刊吗?退订后您将不再收到该人力资源杂志信息!"))
			openHideWin('/public/orderWeekly.jsp?strAct=no&email='+m+'&emailtype='+emailtype);
	}
}


/*表单重复提示框*/
function showWaitDiv(){
	var obj = document.getElementById("ts");
	if(obj && typeof obj=="object"){
		obj.style.display="block";
		obj.style.left=((document.body.offsetWidth-parseFloat (obj.style.width))/2) + document.body.scrollLeft;
		obj.style.top=((document.body.offsetHeight-parseFloat (obj.style.height))/2) + document.body.scrollTop;
	}
}

//to delete, replace by String.prototype.getShort
/*
function getShortString(str, len){
	if(!str) return '';
	if(str.length>parseInt(len)) return str.toString().substring(0, len-1) + '...';
	else return str;
}
*/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//登录框效果  -- by liaojiawen
function fEvent(sType,oInput){
	switch (sType){
		case "focus" :
			oInput.isfocus = true;
		case "mouseover" :
			oInput.style.borderColor = '#9ecc00';
			break;
		case "blur" :
			oInput.isfocus = false;
		case "mouseout" :
			if(!oInput.isfocus){
				oInput.style.borderColor='#ccc';
			}
			break;
	}
}



//根据日期选项给positionPostDate赋值
function resetPositionPostDate(){
	var days = [[1,"1天内"],[3,"3天内"],[7,"一周内"],[15,"半月内"],[30,"一个月内"],
			[60,"二个月内"],[90,"三个月内"],[183,"半年内"],[366,"一年内"]]
	var positionPostDate = document.getElementById("searchBar_positionPostDate");
	var btn_positionPostDate = document.getElementById("btn_positionPostDate");
	if(btn_positionPostDate && positionPostDate){
		var label = btn_positionPostDate.value;
		for(var i=0;i<days.length;i++){
			if(label == days[i][1]){
				positionPostDate.value = days[i][0];
			}
		}
	}
}

//在 /person/resume_search/per_editaddsearcher.jsp, per_MoreDetailSearch.jsp, Per_FullFuncSearcher.jsp 等三个页面中用到此函数。
function openFunctionWin(){
		var functionConfig_ffs = {
			id:"id_selector_function_ffs",
			className:"function_selector",

			width:"500px",
			height:"450px",
			top: "50px",
			//left: "400px",

			title:"请选择您想搜索的工作岗位 ",
			searchLabel: "请输入要查找的工作岗位关键字：",

			modelDialog: true,
			submit: function(value) {

					var form = document.getElementsByName("thisForm")[0];
					var jobMainCatalogry = document.getElementsByName("mainCatalog")[0];
					var jobfunction = document.getElementsByName("subCatelog")[0];
					jobMainCatalogry.value = value.toString().substring(0,2) + "00";
					selectOnchange4d(jobMainCatalogry, jobfunction,'jobcatelog');
					jobfunction.value = value;
			}
		};

		var button = document.getElementById('fullFuncFindfunc');

			functionselector_ffs = new FunctionSelector(functionConfig_ffs);
			functionselector_ffs.init();
			button.onclick = function() { functionselector_ffs.show() };
}

