
Type.registerNamespace('Monster.Client.Behavior.BuyWidgets');Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter=function(element){Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter.initializeBase(this,[element]);this._isLocal=true;this._isNational=false;this._isLocationFocusZip=false;this._isBoldingSelected=false;this._isDiversitySelected=false;this._isRateCardVisible=false;this._isInitialView=true;this._isBlocked=false;this._quantityPriceBreaks=[];this._errorFields=[];this.createProperty("btnBuy");this.createProperty("btnBuyAreaWideSingle");this.createProperty("cbBolding");this.createProperty("cbDiversity");this.createProperty("chkMultipleLocations");this.createProperty("ddlCountry");this.createProperty("ddlCountryAreaWide");this.createProperty("ddlDuration");this.createProperty("ddlState");this.createProperty("txtCity");this.createProperty("txtLocationZip");this.createProperty("txtQuantity");this.createProperty("aclID");this.createProperty("anyLocationLabel");this.createProperty("defaultAreaWideUrl");this.createProperty("defaultAreaWideCountryID");this.createProperty("defaultDuration");this.createProperty("defaultDurationIntl");this.createProperty("defaultEcomProductTypeID");this.createProperty("defaultMaxUnitsAllowed");this.createProperty("defaultPostingLocationGroupID");this.createProperty("defaultQuantity");this.createProperty("diversityBoardID");this.createProperty("hasAutoRefresh");this.createProperty("hasBolding");this.createProperty("hasExtraBoardDiversity");this.createProperty("hasLocalEntry");this.createProperty("hasQuickBuyUpsell");this.createProperty("isAreaWide");this.createProperty("isIntlSupported");this.createProperty("isJPWSplit");this.createProperty("isLocationUS");this.createProperty("maxCategoryGroup");this.createProperty("maxPostingLocationGroup");this.createProperty("maxUnitsDuration30");this.createProperty("maxUnitsDuration60");this.createProperty("monsterBoardID");this.createProperty("msgErrorLocation");this.createProperty("msgErrorQuantity");this.createProperty("msgErrorSystem");this.createProperty("refreshInterval");this.createProperty("reportABSplit");}
Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter.prototype={initialize:function(){Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter.callBaseMethod(this,'initialize');if(!MonsPageManager.enableInitOnDemand){this.initOnDemand();}
else{MonsPageManager.registerInitState(this._id,false,null);}
this._webService=Services.Products.Pricing;this.registerDataProperty("Quantity");this.registerDataProperty("ZipCode");this.registerDataProperty("Duration");this.registerDataProperty("PostingLocationGroupID");this.registerDataProperty("LocalPostingLocationGroupID");this.registerDataProperty("EcomProductTypeID");this.registerDataProperty("MaxUnitsConfigured");this.registerDataProperty("MaxUnitsAllowed");this.registerDataProperty("AreaWideUrl");this._dataStore.set_property("Quantity",1);this._dataStore.set_property("ZipCode","");this._dataStore.set_property("Duration",this.defaultDuration);this._dataStore.set_property("PostingLocationGroupID","-1");this._dataStore.set_property("LocalPostingLocationGroupID","-1");this._dataStore.set_property("AreaWideUrl",this.defaultAreaWideUrl)
var hasBolding=Boolean.parse(this.hasBolding);var hasDiversity=Boolean.parse(this.hasExtraBoardDiversity);var isIntlSupported=Boolean.parse(this.isIntlSupported);var hasLocalEntry=Boolean.parse(this.hasLocalEntry);var isAreaWide=Boolean.parse(this.isAreaWide);if(this.defaultDuration==30){this._dataStore.set_property("MaxUnitsConfigured",this.maxUnitsDuration30);}else if(this.defaultDuration==60){this._dataStore.set_property("MaxUnitsConfigured",this.maxUnitsDuration60);}
if(isNaN(parseInt(this.defaultMaxUnitsAllowed))){this.defaultMaxUnitsAllowed=249;}
if(!hasLocalEntry){this._dataStore.set_property("PostingLocationGroupID",this.defaultPostingLocationGroupID);this._dataStore.set_property("EcomProductTypeID",this.defaultEcomProductTypeID);this._dataStore.set_property("MaxUnitsAllowed",this.defaultMaxUnitsAllowed);}
if(isIntlSupported){$addHandlers($(".location-intl a")[0],{click:this.handleLocationToggle},this);$addHandlers(this.ddlCountry,{change:this.handleCountryDropdown},this);}
if(hasLocalEntry){$addHandlers(this.chkMultipleLocations,{click:this.handleMultipleLocations},this);$addHandlers(this.txtCity,{keyup:this.handleCityChange},this);$addHandlers(this.ddlState,{change:this.handleStateUpdate},this);$addHandlers(this.txtLocationZip,{keyup:this.handleLocationZipUpdate},this);}
if(this.ddlDuration){$addHandlers(this.ddlDuration,{change:this.handleDurationDropdown},this);}
$addHandlers(this.txtQuantity,{keyup:this.handleQuantityUpdate},this);if(hasBolding){$addHandlers(this.cbBolding,{click:this.handleBoldingCheckbox},this);}
if(hasDiversity){$addHandlers(this.cbDiversity,{click:this.handleDiversityCheckbox},this);}
$addHandlers(this.btnBuy,{click:this.handleBuyButton},this);if(isAreaWide){if(isIntlSupported){$addHandlers(this.ddlCountryAreaWide,{change:this.handleCountryDropdownAreaWide},this);}
$addHandlers(this.btnBuyAreaWideSingle,{click:this.handleAreaWideBuyButton},this);}
if(this.ddlCountry){this.ddlCountry.selectedIndex=0;}
this.txtQuantity.value=this.defaultQuantity;if(this.ddlDuration){$(".duration-field select").val(this.defaultDuration);this.ddlDuration.disabled=false;}
if(hasLocalEntry){this.chkMultipleLocations.checked=false;this.txtLocationZip.value="";this.txtLocationZip.disabled=false;this.txtCity.value="";this.txtCity.disabled=false;this.ddlState.selectedIndex=0;this.ddlState.disabled=false;}
if(hasBolding){this.cbBolding.checked=false;}
if(hasDiversity){this.cbDiversity.checked=false;}
if(isAreaWide&&isIntlSupported){$(this.ddlCountryAreaWide).val(this.defaultAreaWideCountryID);}
if(!$(".rate-card").hasClass("initial-view")){this._isRateCardVisible=true;this._isInitialView=false;this.highlightRateCardRow(parseInt(this.defaultQuantity));}},initOnDemand:function(){},dispose:function(){Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter.callBaseMethod(this,'dispose');},onSuccess:function(result,context,methodName){context.unblockWidget();switch(methodName){case"GetProductData":var rcArray=result.RateCardResults;var priceArray=result.PricingInfoResults;var rcHtml=rcArray[0];var maxUnits=rcArray[1];var plgid=rcArray[2];var productTypeId=rcArray[3];var state=(rcArray.length>4)?rcArray[4]:"";var city=(rcArray.length>4)?rcArray[5]:"";var country=(rcArray.length>4)?rcArray[6]:"";var isAnywhereRateCard=(rcArray.length===4);context._dataStore.set_property("MaxUnitsAllowed",maxUnits);context._dataStore.set_property("EcomProductTypeID",productTypeId);if(plgid>=0){context._dataStore.set_property("PostingLocationGroupID",plgid);}
if(Boolean.parse(context.hasLocalEntry)){context._dataStore.set_property("LocalPostingLocationGroupID",plgid);}
context.renderRateCard(rcHtml,country,state,city,plgid,isAnywhereRateCard);context.highlightRateCardRow(context._dataStore.get_property("Quantity"));$(".total-amount").html(priceArray[3]);_zipCode=context._dataStore.get_property("ZipCode");_locationName=priceArray[9]+'-'+priceArray[8]+'-'+priceArray[7]
_locationType='City';if(context._isLocationFocusZip){this._locationType='Zip';}
publishJobGadgetView(priceArray[11]);break;case"GetLocalProductData":if(result.RateCardResults){context.onSuccess(result,context,"GetProductData");}else{context._dataStore.set_property("LocalPostingLocationGroupID","-1");context.hideRateCard();var errArr=[context.msgErrorLocation];context._errorFields.push(context.txtCity);context.showError(errArr);}
break;case"GetPricingInfo":$(".total-amount").html(result[3]);context._dataStore.set_property("PostingLocationGroupID",result[4]);context._dataStore.set_property("EcomProductTypeID",result[13]);_zipCode=context._dataStore.get_property("ZipCode");_locationName=result[9]+'-'+result[8]+'-'+result[7]
_locationType='City';if(context._isLocationFocusZip){this._locationType='Zip';}
publishJobGadgetView(result[11]);break;case"GetJobsCreateTitleUrlParameters":context._dataStore.set_property("AreaWideUrl",result);break;default:break;}},onFailure:function(result,context,methodName){context.unblockWidget();switch(methodName){case"GetProductData":context.hideRateCard();var errArr=[context.msgErrorLocation];context._errorFields.push(context.txtLocationZip);context.showError(errArr);break;case"GetLocalProductData":context._dataStore.set_property("LocalPostingLocationGroupID","-1");context.hideRateCard();var errArr=[context.msgErrorLocation];context._errorFields.push(context.txtCity);context.showError(errArr);break;case"GetPricingInfo":context.hideRateCard();var errArr=[context.msgErrorSystem];context.showError(errArr);break;default:Sys.Debug.trace("error in StandardJobsAdapter.js");break;}},onDataStoreEvent:function(sender,args){switch(args.get_propertyName()){default:break;}},handleLocationToggle:function(evt){evt.preventDefault();this._isLocal=!this._isLocal;this.toggleLocation(this._isLocal);if(!this._isLocal){var c=this.ddlCountry[this.ddlCountry.selectedIndex].value;this._dataStore.set_property("PostingLocationGroupID",c);this._isNational=(c==this.defaultPostingLocationGroupID);if(this._isNational){this._dataStore.set_property("Duration",this.defaultDuration);}else{this._dataStore.set_property("Duration",this.defaultDurationIntl);}
if(Boolean.parse(this.hasExtraBoardDiversity)){$(".diversity-field").css("display","none");}
publishJobInternationalClickWT();if(this.ddlCountry.selectedIndex!==0){this.updateRateCard();}else{this.hideRateCard();}}else{this._dataStore.set_property("PostingLocationGroupID",this.defaultPostingLocationGroupID);this._dataStore.set_property("MaxUnitsAllowed",this.defaultMaxUnitsAllowed);if(this.ddlDuration){this.ddlDuration.disabled=false;this._dataStore.set_property("Duration",$(this.ddlDuration).val());}else{this._dataStore.set_property("Duration",this.defaultDuration);}
if(Boolean.parse(this.hasExtraBoardDiversity)){$(".diversity-field").css("display","block");}
publishJobHomeClickWT();var lplgid=this._dataStore.get_property("LocalPostingLocationGroupID");if(Boolean.parse(this.hasLocalEntry)){if(this.chkMultipleLocations.checked){this.handleMultipleLocations(evt);}else{if(this._isLocationFocusZip){this.handleLocationZipUpdate(evt);}else{var city=jQuery.trim(this.txtCity.value);var state=this.ddlState[this.ddlState.selectedIndex].value;if((state!=="-1")&&(city!=="")){this.handleStateUpdate(evt);}else{this.hideRateCard();}}}}else{this.updateRateCard();}}},handleLocationZipUpdate:function(evt){var z=jQuery.trim(this.txtLocationZip.value);this._dataStore.set_property("ZipCode",z);if(z.length===0){if(this._isLocationFocusZip){this.hideRateCard();}}else if(z.length>0){if(!this._isLocationFocusZip){this._isLocationFocusZip=true;this._dataStore.set_property("LocalPostingLocationGroupID","-1");this.txtCity.value="";this.ddlState.selectedIndex=0;}
if(z.length>=5){this.updateRateCard();}else{this.hideRateCard();}}},handleCityUpdate:function(evt){var state=this.ddlState[this.ddlState.selectedIndex].value;if(state!=="-1"){this.updateLocation();}},handleStateUpdate:function(evt){var city=jQuery.trim(this.txtCity.value);var state=this.ddlState[this.ddlState.selectedIndex].value;if(state!=="-1"){if(this._isLocationFocusZip){this._isLocationFocusZip=false;this._dataStore.set_property("LocalPostingLocationGroupID","-1");this._dataStore.set_property("ZipCode","");this.txtLocationZip.value="";this.hideRateCard();}
if(city!==""){this.updateLocation();}}},handleCityChange:function(evt){var city=jQuery.trim(this.txtCity.value);if(city.length>0&&this._isLocationFocusZip){this._isLocationFocusZip=false;this._dataStore.set_property("LocalPostingLocationGroupID","-1");this._dataStore.set_property("ZipCode","");this.txtLocationZip.value="";this.hideRateCard();}
if(document.cityChangeTimeout){window.clearTimeout(document.cityChangeTimeout);}
document.cityChangeFunc=function(){var allAdapters=Sys.Application.getComponents();var jobAdapter;for(var i=0,l=allAdapters.length;i<l;i++){if(Object.getType(allAdapters[i]).getName()=='Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter'){jobAdapter=allAdapters[i];break;}}
jobAdapter.handleStateUpdate();};document.cityChangeTimeout=window.setTimeout(function(){document.cityChangeFunc();},1000);},handleMultipleLocations:function(evt){if(this.chkMultipleLocations.checked){this.txtLocationZip.disabled=true;this.txtCity.disabled=true;this.ddlState.disabled=true;this._dataStore.set_property("LocalPostingLocationGroupID","-1");this.updateRateCard();publishJobMultiLocationClickWT();}else{this.txtLocationZip.disabled=false;this.txtCity.disabled=false;this.ddlState.disabled=false;var lplgid=this._dataStore.get_property("LocalPostingLocationGroupID");if(lplgid=="-1"&&!this._isLocationFocusZip){var city=jQuery.trim(this.txtCity.value);var state=this.ddlState[this.ddlState.selectedIndex].value;if((state!=="-1")&&(city!=="")){this.updateLocation();}else{this.hideRateCard();}}else{this.updateRateCard();}}},handleCountryDropdown:function(evt){var c=this.ddlCountry[this.ddlCountry.selectedIndex].value;this._dataStore.set_property("PostingLocationGroupID",c);this._isNational=(c==this.defaultPostingLocationGroupID);if(this._isNational){this._dataStore.set_property("Duration",this.defaultDuration);}else{this._dataStore.set_property("Duration",this.defaultDurationIntl);}
if(this.ddlDuration){if(this._isNational){this.ddlDuration.disabled=false;$(this.ddlDuration).val(this.defaultDuration);}else{this.ddlDuration.disabled=true;$(this.ddlDuration).val(this.defaultDurationIntl);}}
this.updateRateCard();},handleCountryDropdownAreaWide:function(evt){this._dataStore.set_property("AreaWideUrl","");var caw=this.ddlCountryAreaWide[this.ddlCountryAreaWide.selectedIndex].value;this.blockWidget();this.callServer("GetJobsCreateTitleUrlParameters",[caw]);},handleDurationDropdown:function(evt){var d=this.ddlDuration[this.ddlDuration.selectedIndex].value;this._dataStore.set_property("Duration",d);if(d=="30"){this._dataStore.set_property("MaxUnitsConfigured",this.maxUnitsDuration30);}else if(d=="60"){this._dataStore.set_property("MaxUnitsConfigured",this.maxUnitsDuration60);}
this.updateRateCard();},handleQuantityUpdate:function(evt){var q=this.txtQuantity.value;_quantity=q;this._dataStore.set_property("Quantity",q);if(this._isRateCardVisible){this.updateTotalPrice();}else{this.updateRateCard();}},handleBoldingCheckbox:function(evt){this._isBoldingSelected=evt.target.checked;this.updateRateCard();},handleDiversityCheckbox:function(evt){this._isDiversitySelected=evt.target.checked;this.updateRateCard();},handleBuyButton:function(evt){evt.preventDefault();this.addToCart();},handleAreaWideBuyButton:function(evt){evt.preventDefault();this.addAreaWideToCart();},validateLocation:function(){var errArr=[];var z=this._dataStore.get_property("ZipCode");var plgID=this._dataStore.get_property("PostingLocationGroupID");var lplgID=this._dataStore.get_property("LocalPostingLocationGroupID");if(this._isLocal){if(Boolean.parse(this.hasLocalEntry)&&!this.chkMultipleLocations.checked){if(this._isLocationFocusZip){if((z.length!=5)||isNaN(parseInt(z))){this._errorFields.push(this.txtLocationZip);errArr.push(this.msgErrorLocation);}}else{if(lplgID==="-1"){this._errorFields.push(this.txtCity);errArr.push(this.msgErrorLocation);}}}}else{if(!(this._isNational&&Boolean.parse(this.isLocationUS))){if(plgID==="-1"){errArr.push(this.msgErrorLocation);}}}
return errArr;},validateLocationAreaWide:function(){var errArr=[];var locUrl=this._dataStore.get_property("AreaWideUrl");if(locUrl===""){errArr.push(this.msgErrorLocation);}
return errArr;},validateQuantity:function(){var errArr=[];var q=this._dataStore.get_property("Quantity");var max;if(this._isLocal||this._isNational){max=parseInt(this._dataStore.get_property("MaxUnitsConfigured"));}
else{max=parseInt(this._dataStore.get_property("MaxUnitsAllowed"));}
if(isNaN(q)){this._errorFields.push(this.txtQuantity);errArr.push(this.msgErrorQuantity);}else if((q>max)||(q<1)){this._errorFields.push(this.txtQuantity);errArr.push(this.msgErrorQuantity);}
return errArr;},validateForm:function(){var errArr=[];errArr=errArr.concat(this.validateLocation());errArr=errArr.concat(this.validateQuantity());return errArr;},updateLocation:function(){this.blockWidget();this.hideError();var maxUnits=this._dataStore.get_property("MaxUnitsConfigured");var q=this._dataStore.get_property("Quantity");this.callServer("GetLocalProductData",[this.getServiceQueryParams(),maxUnits,q]);},updateRateCard:function(){var errArr=this.validateLocation();if(errArr.length===0){this.blockWidget();this.hideError();var maxUnits=this._dataStore.get_property("MaxUnitsConfigured");var q=this._dataStore.get_property("Quantity");this.callServer("GetProductData",[this.getServiceQueryParams(),maxUnits,q]);}else{this.hideRateCard();this.showError(errArr);}},updateTotalPrice:function(){var errArr=this.validateQuantity();if(errArr.length===0){var q=this._dataStore.get_property("Quantity");this.highlightRateCardRow(q);this.hideError();this.callServer("GetPricingInfo",[q,this.getServiceQueryParams()]);}else{this.hideRateCard();this.showError(errArr);}},getServiceQueryParams:function(){var params=[];var hasLocalEntry=Boolean.parse(this.hasLocalEntry);if(this._isLocal){if(hasLocalEntry){if(this.chkMultipleLocations.checked){params.push("01:"+"");params.push("02:"+"0");}else if(this._isLocationFocusZip){params.push("01:"+this._dataStore.get_property("ZipCode"));params.push("02:"+"0");}else{params.push("01:"+"");params.push("02:"+this._dataStore.get_property("LocalPostingLocationGroupID"));}}else{if(Boolean.parse(this.isLocationUS)){params.push("01:"+"");params.push("02:"+"0");}else{params.push("01:"+"");params.push("02:"+this.defaultPostingLocationGroupID);}}}else{if(this._isNational&&Boolean.parse(this.isLocationUS)){params.push("01:"+"");params.push("02:"+"0");}else{params.push("01:"+"");params.push("02:"+this._dataStore.get_property("PostingLocationGroupID"));}}
params.push("03:"+(this._isLocal&&this._isBoldingSelected));params.push("04:"+this.hasAutoRefresh);params.push("05:"+this._dataStore.get_property("Duration"));params.push("07:"+!(this._isLocal||this._isNational));if(this._isLocal&&hasLocalEntry&&!this._isLocationFocusZip){params.push("08:"+this.ddlState[this.ddlState.selectedIndex].value);params.push("09:"+this.txtCity.value);}
params.push("11:"+"false");params.push("12:"+this.monsterBoardID);params.push("13:"+(this._isLocal&&this._isDiversitySelected));params.push("16:"+this.refreshInterval);return params;},highlightRateCardRow:function(quantity){if(this._quantityPriceBreaks.length===0)this.initQuantityPriceBreaks();var qpb=this._quantityPriceBreaks;var actualQ=parseInt(quantity);var trIdx,tempMin,tempMax;for(var i=0;i<qpb.length;i++){tempMin=parseInt(qpb[i][0]);tempMax=parseInt(qpb[i][1]);if(isNaN(tempMax)){if(actualQ===tempMin){trIdx=i;break;}}else{if(actualQ>=tempMin&&actualQ<=tempMax){trIdx=i;break;}}}
$(".rate-card tr").removeClass("highlight-row");$(".rate-card tr:nth-child("+(trIdx+1)+")").addClass("highlight-row");},initQuantityPriceBreaks:function(){var tempQPB=[];var trElems=$(".rate-card tr");var tempTdQ,tempMinQ,tempMaxQ,tempDashIdx;for(var i=0;i<trElems.length;i++){if(i===0)continue;tempTdQ=$("td",trElems[i])[0].innerHTML;tempDashIdx=tempTdQ.indexOf("-");if(tempDashIdx!==-1){tempMinQ=tempTdQ.substring(0,tempDashIdx);tempMaxQ=tempTdQ.substring(tempDashIdx+1);}else{tempMinQ=tempTdQ.substring(0);tempMaxQ=null;}
tempQPB[tempQPB.length]=[tempMinQ,tempMaxQ];}
this._quantityPriceBreaks=tempQPB;},getRateCardLabel:function(country,state,city,locGroupID){var loc=[];loc.push(jQuery.trim(country));if(jQuery.trim(state))loc.push("-"+jQuery.trim(state));if(jQuery.trim(city))loc.push("-"+jQuery.trim(city));if(loc.length>1){loc.unshift("<a href='/products/CitiesList.aspx?locid="+locGroupID+"' target='_new'>");loc.push("</a>");}
document.getElementById("citiesListIFrame").src="/products/CitiesList.aspx?locid="+locGroupID
return loc.join("");},toggleLocation:function(isLocal){var elemActive,elemInactive,elemActiveParent,elemInactiveParent;var tempA=document.createElement("A");var tempSpan=document.createElement("SPAN");if(!isLocal){elemActive=$(".location-local *")[0];elemInactive=$(".location-intl *")[0];$(".location-entry").css("display","none");$(".location-country").css("display","block");}else{elemActive=$(".location-intl *")[0];elemInactive=$(".location-local *")[0];$(".location-entry").css("display","block");$(".location-country").css("display","none");}
elemActiveParent=elemActive.parentNode;elemInactiveParent=elemInactive.parentNode;tempA.innerHTML=elemActive.innerHTML;tempA.setAttribute("href","#local");$addHandlers(tempA,{click:this.handleLocationToggle},this);elemActiveParent.removeChild(elemActive);elemActiveParent.appendChild(tempA);tempSpan.innerHTML=elemInactive.innerHTML;elemInactiveParent.removeChild(elemInactive);elemInactiveParent.appendChild(tempSpan);},addToCart:function(){if(!this._isRateCardVisible)return false;var errArr=this.validateForm();if(errArr.length>0){this.showError(errArr);return false;}
publishGadgetSelect();var q=parseInt(this._dataStore.get_property("Quantity"));var urlPath="/products/JobProductsSecure.aspx?";var params=[];var isRedirect=false;if(Boolean.parse(this.isJPWSplit)&&(q==1)&&(this._isLocal||this._isNational)){urlPath="/jobs/JobPostingWizard.aspx?";params.push("aclid="+this.aclID);params.push("days="+this._dataStore.get_property("Duration"));var locgId=this._dataStore.get_property("PostingLocationGroupID");if(locgId>=0){params.push("locgid="+locgId);}else{if(this._isLocal&&this.chkMultipleLocations.checked){params.push("locgid="+this.defaultPostingLocationGroupID);}}
if(Boolean.parse(this.hasLocalEntry)){if(!this.chkMultipleLocations.checked){var zip=this._dataStore.get_property("ZipCode");if(zip!==""){params.push("postalcode="+zip);}else{var city=jQuery.trim(this.txtCity.value);var state=this.ddlState[this.ddlState.selectedIndex].value;if((state!=="-1")&&(city!=="")){params.push("stateid="+state);params.push("city="+encodeURI(city));}}}}
if(Boolean.parse(this.reportABSplit)){params.push("WT.tc_sjp2009=post");}}else{if(this._isLocal&&Boolean.parse(this.hasQuickBuyUpsell)){isRedirect=true;}
params.push("bundleid="+"0");params.push("quantity="+q);var promoID=this.getQueryStringValue("promotionID")
if(promoID!==""){params.push("pid="+promoID);}
params.push("ecomProductTypeID="+this._dataStore.get_property("EcomProductTypeID"));var plgID=this._dataStore.get_property("PostingLocationGroupID");if(plgID>=0){params.push("postingLocationGroupID="+plgID);}
if(this._isLocal||this._isNational){params.push("MaxCategoryGroup="+this.maxCategoryGroup);params.push("MaxPostingLocationGroup="+this.maxPostingLocationGroup);}
var zip=this._dataStore.get_property("ZipCode");if(zip!==""){params.push("zipcode="+zip);}
if(Boolean.parse(this.reportABSplit)&&(q==1)){params.push("WT.tc_sjp2009=pay");}}
params.push("postingDuration="+this._dataStore.get_property("Duration"));params.push("editMode="+false);params.push("hasBolding="+(this._isBoldingSelected&&this._isLocal));params.push("hasAutoRefresh="+this.hasAutoRefresh);params.push("refreshInterval="+this.refreshInterval);if(Boolean.parse(this.hasExtraBoardDiversity)&&this._isLocal){params.push("jobBoardID="+this.monsterBoardID);}
if(this._isDiversitySelected&&this._isLocal){params.push("extraBoards="+this.diversityBoardID);}
if(isRedirect){params.push("redirect="+encodeURIComponent("/products/Upsell.Redux.aspx?"+params.join("&")));}
var redirLoc=urlPath+params.join("&");this.handleRedirection(redirLoc);},addAreaWideToCart:function(){var errArr=this.validateLocationAreaWide();if(errArr.length>0){this.showError(errArr);return false;}
var redirLoc=this._dataStore.get_property("AreaWideUrl");this.handleRedirection(redirLoc);},handleRedirection:function(redirLocation){if(this.getQueryStringValue("debug-buy",false)){alert(redirLocation);}else{var redirLink=document.createElement("A");if(typeof(redirLink.click)==="undefined"){window.location=redirLocation;}else{redirLink.href=redirLocation;document.body.appendChild(redirLink);redirLink.click();}}},getQueryStringValue:function(key,default_){if(default_==null)default_="";key=key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regex=new RegExp("[\\?&]"+key+"=([^&#]*)");var qs=regex.exec(window.location.href);if(qs==null){return default_;}else{return qs[1];}},hideRateCard:function(){if(!this._isInitialView){$(".rate-card").css("display","none");$(".totals").css("display","none");$(".buy-btn button").removeClass("btn-primary-large").addClass("btn-disabled-large");this._isRateCardVisible=false;}},showRateCard:function(){if(this._isInitialView){$(".rate-card").removeClass("initial-view");$(".totals").removeClass("initial-view");$(".buy-btn").removeClass("initial-view");this._isInitialView=false;}
$(".rate-card").css("display","");$(".totals").css("display","block");$(".buy-btn button").removeClass("btn-disabled-large").addClass("btn-primary-large");this._isRateCardVisible=true;},renderRateCard:function(rcHtml,country,state,city,postingLocationGroupID,isAnywhereRateCard){if(!this._isRateCardVisible){this.showRateCard();}
this._quantityPriceBreaks=[];$(".rate-card tbody").html(rcHtml);var rcaption=$(".rate-card caption");if(this._isLocal){if(Boolean.parse(this.hasLocalEntry)){if(isAnywhereRateCard){rcaption.html(this.anyLocationLabel);}else{$(".rate-card caption").html(this.getRateCardLabel(country,state,city,postingLocationGroupID));var dialogAdapter=window.document.reduxDialogs["standardJobsCitiesList"];rcaption.find(":a").click(function(e){dialogAdapter.showDialog(e);});}}else{rcaption.html("");}}else{rcaption.html(this.ddlCountry[this.ddlCountry.selectedIndex].text);}},hideError:function(){$(".error-field").html("");$(".error-field").css("display","none");var f;while(this._errorFields.length>0){f=this._errorFields.pop();$(f).removeClass("field-error");}},showError:function(errArr){if(errArr.length===0)return;$(".error-field").html(errArr.join("<br />"));$(".error-field").css("display","block");for(var i=0;i<this._errorFields.length;i++){$(this._errorFields[i]).addClass("field-error");}},blockWidget:function(){if(!this._isBlocked){this._isBlocked=true;$(".buy-module .box-content").block({message:"<img src='http://media.newjobs.com/id/hiring/redux/global/loading.gif' />",css:{border:0,backgroundColor:"transparent"},overlayCSS:{backgroundColor:"#CCC",opacity:0.4}});}},unblockWidget:function(){$(".buy-module .box-content").unblock();this._isBlocked=false;}}
Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter.registerClass('Monster.Client.Behavior.BuyWidgets.StandardJobsAdapter',Monster.Client.Behavior.DataAdapterBase);if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
;
