var $j=jQuery.noConflict();function init(){tabs.init();jt.populate();var swfVersionStr="10.0.0";var xiSwfUrlStr="/map/playerProductInstall.swf";var flashvars={};var params={};params.quality="high";params.bgcolor="#003d79";params.allowscriptaccess="sameDomain";params.allowfullscreen="false";var attributes={};attributes.id="Main";attributes.name="Main";attributes.align="middle";swfobject.embedSWF(
"/map/Main.swf","mapContainer",
"980","500",
swfVersionStr,xiSwfUrlStr,
flashvars,params,attributes
);swfobject.createCSS("#mapContainer","display:block;text-align:left;");}
var jt=function(){return{getParameterByName:function(name){var match=RegExp('[?&]'+name+'=([^&]*)').exec(window.location.search);return match && decodeURIComponent(match[1].replace(/\+/g,' '));},populate:function(locationObjId,jobtypeObjId){if(locationObjId==null){locationObjId="campuses";}if(jobtypeObjId==null){jobtypeObjId="jobtypes";}var locationId=$F(locationObjId);if(locationId==""){$j('#'+jobtypeObjId).find('option').remove().end().append('<option value="">Select a Location</option>').val('');return;}$j('#'+jobtypeObjId).find('option').remove().end().append('<option value="">Loading...</option>').val('');var jts=$(jobtypeObjId);$j.ajax({type:"POST",url:"/ajaxpro/HealthCommLLC.com.rightjobonline.hca.JobSearch,HealthCommLLC.com.rightjobonline.hca.ashx",data:'{"locationId":'+locationId+'}',contentType:"application/json;charset=utf-8",dataType:"json",global:false,timeout:1000*60,beforeSend:function(xhr){xhr.setRequestHeader("X-AjaxPro-Method","GetJobsTypesForLocation");},success:function(response,textStatus){var o=response;if(typeof(o.error)=="object"){alert("error - "+o.error.Message);return;}o=o.value;jts.options.length=0;if(o.length==0){jts.options.add(new Option("There are no jobs at this location",""));}else{var jobtypesValue=jt.getParameterByName("jobtypes");jts.options.add(new Option("Select a Job Type - required",""));for(var i=0;i<o.length;i++){var opt=new Option(o[i].Name,o[i].Id);if(jobtypesValue==o[i].Id){opt.selected=true;}jts.options.add(opt);}}},error:function(xhr,textStatus,exceptionObj){if(textStatus=="timeout"){alert("timeout error");}else{alert(textStatus+" - "+exceptionObj);}},complete:function(xhr,textStatus){}});},populateByRegion:function(regionId,jobtypeObjId,locationTypeId){if(jobtypeObjId==null){jobtypeObjId="jobtypes";}if(regionId==null || regionId==""){$j('#'+jobtypeObjId).find('option').remove().end().append('<option value="">Select a Region in a State</option>').val('');return;}$j('#'+jobtypeObjId).find('option').remove().end().append('<option value="">Loading...</option>').val('');var jts=$(jobtypeObjId);$j.ajax({type:"POST",url:"/ajaxpro/HealthCommLLC.com.rightjobonline.hca.JobSearch,HealthCommLLC.com.rightjobonline.hca.ashx",data:'{"regionId":'+regionId+',"locationTypeId":'+locationTypeId+'}',contentType:"application/json;charset=utf-8",dataType:"json",global:false,timeout:1000*60,beforeSend:function(xhr){xhr.setRequestHeader("X-AjaxPro-Method","GetJobsTypesForRegionLocationType");},success:function(response,textStatus){var o=response;if(typeof(o.error)=="object"){alert("error - "+o.error.Message);return;}o=o.value;jts.options.length=0;if(o.length==0){jts.options.add(new Option("There are no jobs in this Region",""));}else{var jobtypesValue=jt.getParameterByName("jobtypes");jts.options.add(new Option("Select a Job Type - required",""));for(var i=0;i<o.length;i++){var opt=new Option(o[i].Name,o[i].Id);if(jobtypesValue==o[i].Id){opt.selected=true;}jts.options.add(opt);}}},error:function(xhr,textStatus,exceptionObj){if(textStatus=="timeout"){alert("timeout error");}else{alert(textStatus+" - "+exceptionObj);}},complete:function(xhr,textStatus){}});}};}();var states=function(){var state=null;var location=null;var submitValue;var submitValueName;var submitMethod;return{loadLocations:function(isPhysicianServices,stateObjId,locationObjId){if(isPhysicianServices==null){isPhysicianServices=false;}if(stateObjId==null){state=$("State");}else{state=$(stateObjId);}if(state.value=="" || state.value.length==0){return;}if(locationObjId==null){location=$("campuses");}else{location=$(locationObjId);}location.options.length=0;location.options.add(new Option("Loading facilities...",""));if(state.value.indexOf('-')==-1){submitValue=state.value;submitValueName="stateId";if(isPhysicianServices==true){location.options.length=0;location.options.add(new Option("Select a Region first",""));return;}else{submitMethod="GetLocationsForState";}}else{submitValue=state.value.split('-')[1];submitValueName="regionId";if(isPhysicianServices==true){submitMethod="GetPhysicianServicesLocationsForRegion";jt.populateByRegion(submitValue,"PS_Jobtypes",5);}else{submitMethod="GetLocationsForRegion";}}$j.ajax({type:"POST",url:"/ajaxpro/HealthCommLLC.com.rightjobonline.hca.JobSearch,HealthCommLLC.com.rightjobonline.hca.ashx",data:'{"'+submitValueName+'":"'+submitValue+'"}',contentType:"application/json;charset=utf-8",dataType:"json",global:false,timeout:1000*60,beforeSend:function(xhr){xhr.setRequestHeader("X-AjaxPro-Method",submitMethod);},success:function(response,textStatus){var o=response;if(typeof(o.error)=="object"){alert("error - "+o.error.Message);return;}o=o.value;location.options.length=0;if(isPhysicianServices==true){if(o.length==0){location.options.add(new Option("There are no Physician Offices in this Region",""));return;}else{location.options.add(new Option("Select a Facility(optional)",""));}}else{location.options.add(new Option("Select a Facility",""));}for(var i=0;i<o.length;i++){location.options.add(new Option(o[i].Name+" - "+o[i].City,o[i].Id));}},error:function(xhr,textStatus,exceptionObj){if(textStatus=="timeout"){alert("timeout error");}else{alert(textStatus+" - "+exceptionObj);}},complete:function(xhr,textStatus){}});}};}();var searchNow=function(){var baseurl="/JobSearch.aspx?";return{goSelectSearch:function(){if($("campuses").value==""){return;}if($("jobtypes").value==""){return;}var targetUrl=baseurl+"State="+$("State").value+"&campuses="+$("campuses").value+"&jobtypes="+$("jobtypes").value+"&s=SelectSearch";if(document.all){searchNow.goTo(targetUrl);}else{location.href=targetUrl;}},goKeywordSearch:function(){if($("KeywordLocation").value==""){return;}if($("KeywordJob").values==""){return;}try{_gaq.push(['_trackEvent','Links','Click','Keyword Search']);}catch(err){if(window.console){window.console.log(err);}}var targetUrl=baseurl+"KeywordLocation="+escape($("KeywordLocation").value)+"&KeywordJob="+escape($("KeywordJob").value)+"&s=KeywordSearch";if(document.all){searchNow.goTo(targetUrl);}else{location.href=targetUrl;}},goKeywordJobCodeSearch:function(){if($("KeywordJobCode").value==""){return;}try{_gaq.push(['_trackEvent','Links','Click','Job Number Search']);}catch(err){if(window.console){window.console.log(err);}}var targetUrl=baseurl+"KeywordJobCode="+escape($("KeywordJobCode").value)+"&s=KeywordSearch";if(document.all){searchNow.goTo(targetUrl);}else{location.href=targetUrl;}},goPhysicianSearch:function(){if($("PS_Campuses").value==""){}if($("PS_Jobtypes").value==""){return;}var targetUrl=baseurl+"State="+$("PS_State").value+"&campuses="+$("PS_Campuses").value+"&jobtypes="+$("PS_Jobtypes").value+"&s=PhysicianSearch";if(document.all){searchNow.goTo(targetUrl);}else{location.href=targetUrl;}},goTo:function(url){var a=document.createElement("a");if(!a.click){window.location=url;return;}a.setAttribute("href",url);a.style.display="none";document.body.appendChild(a);a.click();}};}();var typeahead=function(){var hasInitialized=false;var location=null;var locationId=null;var context=null;var contextIsVisible=false;var currentSelected=0;var selectionLength=0;var contextTop=0;var contextLeftMod=284;return{init:function(){if(!hasInitialized){hasInitialized=true;setTimeout("typeahead.init()",1000);return;}if((navigator.userAgent.indexOf("Safari")> -1 || navigator.userAgent.indexOf("AppleWebKit")> -1)&& navigator.userAgent.indexOf("Chrome")==-1){return;}location=$("KeywordLocation");locationId=$("KeywordLocationId");if(location==null){return;}location.observe("keyup",typeahead.locationCheck);location.observe("keydown",typeahead.catchDown);$j("body").append("<div id=\"KeywordContext\"></div>");context=$("KeywordContext");typeahead.setTopPosition();$j(context).css({"top":contextTop+"px","left":($j("#SearchBar").offset().left+contextLeftMod)+"px"
});},setTopPosition:function(){if(!hasInitialized){return;}var pos=$j(location).offset();if(pos==null){contextTop=168;}else{contextTop=(pos.top+$j(location).height()+12);}if(document.all){contextTop=168;if(navigator.userAgent.indexOf("MSIE 7")> -1){contextTop=166;contextLeftMod=292;}}$j(context).css({"top":contextTop+"px"
});},reposition:function(e){var pos=$j(location).offset();$j(context).css({"left":($j("#SearchBar").offset().left+contextLeftMod)+"px"
});},catchDown:function(e){if(contextIsVisible && e.keyCode==9){if(currentSelected > 0){location.value=$j("#kwsi_"+currentSelected).attr("name");}e.preventDefault();typeahead.closeContext();return;}if(!contextIsVisible && e.keyCode==13){e.preventDefault();return;}},locationCheck:function(e){if(contextIsVisible){switch(e.keyCode){case 13 :
if(currentSelected > 0){location.value=$j("#kwsi_"+currentSelected).attr("name");}typeahead.closeContext();return;case 27 :
typeahead.closeContext();return;case 36 :
return;case 37 :
case 39 :
return;case 38 :
if(currentSelected > 0){$j("#kwsi_"+currentSelected).removeClass("current");currentSelected--;if(currentSelected > 0){$j("#kwsi_"+currentSelected).addClass("current");}}return;case 40 :
if(currentSelected > 0 && currentSelected !=selectionLength){$j("#kwsi_"+currentSelected).removeClass("current");}if(currentSelected < selectionLength){currentSelected++;$j("#kwsi_"+currentSelected).addClass("current");}return;}if(e.keyCode < 48 && e.keyCode !=8){return;}}else{if(e.keyCode < 48 && e.keyCode !=8){return;}if(e.keyCode==13){e.preventDefault();return;}}locationId.value="";if(location.value.length >=2){$j.ajax({type:"POST",url:"/ajaxpro/HealthCommLLC.com.rightjobonline.hca.JobSearch,HealthCommLLC.com.rightjobonline.hca.ashx",data:'{"input":"'+location.value+'"}',contentType:"application/json;charset=utf-8",dataType:"json",global:false,timeout:1000*60,beforeSend:function(xhr){xhr.setRequestHeader("X-AjaxPro-Method","LocationKeywordLookahead");},success:function(response,textStatus){if(typeof(response.value)=="object"){if(response.value.length==0){locationId.value="";typeahead.closeContext();return;}$j("#KeywordContext ul li").unbind("click");$j("#KeywordContext ul li").unbind("mouseover");$j("#KeywordContext ul li").unbind("mouseout");selectionLength=response.value.length;$j(context).html("");var ret="<ul>";if(response.value.length==0){ret+="<li>No Results Found</li>";}else{for(var i=0;i<response.value.length;i++){ret+=response.value[i];}}ret+="</ul>";$j(context).html(ret);$j("#KeywordContext ul li").bind({click:function(event){location.value=$j(event.target).attr("name");typeahead.closeContext();},mouseover:function(event){var hoverid=$j(event.target).attr("id").split('_')[1];if(hoverid==currentSelected){return;}$j("#kwsi_"+currentSelected).removeClass("current");$j(event.target).addClass("current");currentSelected=hoverid;},mouseout:function(event){}});}},error:function(xhr,textStatus,exceptionObj){},complete:function(xhr,textStatus){}});$j(context).show();contextIsVisible=true;}},closeContext:function(){$j(context).hide();contextIsVisible=false;currentSelected=0;selectionLength=0;}}}();Event.observe(window,"load",init);Event.observe(window,"load",typeahead.init);Event.observe(window,"resize",typeahead.reposition);
