YAHOO.util.Event.on(window,"load",init_list);function init_list(A){var B=new Counts();new Jobs("searchresults",B);new SaveSearch("f_save_search","l_save_search",B);new Filters(document.body,"c_filters","l_hide_filters","l_show_filters","l_more_filters");new RecentSearches("recent_searches");new EmailAlerts("create_alert_form","l_create_alert");new SelectDistance("f_select_distance");new HeaderLinks("c_site_links","c_header_search");try{if(cpc_get_ads){request_cpc_ads()}if(cpa_get_ads){request_cpa_ads()}}catch(A){}try{document.execCommand("BackgroundImageCache",false,true)}catch(A){}}function Jobs(A,B){this.container=YAHOO.util.Dom.get(A);if(!this.container){return }this.jobs={};this.monitor=null;this.panel=null;this.counts=B;this.use_tabs=false;this.init_jobs();this.init_monitor();this.init_panel()}Jobs.prototype.init_jobs=function(){var A=YAHOO.util.Dom.getElementsByClassName("result","LI",this.container);for(var B=0,F=A.length;B<F;B++){var C=A[B];var E=C.id;var D=C.getAttribute("rk");this.jobs[E]=new Job(E,D,C)}this.use_tabs=YAHOO.util.Dom.hasClass(this.container,"tabs");YAHOO.util.Event.on(this.container,"click",this.handle_click,this,true)};Jobs.prototype.init_monitor=function(){var A=document.createElement("DIV");this.container.appendChild(A);var B=YAHOO.util.Dom.getXY(A);this.monitor={node:A,xy:B};YAHOO.util.Event.on("content","click",this.handle_resize,this,true)};Jobs.prototype.init_panel=function(){this.panel=new JobsPanel()};Jobs.prototype.handle_click=function(E,D){var C=YAHOO.util.Event.getTarget(E);if(C.tagName!="A"){var G=3;while(C.tagName!="A"&&G--){C=C.parentNode}}if(C.tagName!="A"){return }if(YAHOO.util.Dom.hasClass(C,"who")){C=YAHOO.util.Dom.get(C.id.replace("who_more","who"));this.panel.get_who(E,C);return }if(C.id){var B=C.id.replace(/^l_(.*?)-((.|..)-)?(.*?)(-(.*)|$)/,"$2$4");var A=this.jobs[B]}else{var F=C;while(!YAHOO.util.Dom.hasClass(F,"result")&&F!=this.container){F=F.parentNode}if(!YAHOO.util.Dom.hasClass(F,"result")){return }var B=F.id;var A=this.jobs[B]}if(YAHOO.util.Dom.hasClass(C,"save")){this.save_job(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"block")){this.toggle_block(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"more")){this.toggle_more(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"view")){this.view_job(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"star")){this.rate_job(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"not_interested")){this.rate_job(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"clear")){this.clear_rating(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"notes")){this.save_comment(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"notes_clear")){this.clear_comment(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"notes_cancel")){this.cancel_comment(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"tab_myjobs")){this.load_my_jobs("saved",C)}else{if(YAHOO.util.Dom.hasClass(C,"tab_rating")){this.toggle_tab(A,"tab_rating")}else{if(YAHOO.util.Dom.hasClass(C,"tab_notes")){this.toggle_tab(A,"tab_notes")}else{if(YAHOO.util.Dom.hasClass(C,"map")){this.map_job(E,A)}else{if(YAHOO.util.Dom.hasClass(C,"remove")){this.remove_job(E,A)}}}}}}}}}}}}}}}};Jobs.prototype.handle_resize=function(C,B){if(!this.monitor){return }var A=YAHOO.util.Dom.getXY(this.monitor.node);if(A[0]!=this.monitor.xy[0]||A[1]!=this.monitor.xy[1]){this.panel.adjust_panel();this.monitor.xy=A}};Jobs.prototype.load_my_jobs=function(A,B){if(B&&B.tagName=="A"){B.href="/a/my-jobs/"+A}else{document.location="/a/my-jobs/"+A}return true};Jobs.prototype.refresh_page=function(){window.location.reload()};Jobs.prototype.toggle=function(B,A){if(B!="block"){YAHOO.util.Dom.removeClass(A.node,"block")}if(B!="more"){YAHOO.util.Dom.removeClass(A.node,"more")}return toggle(A.node,B)};Jobs.prototype.toggle_rate=function(C,B){var A=this.toggle("rate",B);YAHOO.util.Event.preventDefault(C)};Jobs.prototype.toggle_block=function(C,B){var A=this.toggle("block",B);YAHOO.util.Event.preventDefault(C)};Jobs.prototype.toggle_more=function(C,B){var A=this.toggle("more",B);YAHOO.util.Event.preventDefault(C)};Jobs.prototype.toggle_tab=function(B,A){if(A!="tab_rating"){YAHOO.util.Dom.removeClass(B.rate,"tab_rating")}if(A!="tab_notes"){YAHOO.util.Dom.removeClass(B.rate,"tab_notes")}return toggle(B.rate,A)};Jobs.prototype.view_job=function(B,A){if(!A.viewed){YAHOO.util.Dom.addClass(A.node,"viewed");if(this.counts){this.counts.update_count("viewed_jobs")}A.viewed=true}};Jobs.prototype.save_job=function(F,D){var E=YAHOO.util.Event.getTarget(F);if(D.saved){if(this.use_tabs){}else{return this.load_my_jobs("saved",E)}}else{YAHOO.util.Dom.addClass(D.node,"saved");var C=YAHOO.util.Event.getTarget(F);C.innerHTML="<span></span>";try{C.innerHTML+=sh_messages.job_saved}catch(F){C.innerHTML+=this.use_tabs?"Job Saved!":"Saved to My Jobs"}var B="/a/saved-jobs/save/"+D.rk;var A=YAHOO.util.Connect.asyncRequest("POST",B);this.set_rating(null,D);this.set_tab_rate(null,D);if(this.counts){this.counts.update_count("saved_jobs")}D.saved=true}YAHOO.util.Event.preventDefault(F)};Jobs.prototype.map_job=function(F,D){var E=YAHOO.util.Event.getTarget(F);if(D.mapped){return this.load_my_jobs("mapped",E)}else{YAHOO.util.Dom.addClass(D.node,"mapped");var C=YAHOO.util.Event.getTarget(F);try{C.innerHTML=sh_messages.job_mapped}catch(F){C.innerHTML="View Mapped Jobs"}var B="/a/mapped-jobs/add/"+D.rk;var A=YAHOO.util.Connect.asyncRequest("POST",B);if(this.counts){this.counts.update_count("mapped_jobs")}D.mapped=true}YAHOO.util.Event.preventDefault(F)};Jobs.prototype.rate_job=function(F,E){var D=YAHOO.util.Event.getTarget(F);var A=D.getAttribute("rating");var C="/a/saved-jobs/rate/"+E.rk;var G="rating="+A;var B=YAHOO.util.Connect.asyncRequest("POST",C,null,G);this.set_rating(A,E);this.set_tab_rate(A,E);E.rating=A;YAHOO.util.Event.preventDefault(F)};Jobs.prototype.clear_rating=function(E,D){var A=null;var C="/a/saved-jobs/save/"+D.rk;var B=YAHOO.util.Connect.asyncRequest("POST",C,null,null);this.set_rating(A,D);this.set_tab_rate(A,D);D.rating=A;YAHOO.util.Event.preventDefault(E)};Jobs.prototype.remove_job=function(D,C){var B="/a/saved-jobs/delete/"+C.rk;var A=YAHOO.util.Connect.asyncRequest("POST",B,{success:this.refresh_page},null,null);if(C.node.parentNode){C.node.parentNode.removeChild(C.node)}C.node=null;this.jobs[C.rk]=null;YAHOO.util.Event.preventDefault(D)};Jobs.prototype.save_comment=function(E,D){var A=D.note;var G=A.value;if(G!=D.note_value){var C="/a/saved-jobs/comment/"+D.rk;var F="comment="+encodeURIComponent(G);var B=YAHOO.util.Connect.asyncRequest("POST",C,null,F);D.note_value=G}if(D.note_anim){D.note_anim.animate()}this.set_tab_note(G,D);YAHOO.util.Event.preventDefault(E)};Jobs.prototype.clear_comment=function(B,A){A.note.value="";this.save_comment(B,A)};Jobs.prototype.cancel_comment=function(C,B){var A=B.note;var D=B.note_value;A.value=D;if(B.note_anim){B.note_anim.animate()}this.set_tab_note(D,B);YAHOO.util.Event.preventDefault(C)};Jobs.prototype.set_rating=function(B,C){if(B==null){B=-1}if(B==0){YAHOO.util.Dom.addClass(C.not,"on")}else{YAHOO.util.Dom.removeClass(C.not,"on")}for(var A=0,D=C.stars.length;A<D;A++){if(B>A){YAHOO.util.Dom.addClass(C.stars[A],"on")}else{YAHOO.util.Dom.removeClass(C.stars[A],"on")}}};Jobs.prototype.set_tab_rate=function(B,D){if(!this.use_tabs){return }var A=D.tabs.tab_rating;var C=A[0];var F=A[1];if(B==null){B=-1}try{C.innerHTML=(B>0)?sh_messages.job_rated:sh_messages.job_rate}catch(E){C.innerHTML=(B>0)?"rated:":"rate job"}F.innerHTML=(B>0)?B+"<b><i></i></b>":"";YAHOO.util.Dom.removeClass(D.rate,"tab_rating")};Jobs.prototype.set_tab_note=function(G,D){if(!this.use_tabs){return }var B=D.tabs.tab_notes;var C=B[0];var F=B[1];var A=10;if(G.length>A){G=G.substring(0,A)+"..."}G=encode_amp(G);try{C.innerHTML=G.length?sh_messages.job_edit_notes:sh_messages.job_add_notes}catch(E){C.innerHTML=G.length?"edit notes:":"add notes"}F.innerHTML=G.length?G:"";YAHOO.util.Dom.removeClass(D.rate,"tab_notes")};function Job(C,B,A){this.id=C;this.rk=B;this.node=A;this.saved=null;this.viewed=null;this.mapped=null;this.blocked=null;this.rating=null;this.rate=null;this.tabs={};this.stars=[];this.not=null;this.note=null;this.note_anim=null;this.note_value=null;this.init_job();this.init_rate();this.init_tabs()}Job.prototype.init_job=function(){this.saved=YAHOO.util.Dom.hasClass(this.node,"saved");this.viewed=YAHOO.util.Dom.hasClass(this.node,"viewed");this.mapped=YAHOO.util.Dom.hasClass(this.node,"mapped");this.blocked=YAHOO.util.Dom.hasClass(this.node,"blocked")};Job.prototype.init_rate=function(){var A=YAHOO.util.Dom.get("c_rate-"+this.id);if(!A){return }this.rate=A;this.stars=YAHOO.util.Dom.getElementsByClassName("star","A",this.rate);this.not=YAHOO.util.Dom.getElementsByClassName("not_interested","A",this.rate).pop();this.note=YAHOO.util.Dom.getElementsByClassName("note_box","TEXTAREA",this.rate).pop();this.note_anim=YAHOO.util.ColorAnim?new YAHOO.util.ColorAnim(this.note,{backgroundColor:{from:"#FFFF99",to:"#FFFFFF"}}):null;this.note_value=this.note.value;YAHOO.util.Event.on(this.stars,"mouseover",this.mouseover_star,this,true);YAHOO.util.Event.on(this.stars,"mouseout",this.mouseout_star,this,true)};Job.prototype.init_tabs=function(){var F=YAHOO.util.Dom.getElementsByClassName("tabs","DIV",this.rate).pop();if(!F){return }var C=F.getElementsByTagName("LI");for(var B=0,H=C.length;B<H;B++){var D=C[B];var A=D.className;var E=D.getElementsByTagName("A")[0];var G=D.getElementsByTagName("SPAN")[0];this.tabs[A]=[E,G]}};Job.prototype.mouseover_star=function(E,D){var C=YAHOO.util.Event.getTarget(E);var B=C.getAttribute("rating");for(var A=0;A<B;A++){YAHOO.util.Dom.addClass(D.stars[A],"hover")}};Job.prototype.mouseout_star=function(E,D){var C=YAHOO.util.Event.getTarget(E);var B=C.getAttribute("rating");for(var A=0;A<B;A++){YAHOO.util.Dom.removeClass(D.stars[A],"hover")}};function JobsLite(A,B){this.container=YAHOO.util.Dom.get(A);if(!this.container){return }this.jobs={};this.counts=B;this.init_jobs()}JobsLite.prototype.view_job=Jobs.prototype.view_job;JobsLite.prototype.init_jobs=Jobs.prototype.init_jobs;JobsLite.prototype.handle_click=function(E,D){var C=YAHOO.util.Event.getTarget(E);if(C.tagName!="A"){var G=3;while(C.tagName!="A"&&G--){C=C.parentNode}}if(C.tagName!="A"){return }if(C.id){var B=C.id.replace(/^l_(.*?)-((.|..)-)?(.*?)(-(.*)|$)/,"$2$4");var A=this.jobs[B]}else{var F=C;while(!YAHOO.util.Dom.hasClass(F,"result")&&F!=this.container){F=F.parentNode}if(!YAHOO.util.Dom.hasClass(F,"result")){return }var B=F.id;var A=this.jobs[B]}if(YAHOO.util.Dom.hasClass(C,"view")){this.view_job(E,A)}};function JobsPanel(){this.id="c_panel";this.obj=null;this.cache={};this.type=null;this.context=null;try{this.close=sh_messages.close;this.loading=sh_messages.job_loading_connections}catch(A){this.close="close";this.loading="Please wait, loading connections..."}}JobsPanel.prototype.init_panel=function(){var C=this.id;var A={visible:false,monitorresize:false,fixedcenter:false,close:true,draggable:false,underlay:"none",modal:false};var B=new YAHOO.util.KeyListener(document,{keys:27},{fn:this.hide_panel,scope:this,correctScope:true});this.obj=new YAHOO.widget.Panel(C,A);this.obj.cfg.queueProperty("keylisteners",B);this.obj.render(document.body);this.obj.close.innerHTML="<a><u>"+this.close+"</u> [ x ]</a>";YAHOO.util.Event.on(this.obj.close,"click",this.hide_panel,this,true)};JobsPanel.prototype.show_panel=function(A){if(!this.obj){this.init_panel()}this.obj.cfg.setProperty("context",this.context);this.obj.setBody(A.body);this.obj.setHeader(A.header);this.obj.setFooter(A.footer);this.obj.render(document.body);YAHOO.util.Dom.addClass(this.obj.id,this.type);this.obj.show()};JobsPanel.prototype.hide_panel=function(){if(!this.obj){return }this.obj.hide();YAHOO.util.Dom.removeClass(this.obj.id,this.type);this.type=null;this.context=null};JobsPanel.prototype.adjust_panel=function(){if(!this.obj||!this.context){return }this.obj.cfg.setProperty("context",this.context);this.obj.render(document.body)};JobsPanel.prototype.get_who=function(F,E){if(this.context&&E==this.context[0]){this.hide_panel()}else{this.type="who";this.context=[E,"tl","bl"];var A=E.id.replace(/^l_(who)-((.|..)-)?(.*?)(-(.*)|$)/,"$6");var D=this.get_cache(A);this.show_panel({body:"<p>"+this.loading+"</p>",header:"&nbsp;",footer:""});if(D){this.show_panel(D)}else{var C="/a/linkedin/who/"+A;var G="f="+encodeURIComponent(document.location);var B=YAHOO.util.Connect.asyncRequest("POST",C,{scope:this,success:this.show_who,argument:{key:A}},G)}}YAHOO.util.Event.stopPropagation(F)};JobsPanel.prototype.show_who=function(o){if(o.responseText==""){var response=false}else{eval("var response = "+o.responseText)}if(!response){document.location="/a/linkedin/login/who?f="+encodeURIComponent(document.location)}else{var body="";if(response.connections&&response.connections.length){body+="<ul>";for(var i=0,n=response.connections.length;i<n;i++){body+='<li class="connection"><div class="degree_'+response.connections[i].degree+'"></div><h5><a href="'+response.connections[i].url+'" target="_blank">'+response.connections[i].name+"</a></h5><p>"+response.connections[i].headline+"</p><p>"+response.connections[i].location+"</p></li>"}body+="</ul>";body+='<p class="see_all">'+response.see_all+"</p>"}else{body+="<p>"+response.error+"</p>"}var header=response.title?"<h4>"+response.title+"</h4>":"&nbsp;";var footer="";if(response.powered_by){footer+='<p class="powered_by">'+response.powered_by+"</p>"}if(response.not_you){footer+='<p class="not_you">'+response.not_you+"</p>"}if(response.sign_up){footer+='<p class="sign_up">'+response.sign_up+"</p>"}var data={body:body,header:header,footer:footer};if(!response.retry){this.set_cache(o.argument.key,data)}this.show_panel(data)}};JobsPanel.prototype.get_cache=function(A){return this.cache[A]?this.cache[A]:null};JobsPanel.prototype.set_cache=function(A,B){this.cache[A]=B};function Filters(D,C,B,E,A){this.container=YAHOO.util.Dom.get(D);this.panel=YAHOO.util.Dom.get(C);this.filters={};if(!this.container||!this.panel){return }this.hide_link=YAHOO.util.Dom.get(B);this.show_link=YAHOO.util.Dom.get(E);this.more_link=YAHOO.util.Dom.get(A);this.cookie=new FiltersCookie();this.see_more=sh_messages.filters_see_more;this.see_less=sh_messages.filters_see_less;this.init_panel();this.init_filters()}Filters.prototype.init_panel=function(){YAHOO.util.Event.on(this.hide_link,"click",this.toggle_panel,this,true);YAHOO.util.Event.on(this.show_link,"click",this.toggle_panel,this,true);YAHOO.util.Event.on(this.more_link,"click",this.toggle_more,this,true);if(self.screen.availWidth<=800&&this.cookie.get_cookie("fp")==null){YAHOO.util.Dom.addClass(this.container,"hide_filters")}};Filters.prototype.init_filters=function(){var A=YAHOO.util.Dom.getElementsByClassName("filter","LI",this.panel);for(var B=0,E=A.length;B<E;B++){var C=A[B];var D=C.id.replace(/^f-(.*)$/,"$1");this.filters[D]=new Filter(D,C)}YAHOO.util.Event.on(this.panel,"click",this.handle_click,this,true)};Filters.prototype.handle_click=function(E,D){var C=YAHOO.util.Event.getTarget(E);var B=null;while(C!=this.panel){if(C.tagName=="A"){B=C.parentNode.className}else{if(YAHOO.util.Dom.hasClass(C,"filter")){break}}C=C.parentNode}if(C==this.panel){return }var F=C.id.replace(/^f-(.*)$/,"$1");var A=this.filters[F];if(!A){return }if(B=="see_filter"){A.collapse_filter(E,D)}else{if(B=="see_more"){A.expand_filter(E,D)}}};Filters.prototype.toggle_panel=function(C,B){var A=toggle(this.container,"hide_filters");this.set_cookie("fp",!A)};Filters.prototype.toggle_more=function(D,C){var B=toggle(this.panel,"more_filters");var A=YAHOO.util.Event.getTarget(D);A.innerHTML=B?this.see_less:this.see_more;this.set_cookie("fm",B)};Filters.prototype.set_cookie=function(B,A){if(!this.cookie){return }this.cookie.set_cookie(B,A?"1":"0")};function Filter(B,A){this.id=B;this.node=A;this.state=null;this.collapser=null;this.expander=null;this.cookie=new FiltersCookie();this._collapsed_state="0";this._expanded_state="1";this._normal_state="2";if(YAHOO.util.Dom.hasClass(this.node,"expanded_filter")){this.state=this._expanded_state}else{if(YAHOO.util.Dom.hasClass(this.node,"collapsed_filter")){this.state=this._collapsed_state}else{this.state=this._normal_state}}}Filter.prototype.init_filter=function(){var C=this.node.getElementsByTagName("H4");if(C.length){this.collapser=C[0]}var A=YAHOO.util.Dom.getElementsByClassName("see","LI",this.node);var B=A.length?A[0].getElementsByTagName("A"):null;if(B&&B.length){this.expander=B[0]}if(this.collapser){YAHOO.util.Event.on(this.collapser,"click",this.collapse_filter,this,true)}if(this.expander){YAHOO.util.Event.on(this.expander,"click",this.expand_filter,this,true)}};Filter.prototype.collapse_filter=function(C,B){var A=toggle(this.node,"collapsed_filter");YAHOO.util.Dom.removeClass(this.node,"expanded_filter");this.state=A?this._collapsed_state:this._normal_state;this.set_cookie()};Filter.prototype.expand_filter=function(C,B){var A=toggle(this.node,"expanded_filter");this.state=A?this._expanded_state:this._normal_state;this.set_cookie()};Filter.prototype.set_cookie=function(){if(!this.cookie){return }var A=this.cookie.get_cookie_values("fs");A[this.id]=this.state;this.cookie.set_cookie_values("fs",A)};function FiltersCookie(){this.obj=new WebAppCookie("jobs",30);this._s="+";this._j="-"}FiltersCookie.prototype.get_cookie=function(A){return this.obj.get_cookie(A)};FiltersCookie.prototype.set_cookie=function(A,B){this.obj.set_cookie(A,B,this.obj.get_expiration_days())};FiltersCookie.prototype.get_cookie_values=function(A){return this.string_to_values(this.obj.get_cookie(A))};FiltersCookie.prototype.set_cookie_values=function(B,A){this.set_cookie(B,this.values_to_string(A))};FiltersCookie.prototype.string_to_values=function(E){var D=E?E.split(this._s):[];var C={};for(var B=0,H=D.length;B<H;B++){var F=D[B].split(this._j);if(F.length==2){var A=F[0];var G=F[1];C[A]=G}}return C};FiltersCookie.prototype.values_to_string=function(C){var B=[];for(var A in C){var E=C[A];if(E!=null){var D=A+this._j+E;B.push(D)}}return B.join(this._s)};FiltersCookie.prototype.clear_cookie=function(A){this.obj.clear_cookie(A)};function RecentSearches(A){this.lists=[];this.init_lists(A)}RecentSearches.prototype.init_lists=function(C){var A=YAHOO.util.Dom.getElementsByClassName(C,"DIV","content");for(var B=0,E=A.length;B<E;B++){var D=new RecentSearchList(A[B]);this.lists.push(D);YAHOO.util.Event.on(D.clear,"click",this.request_clear,this,true)}};RecentSearches.prototype.request_clear=function(D,C){var B="/a/recent-searches/clear";var E="f=/";var A=YAHOO.util.Connect.asyncRequest("POST",B,{scope:this,success:this.clear_lists,failure:this.clear_lists},E);YAHOO.util.Event.preventDefault(D)};RecentSearches.prototype.clear_lists=function(B){for(var A=0,C=this.lists.length;A<C;A++){this.lists[A].clear_list()}this.lists=[]};function RecentSearchList(A){this.node=A;this.list=null;this.clear=null;this.init_list()}RecentSearchList.prototype.init_list=function(){var C=this.node.getElementsByTagName("UL");if(C&&C.length){this.list=C[0]}var A=YAHOO.util.Dom.getElementsByClassName("clear","LI",this.node);var B=A.length?A[0].getElementsByTagName("A"):null;if(B&&B.length){this.clear=B[0]}};RecentSearchList.prototype.clear_list=function(E,D){var A=this.list.getElementsByTagName("LI");for(var B=A.length-1;B>=0;B--){var C=A[B];this.list.removeChild(C);C=null}this.node.parentNode.removeChild(this.node);this.list.parentNode.removeChild(this.list);this.clear.parentNode.removeChild(this.clear);this.node=null;this.list=null;this.clear=null};function EmailAlerts(A,C){this.container=null;this.forms=[];this.handle=YAHOO.util.Dom.get(C);this.validator=new ValidatorClass();try{this.default_email=sh_messages.email_alert_email_value;this.success_message=sh_messages.email_alert_success;this.error_message=sh_messages.email_alert_error}catch(B){this.default_email="enter email address";this.success_message="Alert created!";this.error_message="Please enter a valid email address!"}this.init(A)}EmailAlerts.prototype.init=function(A){if(this.handle){this.container=this.handle.parentNode.parentNode}if(this.handle){YAHOO.util.Event.on(this.handle,"click",this.toggle_form,this,true)}this.forms=YAHOO.util.Dom.getElementsByClassName(A,"FORM","content");YAHOO.util.Event.on(this.forms,"click",this.handle_click,this,true);YAHOO.util.Event.on(this.forms,"submit",this.create_alert,this,true);for(var C=0,E=this.forms.length;C<E;C++){var D=this.forms[C];var B=D.e;if(B.value.indexOf("@")==-1){D.e.value=this.default_email}}};EmailAlerts.prototype.toggle_form=function(B,A){toggle(this.container,"email_alert_open");YAHOO.util.Event.preventDefault(B)};EmailAlerts.prototype.handle_click=function(C,B){var A=YAHOO.util.Event.getTarget(C);if(A.tagName=="INPUT"&&A.name=="e"){this.clear_email(C,B)}};EmailAlerts.prototype.clear_email=function(D,C){var B=YAHOO.util.Event.getTarget(D);var A=B.value;if(A==this.default_email){B.value=""}};EmailAlerts.prototype.create_alert=function(F,E){var D=YAHOO.util.Event.getTarget(F);var C=(D.tagName=="INPUT")?D.form:D;var B=C.e.value.replace(/(^\s*|\s*$)/g,"");if(B==this.default_email){B=""}try{var A=this.validator.validate_email(B)}catch(F){var A=B==""}if(A){var G={argument:{form:C}};this.alert_error(G)}else{this.create_alert_request(C,B)}YAHOO.util.Event.preventDefault(F);return false};EmailAlerts.prototype.create_alert_request=function(D,A){var C="/a/email-alerts/create/"+D.action.replace(/^.*?\/a\/.*?\/.*?\//,"");var E="email="+encodeURIComponent(A);var B=YAHOO.util.Connect.asyncRequest("POST",C,{scope:this,success:this.alert_created,failure:this.alert_error,argument:{form:D}},E);return B};EmailAlerts.prototype.alert_created=function(o){try{eval("var r = "+o.responseText)}catch(e){var r=false}if(!r||!r.ret_id){this.alert_error(o);return }for(var i=0,n=this.forms.length;i<n;i++){var form=this.forms[i];var node=form.parentNode;var msg=document.createElement("P");msg.className="success";msg.innerHTML='<span class="email"></span>';msg.innerHTML+=this.success_message;node.replaceChild(msg,form);this.forms[i]=null}};EmailAlerts.prototype.alert_error=function(D){var B=D.argument.form;var A=B.parentNode;if(B.lastChild.className=="error"){return }var C=document.createElement("P");C.className="error";C.innerHTML=this.error_message;B.appendChild(C)};function SelectDistance(A){var B=YAHOO.util.Dom.get(A);if(!B){return }YAHOO.util.Event.on(B.mi,"change",function(C){this.form.submit()})}function HeaderLinks(B,A){this.container=YAHOO.util.Dom.get(B);this.search_form=document.forms.search;if(!this.container||!this.search_form){return }YAHOO.util.Event.on(this.container,"mousedown",this.handle_click,this,true)}HeaderLinks.prototype.handle_click=function(E,D){var C=YAHOO.util.Event.getTarget(E);if(C.tagName!="A"){return }var B=this.search_form.q.value;var A=this.search_form.l.value;if(YAHOO.util.Dom.hasClass(C,"local")){if(A){C.href="/a/local-jobs/city/l-"+encodeURIComponent(A)}}else{if(YAHOO.util.Dom.hasClass(C,"salaries")){if(B){C.href="/a/salary/search/q-"+encodeURIComponent(B)}else{if(A){C.href="/a/salary/search/l-"+encodeURIComponent(A)}}}else{if(YAHOO.util.Dom.hasClass(C,"trends")){if(B){C.href="/a/jobtrends/trend/q-"+encodeURIComponent(B)}else{if(A){C.href="/a/jobtrends/trend/q-"+encodeURIComponent(A)}}}}}return true};function SaveSearch(B,A,C){this.container=null;this.form=YAHOO.util.Dom.get(B);this.name=null;this.handle=YAHOO.util.Dom.get(A);if(!this.form||!this.handle){return }this.counts=C;this.default_name=sh_messages.save_search_name_value;this.success_message=sh_messages.save_search_success;this.init()}SaveSearch.prototype.init=function(){this.container=this.handle.parentNode.parentNode;YAHOO.util.Event.on(this.container,"click",this.handle_click,this,true);YAHOO.util.Event.on(this.form,"submit",this.save_search,this,true);this.name=this.form.name;this.name.value=this.default_name};SaveSearch.prototype.handle_click=function(D,C){var B=YAHOO.util.Event.getTarget(D);if(B.tagName=="INPUT"&&B.name=="name"){var A=this.name.value;if(A==this.default_name){this.name.value=""}}else{if(B.className=="save"){this.toggle_form(D,C)}else{if(B.className=="cancel"){this.toggle_form();this.name.value=this.default_name}}}};SaveSearch.prototype.toggle_form=function(B,A){toggle(this.container,"save_search_open")};SaveSearch.prototype.reset_form=function(B,A){this.toggle_form();this.name.value=this.default_name};SaveSearch.prototype.clear_name=function(C,B){var A=this.name.value;if(A==this.default_name){this.name.value=""}};SaveSearch.prototype.save_search=function(D,C){var B=this.form;var A=this.name.value.replace(/(^\s*|\s*$)/g,"");if(A==this.default_name){A=""}this.save_search_request(B,A);YAHOO.util.Event.preventDefault(D);return false};SaveSearch.prototype.save_search_request=function(D,A){var C=D?D.action:null;var E=A?"name="+encodeURIComponent(A):null;var B=YAHOO.util.Connect.asyncRequest("POST",C,{scope:this,success:this.search_saved,failure:this.save_error},E);return B};SaveSearch.prototype.search_saved=function(o){try{eval("var r = "+o.responseText)}catch(e){var r=false}if(!r||!r.ret_id){this.save_error(o);return }this.toggle_form();YAHOO.util.Event.removeListener(this.container,"click",this.handle_click);this.handle.className="saved";this.handle.innerHTML=this.success_message;if(this.counts){this.counts.update_count("saved_searches")}};SaveSearch.prototype.save_error=function(A){};function Counts(){this.saved_jobs=YAHOO.util.Dom.get("n_user_saved_jobs");this.viewed_jobs=YAHOO.util.Dom.get("n_user_viewed_jobs");this.saved_searches=YAHOO.util.Dom.get("n_user_saved_searches")}Counts.prototype.update_count=function(B,C){var D=this[B];if(!D){return }var A=D.innerHTML;if(!C){C=parseInt(A.match(/\d+/).pop())+1}if(C>0&&this.check_max(B,C)){YAHOO.util.Dom.removeClass(D,"off");D.innerHTML=A.replace(/(\d+)/,C)}};Counts.prototype.check_max=function(A,B){if(A=="viewed_jobs"&&B>25){return false}if(A=="saved_jobs"&&B>150){return false}if(A=="saved_searches"&&B>10){return false}return true};function toggle(B,A){var C=YAHOO.util.Dom.hasClass(B,A);if(C){YAHOO.util.Dom.removeClass(B,A)}else{YAHOO.util.Dom.addClass(B,A)}return !C}function encode_amp(A){if(A.replace){A=A.replace(/&/g,"&amp;");A=A.replace(/</g,"&lt;");A=A.replace(/>/g,"&gt;")}return A}function sh_ad_request_done(A,B){new SponsoredLinks(A,"sh","c_sponsored_links")}function google_ad_request_done(A){new SponsoredLinks(A,"google","c_google_ads")}function google_afs_request_done(D){var B=[];var A=[];var E=[];while(D.length){var C=D.shift();if(C.type=="text/wide"){A.push(C)}else{if(C.type=="text/narrow"){E.push(C)}}}if(A.length&&sh_afs_top){B=A.splice(0,sh_afs_top)}if(B.length){new SponsoredLinks(B,"google","c_google_ads_top",{classname:"google_ads_top",heading_text:sh_afs_heading,highlight:sh_ads_highlight,track_unit:"top"})}if(E.length){new SponsoredLinks(E,"google","c_google_ads",{classname:"google_ads_rail",heading_text:sh_afs_heading,highlight:sh_ads_highlight,track_unit:"right"})}if(A.length){new SponsoredLinks(A,"google","c_google_ads_bottom",{classname:"google_ads_bottom",heading_text:sh_afs_heading,highlight:sh_ads_highlight,track_unit:"bottom"})}}function request_cpc_ads(){var B=cpc_requrl+"/ads/json_feed_fast2.php?p_id="+cpc_p_id+"&ad_count="+cpc_ad_count+"&uip="+cpc_uip+"&channel="+cpc_channel+"&limit="+cpc_limit+"&doc_offset="+cpc_doc_offset+"&keyword="+cpc_keyword+"&region="+cpc_region+"&adType=CPC";var A=new AdRequest(B,"cpc",true)}function request_cpa_ads(){var B=cpa_requrl+"/ads/json_feed_fast2.php?p_id="+cpa_p_id+"&ad_count="+cpa_ad_count+"&uip="+cpa_uip+"&channel="+cpa_channel+"&limit="+cpa_limit+"&doc_offset="+cpa_doc_offset+"&keyword="+cpa_keyword+"&region="+cpa_region+"&adType=CPA";var A=new AdRequest(B,"cpa",true)}function jsonStrFromAdserver(s,ad_type){var result=s?eval(s):null;sh_ad_request_done(result,ad_type)}function AdRequest(A,C,B){this.url=A;this.type=C;this.nocache=B?"&nocache="+(new Date()).getTime():"";this.script=null;this.create_script();this.add_script()}AdRequest.prototype.create_script=function(){var A=document.createElement("SCRIPT");A.setAttribute("type","text/javascript");A.setAttribute("src",this.url+this.nocache);this.script=A};AdRequest.prototype.add_script=function(){var A=document.getElementsByTagName("HEAD");if(A.length&&this.script){A[0].appendChild(this.script)}};AdRequest.prototype.remove_script=function(){var A=document.getElementsByTagName("HEAD");if(A.length&&this.script){A.removeChild(this.script)}};function SponsoredLinks(result,provider,node,properties){this.result=result;this.provider=provider;this.node=document.getElementById(node);this.properties=properties?properties:{};this.ads=[];if(!this.result||!this.node){return }this.set_provider_properties();eval("this.ads = this."+this.properties.process_ads+"()");if(this.properties.highlight){this.ads=this.highlight_ads()}if(this.ads.length){this.render_node();this.render_heading();this.render_ads()}else{var parent=this.node.parentNode;parent.removeChild(this.node);this.node=null}}SponsoredLinks.prototype.set_provider_properties=function(){var B={};if(this.provider=="google"){B={process_ads:"process_google_ads",heading_text:"Ads by Google",heading_url:"http://services.google.com/feedback/online_hws_feedback",new_window:false,highlight:false,track_click:"sh_view_afs",track_unit:"right"}}else{if(this.provider=="sh"){B={process_ads:"process_sh_ads",heading_text:"Sponsored Links",heading_url:"http://www.simplyhired.lan/a/advertiser-solutions/sponsored-links",new_window:true,highlight:true}}}for(var A in B){if(this.properties[A]==undefined){this.properties[A]=B[A]}}};SponsoredLinks.prototype.process_sh_ads=function(){var E=[];var G=this.result.listing?this.result.listing:[];for(var F=0,D=G.length;F<D;F++){var B=G[F];var C=B.uri;var I=B.heading;var H=B.description;var A=B.url;E.push({heading:I,description:H,source:A,url:C})}return E};SponsoredLinks.prototype.process_google_ads=function(){var D=[];for(var C=0,H=this.result.length;C<H;C++){var A=this.result[C];var B=A.url;var G=A.line1;var E=A.line3?A.line2+" "+A.line3:A.line2;var F=A.visible_url;D.push({heading:G,description:E,source:F,url:B})}return D};SponsoredLinks.prototype.highlight_ads=function(){var A=new Highlight();var C=A.parse_keywords(A.get_search_string());var E=[];for(var B=0,F=this.ads.length;B<F;B++){var D=this.ads[B];D.heading=A.highlight_keywords(D.heading,C);D.description=A.highlight_keywords(D.description,C);D.source=A.highlight_keywords(D.source,C);E.push(D)}return E};SponsoredLinks.prototype.render_node=function(){if(this.properties.classname){this.node.className+=" "+this.properties.classname}};SponsoredLinks.prototype.render_heading=function(){if(this.node.getElementsByTagName("H4").length){return }if(this.properties.heading_text){var A=document.createElement("H4");A.innerHTML=this.properties.heading_url?'<a href="'+this.properties.heading_url+'">'+this.properties.heading_text+"</a>":this.properties.heading_text;this.node.appendChild(A)}};SponsoredLinks.prototype.render_ads=function(){var F=document.createElement("UL");F.className="_"+this.ads.length;this.node.appendChild(F);for(var D=0,C=this.ads.length;D<C;D++){var I=this.ads[D];var H=document.createElement("LI");var A=' href="'+I.url+'"';var E=this.properties.new_window?' target="_blank"':"";var G=" onmouseover=\"window.status='"+I.source+"';return true;\" onmouseout=\"window.status='';\"";var B=this.properties.track_click?' onmousedown="'+this.properties.track_click+"("+D+",'"+this.properties.track_unit+"')\"":"";H.innerHTML="";H.innerHTML+='<h5 class="title"><a'+A+E+G+B+">"+I.heading+"</a></h5>";H.innerHTML+='<p class="text">'+I.description+"</p>";H.innerHTML+='<p class="site"><a'+A+E+G+B+">"+I.source+"</a></p>";F.appendChild(H)}};function Highlight(){}Highlight.prototype.get_search_string=function(){var C="";var B=YAHOO.util.Dom.get("f_keywords");var A=YAHOO.util.Dom.get("f_location");if(B){C+=B.value}if(A){C+=" "+A.value}return C};Highlight.prototype.highlight_keywords=function(E,A,C){for(var B in A){var D=new RegExp("(\\b"+A[B]+"\\b)","gi");E=E.replace(D,"<strong"+(C?' class="'+C+'"':"")+">$1</strong>")}return E};Highlight.prototype.clean_keywords=function(A){A=A.replace(/\s+/g," ");A=A.replace(/^\s+|\s+$/g,"");A=A.replace(/(^|\W)\w+\s*:\s*\(?(.+?)\)?/,"$2");A=A.replace(/(\^|\$|\*|\+|\?|\=|\!|\:|\||\\|\/|\(|\)|\[|\]|\{|\})/g,"\\$1");return A};Highlight.prototype.parse_keywords=function(A){var C=new Array();A=this.clean_keywords(A);var D=new Parser();D.init(A);while(D.has_token()){var B=D.next_token();if(B.length>0){C.push(B)}}return C};function Parser(){var A}Parser.prototype.init=function(A){this.raw_string=A};Parser.prototype.next_token=function(){var A=this.raw_string.indexOf('"');var B;if(A==0){A=this.raw_string.indexOf('"',1)+1}else{A=this.raw_string.indexOf(" ")}if(A>-1){B=this.raw_string.substr(0,A)}else{B=this.raw_string;this.raw_string=""}this.raw_string=this.raw_string.substr(A+1);if(/^AND$|^OR$/.exec(B)){B=this.next_token()}else{if(/\bNOT\b/.exec(B)){this.next_token();B=""}else{if(/^".+?"$/.exec(B)){B=B.replace(/^"(.+?)"$/,"$1")}else{if(/^\W+$/.exec(B)){B=""}else{if(/^\W*.+?\W*$/.exec(B)){B=B.replace(/^\W*(.+?)\W*$/,"$1")}}}}}return B};Parser.prototype.has_token=function(){return this.raw_string.length>0};function ValidatorClass(){this.email_max=256;this.email_regex=/^[a-z0-9\-\_\+]+(\.[a-z0-9\-\_\+]+)*\@(([a-z0-9\-\_\+]+(\.[a-z0-9\-\_\+]+)*){2,}\.[a-z]{2,}|([0-9]+\.){3}[0-9]+)$/i;this.trim=function(A){return A.replace?A.replace(/^\s+/g,"").replace(/\s+$/g,""):A}}ValidatorClass.prototype.validate_email=function(A){if(A==""){return"blank-email"}else{if(A.length>this.email_max){return"long-email"}else{if(A.search(this.email_regex)==-1){return"invalid-email"}}}return false};function WebAppCookie(B,A){this.app=B;this.exp=A;this.escape=true;this.path="/";this.domain=""}WebAppCookie.prototype.get_cookie=function(D,A){var E=document.cookie.split(/;\s*/);for(var C=0,G=E.length;C<G;C++){var B=E[C].split("=");if(B[0]==this.app+"_"+D){var F=B[1];if(this.escape){F=unescape(F)}return F}}return null};WebAppCookie.prototype.set_cookie=function(C,D,A){if(this.escape){D=escape(D)}var B=[];B.push(this.app+"_"+C+"="+D);B.push("expires="+A);if(this.path){B.push("path="+this.path)}if(this.domain){B.push("domain="+this.domain)}document.cookie=B.join("; ")};WebAppCookie.prototype.clear_cookie=function(B){var A=[];A.push(this.app+"_"+B+"=");A.push("expires=Thu, 01-Jan-70 00:00:01 GMT");A.push("path="+this.path);A.push("domain="+this.domain);document.cookie=A.join("; ")};WebAppCookie.prototype.get_expiration_days=function(){var A=new Date();A.setDate(A.getDate()+this.exp);return A.toGMTString()};