📄 searchjobcommon_cpd.js
字号:
var curTab="";var curLayer="";var TAB_ON_STYLE="tab_on";var TAB_OFF_STYLE="tab_off";var TAB_ON_STYLE_NEW="tab_on new";var TAB_OFF_STYLE_NEW="tab_off new";var BOX_ON="info";var BOX_OFF="info none";var Geometry={};Geometry.getWindowX=function(){return window.screenLeft||window.screenX;};Geometry.getWindowY=function(){return window.screenTop||window.screenY;};Geometry.getViewportWidth=function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body.clientWidth;};Geometry.getViewportHeight=function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body.clientHeight;};Geometry.getHorizontalScroll=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;};Geometry.getVerticalScroll=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;};Geometry.getDocumentHeight=function(){return(window.innerHeight&&window.scrollMaxY)?window.innerHeight+window.scrollMaxY:(document.body.scrollHeight>document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;};Array.prototype.indexOf=function(substr,start){var ta,rt,d='\0';if(start!=null){ta=this.slice(start);rt=start;}else{ta=this;rt=0;}var str=d+ta.join(d)+d,t=str.indexOf(d+substr+d);if(t==-1)return-1;rt+=str.slice(0,t).replace(/[^\0]/g,'').length;return rt;};Array.prototype.lastIndexOf=function(substr,start){var ta,rt,d='\0';if(start!=null){ta=this.slice(start);rt=start;}else{ta=this;rt=0;}ta=ta.reverse();var str=d+ta.join(d)+d,t=str.indexOf(d+substr+d);if(t==-1)return-1;rt+=str.slice(t).replace(/[^\0]/g,'').length-2;return rt;};Array.prototype.replace=function(reg,rpby){var ta=this.slice(0),d='\0';var str=ta.join(d);str=str.replace(reg,rpby);return str.split(d);};Array.prototype.search=function(reg){var ta=this.slice(0),d='\0',str=d+ta.join(d)+d,regstr=reg.toString();reg=new RegExp(regstr.replace(/\/((.|\n)+)\/.*/g,'\\0$1\\0'),regstr.slice(regstr.lastIndexOf('/')+1));t=str.search(reg);if(t==-1)return-1;return str.slice(0,t).replace(/[^\0]/g,'').length;};function StringBuilder(str){this.tmp=new Array();};StringBuilder.prototype.Append=function(value){this.tmp.push(value);return this;};StringBuilder.prototype.Clear=function(){this.tmp.length=1;};StringBuilder.prototype.toString=function(){return this.tmp.join('');};String.prototype.trueLength=function(){return this.replace(/[^\x00-\xff]/g,"**").length;};function LTrim(str,delStr){var whitespace=new String(delStr);var s=new String(str);if(whitespace.indexOf(s.charAt(0))!=-1){var j=0,i=s.length;while(j<i&&whitespace.indexOf(s.charAt(j))!=-1){j++;}s=s.substring(j,i);}return s;};function RTrim(str,delStr){var whitespace=new String(delStr);var s=new String(str);if(whitespace.indexOf(s.charAt(s.length-1))!=-1){var i=s.length-1;while(i>=0&&whitespace.indexOf(s.charAt(i))!=-1){i--;}s=s.substring(0,i+1);}return s;};function TrimLR(str,delStr){return RTrim(LTrim(str,delStr),delStr);};function Trim(str){return str.replace(/(\s*$)|(^\s*)/g,"");};function TrimEnd(str){if(str!=null&&str.length>0){var strChar="";while(str.length>0){strChar=str.substr(str.length-1,1);if(strChar==" "&&str.length>0){str=str.substr(0,str.length-1);}else break;}}return str;};function TrimStart(str){if(str!=null&&str.length>0){var strChar="";while(str.length>0){strChar=str.substr(0,1);if(strChar==" "&&str.length>0){str=str.substr(1,str.length-1);}else break;}}return str;};var keyMinChar=1;function ValidateAdvanceSearchCondition(occIDValue,occKeyWord,occOrgKey,companyKeyWord,companyOrgKey){return ValidateSaveCycleCondition(occIDValue,occKeyWord,occOrgKey,companyKeyWord,companyOrgKey);}function ValidateSaveCycleCondition(occIDValue,occKeyWord,orgKey,companyKeyWord,orgCompanyKey){occKeyWord=TrimStart(occKeyWord);occKeyWord=TrimEnd(occKeyWord);companyKeyWord=TrimStart(companyKeyWord);companyKeyWord=TrimEnd(companyKeyWord);var occKwCount=occKeyWord.length;var companyKwCount=companyKeyWord.length;if(occIDValue!=""){if((occKeyWord==""||occKeyWord==orgKey||occKwCount>=keyMinChar)&&(companyKeyWord==""||companyKeyWord==orgCompanyKey||companyKwCount>=keyMinChar))return true;else{var keyStr="";if(occKeyWord!=orgKey&&occKeyWord!=""&&occKwCount<keyMinChar)keyStr="有效的职位关键字";if(companyKeyWord!=orgCompanyKey&&companyKeyWord!=""&&companyKwCount<keyMinChar){if(keyStr!="")keyStr+="或公司关键字";else keyStr+="公司关键字";}alert("填写至少"+keyMinChar+"个字符的"+keyStr+"!");return false;}}else{if(((occKeyWord==""||occKeyWord==orgKey)||occKwCount<keyMinChar)&&((companyKeyWord==""||companyKeyWord==orgCompanyKey)||companyKwCount<keyMinChar)){alert("请选择\"职位类别\",或者填写有效的\"关键词\"进行搜索。");return false;}else{if((occKeyWord==""||occKeyWord==orgKey)&&companyKwCount<keyMinChar){alert("填写至少"+keyMinChar+"个字符的公司关键字!");return false;}if((companyKeyWord==""||companyKeyWord==orgCompanyKey)&&occKwCount<keyMinChar){alert("填写至少"+keyMinChar+"个字符的职位关键字!");return false;}return true;}}}function GetMouseXY_ForLayer(obj_div){x=document.body.scrollLeft+event.clientX;y=document.body.scrollTop+event.clientY;availWidth=parseInt(window.screen.availWidth);tblWidth=parseInt(obj_div.width);curWidth=x+tblWidth;if(curWidth>availWidth)x=x-(curWidth-availWidth);if((x-40)<document.body.scrollLeft)x=document.body.scrollLeft;else x=x-40;obj_div.style.top=y;obj_div.style.left=x;}function GetCenterXY_ForLayer(objdiv){x=document.body.scrollLeft;y=document.body.scrollTop;availWidth=parseInt(window.screen.availWidth);availHeight=parseInt(window.screen.availHeight);tblWidth=parseInt(objdiv.width);y=y+availHeight/4;x=(availWidth-tblWidth)/2;objdiv.style.top=y;objdiv.style.left=x;}function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')element=document.getElementById(element);if(arguments.length==1)return element;elements.push(element);}return elements;}function $E(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')element=document.createElement(element);if(arguments.length==1)return element;elements.push(element);}return elements;}var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}return returnValue;}};var Ajax=function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;};var request={QueryString:function(val){var uri=window.location.search;var re=new RegExp(""+val+"=([^&?]*)","ig");return((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):"");}};var requestFromStr={QueryString:function(Str,val){var uri=Str.substring(0,1)=="?"?Str:"?"+Str;var re=new RegExp("[&?]"+val+"=([^&?]*)","ig");return((uri.match(re))?(uri.match(re)[0].substr(val.length+2)):"");}};function showhide(ccname,par,mycss,qk){var ccname=document.getElementById(ccname);var qk=document.getElementById(qk);if(ccname.style.display==""||ccname.style.display=="block"){ccname.style.display="none";par.className="close";qk.style.display="none";}else{ccname.style.display="";par.className="open";qk.style.display="block";}}function getY(el){var y=0;for(var e=el;e;e=e.offsetParent)y+=e.offsetTop;for(e=el.parentNode;e&&e!=document.body;e=e.parentNode)if(e.scrollTop)y-=e.scrollTop;return y;}function getX(el){var x=0;while(el){x+=el.offsetLeft;el=el.offsetParent;}return x;}function UrlDecode(str){return escape(str).replace(/\+/g,"%2b");}function tips(id,str){var obj=document.getElementById(id);var x=getX(obj);var y=getY(obj);var l=x;var t=y;var popObj=document.getElementById("tips");if(popObj!=null){popObj.innerHTML="<div class=\"tipcon\">"+str+"</div>";popObj.style.display="inline";var menu_h=popObj.offsetHeight;t-=menu_h;popObj.style.left=l+"px";popObj.style.top=t+"px";}}function outtips(){document.getElementById("tips").style.display='none';}function login(cc){cc=document.getElementById(cc);if(cc.style.display=="none"){cc.style.display="";var h=document.location.href.toString();if(h.indexOf("SearchResult61.aspx")!=-1)h=h.substring(0,h.indexOf('?'))+"?"+urlKey;h=h.replace(/\?/g,"%3F").replace(/&/g,"%26");var url="http://my.chinahr.com/UserLoginSearchJob2.aspx?from="+h;if(typeof(appendRnd)!="undefined")url=appendRnd(url);document.getElementById("loginfr").src=url;}else{cc.style.display="none";}}function loginout(){var h=document.location.href.toString();h=h.replace(/\?/g,"%3F").replace(/&/g,"%26");var url="http://my.chinahr.com/logout.aspx?ReturnUrl="+h;if(typeof(appendRnd)!="undefined")url=appendRnd(url);document.location=url;}function UrlEncode(str){return escape(str).replace(/\+/g,"%2b");}function UrlDecode(str){return unescape(str).replace(/%2b/g,"+");}rnd.today=new Date();rnd.seed=rnd.today.getTime();function rnd(){rnd.seed=(rnd.seed*9301+49297)%233280;return rnd.seed/(233280.0);}function rand(number){return Math.ceil(rnd()*number);}function GetSubString(str,len){if(len=="undefined"){return str;}var newStr=new Array();var index=0;for(var i=0;i<=str.length-1;i++){var _str=str.substring(i,i+1);var code=escape(str.charAt(i));if((code.length>=4)&&(code<'%uFF60'||code>'%uFF9F')){index=index+2;}else{index=index+1;}if(index<=len){newStr.push(_str);}else{newStr.push("...");break;}}return newStr.join("");}Array.prototype.include=function(el){for(var i=0;i<this.length;i++){if(this[i]==el)return true;}return false;};function ChangeOverOutClass(parent,child,ifOver){var parOverClass="iptblk liesltblk liehover";var childOverClass="lieipt3 lieipthov";var parOutClass="iptblk liesltblk";var childOutClass="lieipt3";if(child==''){parOverClass="liesltblk4 liehover";parOutClass="liesltblk4";}if(ifOver){parent.className=parOverClass;if($(child)!=null)$(child).className=childOverClass;}else{parent.className=parOutClass;if($(child)!=null)$(child).className=childOutClass;}}function get36Length(str){var tmp=0;var len=0;var okLen=0;for(var i=0;i<36;i++){if(str.charCodeAt(i)>255)tmp+=2;else len+=1;okLen+=1;if(tmp+len==36){return(str.substring(0,okLen));break;}if(tmp+len>36){return(str.substring(0,okLen-1)+" ");break;}}}function Cacher(){this.count=0;}Cacher.prototype={insert:function(key,value){if(!this[key]){this[key]=value;this.count++;}},item:function(key){if(this[key])return this[key];else return null;},remove:function(key){if(this[key]){delete this[key];this.count--;}}};function ScriptLoader(){this.load=function(url){var scripts=document.getElementsByTagName("script");for(i=0;i<scripts.length;i++){if(scripts[i].src&&scripts[i].src.indexOf(url)!=-1){this.onSuccess();return;}}script=document.createElement("script");script.type="text/javascript";script.src=url;var head=document.getElementsByTagName("head")[0];head.appendChild(script);var self=this;script.onload=script.onreadystatechange=function(){if(this.readyState&&this.readyState=="loading")return;self.onSuccess();};script.onerror=function(){head.removeChild(script);self.onFailure();};};this.onSuccess=function(){};this.onFailure=function(){};}function HR_SaveAgent(){var flag=0;var obj=document.getElementById('HistoryRecord1_UL_HistoryList').all;for(var i=0;i<obj.length;i++){if(obj[i].tagName.toUpperCase()=="INPUT"){if(obj[i].type.toUpperCase()=="RADIO"&&obj[i].checked==true){var objUrl=obj[i].value;var intTemp=objUrl.toUpperCase().indexOf('OCCIDLIST=');var intTempP=objUrl.toUpperCase().indexOf('POSITIONNAME=');var intTempC=objUrl.toUpperCase().indexOf('COMPANYNAME=');var intTempP2=objUrl.indexOf('&',intTempP);var intTempC2=objUrl.indexOf('&',intTempC);var strTempP='';var strTempC='';if(intTempC!=-1){if(intTempC2==-1)strTempC=objUrl.substring(strTempC+12);else strTempC=objUrl.substring(strTempC+12,intTempC2);if(strTempC.length>0)flag=1;}if(intTempP!=-1){if(intTempP2==-1)strTempP=objUrl.substring(intTempP+13);else strTempP=objUrl.substring(intTempP+13,intTempP2);if(strTempP.length>0)flag=1;}if(strTempP.length==0&&strTempC.length==0){if(intTemp!=-1){var intTemp2=objUrl.indexOf('&',intTemp);if(intTemp2!=-1){if(intTemp+12<intTemp2){flag=1;window.open(MyUrl+'/JobAgent/JobAgentLogin.aspx?'+objUrl,"订阅职位搜索","top=150,left=200,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no");}else{flag=1;var isOK=confirm('保存搜索条件必须填写“职位类别”或2位关键字是否继续?');if(isOK){window.open('/JobAgentSubscibe.aspx?'+objUrl,"订阅职位搜索");}}}else{intTemp2=objUrl.length;if(intTemp+12<intTemp2){flag=1;window.open(MyUrl+'/JobAgent/JobAgentLogin.aspx?'+objUrl,"订阅职位搜索","top=150,left=200,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no");}else{flag=1;var isOK=confirm('保存搜索条件必须填写“职位类别”或2位关键字是否继续?');if(isOK){window.open('/JobAgentSubscibe.aspx?'+objUrl,"订阅职位搜索");}}}}else{flag=1;var isOK=confirm('保存搜索条件必须填写“职位类别”或2位关键字是否继续?');if(isOK){window.open('/AdvanceSearch.aspx?'+objUrl,"订阅职位搜索");}}}else{flag=1;window.open(MyUrl+'/JobAgent/JobAgentLogin.aspx?'+objUrl,"订阅职位搜索","top=150,left=200,menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no");}}}}if(flag==0)alert('请先选择搜索记录');}function HR_SearchJob(){var flag=0;var obj=document.getElementById('HistoryRecord1_UL_HistoryList').all;for(var i=0;i<obj.length;i++){if(obj[i].tagName.toUpperCase()=="INPUT"){if(obj[i].type.toUpperCase()=="RADIO"&&obj[i].checked==true){flag=1;var nUrl="SearchResult.aspx?"+obj[i].value.toLowerCase().replace(/&jtq=ignore/g,"").replace("prj="+requestFromStr.QueryString(obj[i].value.toLowerCase(),"prj"),'')+"&prj=hissj";nUrl=nUrl.replace("&jtr="+requestFromStr.QueryString(nUrl,"jtr"),"");nUrl=nUrl.replace("&jtrr="+requestFromStr.QueryString(nUrl,"jtrr"),"");window.open(nUrl,"","","");}}}if(flag==0)alert('请先选择搜索记录');}function HR_ShowLayer(Obj,info){var Obj_dv=$('dvHistorySearch');var Obj_td=$("Alert_HistoryRecord");Obj_td.innerHTML=info;GetMouseXY_ForLayer(Obj_dv);var ScreenWidth=parseInt(window.screen.availWidth);if(ScreenWidth>1024)ScreenWidth=1024
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -