var currentIsland=false,fakeLocInitialValue,changedCondo=false,yPosCondo,MaxNoOfColumnsInRow=3,tabldcondocheckboxesfilter="";function SearchID(){return $("#powerSearchCurrentID").val()}function OnFailedXHR(b,c,a){if(b!==null){switch(a){case"reset_Condos":$("#condos-popup .condos-popup-content").html("");$("#condos-popup").hide();$("select#fakeCondo").show();break;case"reset_Neighborhoods":$("#neighborhoodFlyoutBox div.header div.row").remove()}FillDefaults()}}function showHideMauiFields(){var b=$("#locationFlyOutBox input[type=hidden]:first").val().split("-"),a=b[0];if(a.trim().toLowerCase()=="maui"&&$(".propertyType span.condo input").attr("checked"))$("#divShortTermRentalAllwed").show();else{$("#divShortTermRentalAllwed").hide();$("#divShortTermRentalAllwed select").val("All")}if(a.trim().toLowerCase()=="maui")$("#divSellerFinancing").show();else{$("#divSellerFinancing").hide();$("#divSellerFinancing select").val("All")}}function updatevalues(){if($("#locationFlyOutBox input:checked").length>0){var a=$($("#locationFlyOutBox input:checked")).closest("li").children("h5").text(),b=$($("#locationFlyOutBox input:checked")).parent().text(),c=a+" - "+b;$("#locationFlyOutBox input[type=hidden]:first").val(c);var d=a+" - "+b;$("#ddlPowerSearchFakeLoc option").text(d);$("#ddlPowerSearchFakeLoc option").val(a);if($("#hdnPowerSearchUpdatePanelFlag").length>0){$("#hdnPowerSearchUpdatePanelFlag").val("power_back");__doPostBack("updatePnlNeighborhoodsListPower","");$("#hdnPowerSearchUpdatePanelFlag").val("0")}}else if($(".propertyType .condo input[type=checkbox]").attr("checked")==true||$(".propertyType .townhouse input[type=checkbox]").attr("checked")==true){$("#hdnPowerNeighborhoodChange").val("Change");FillCondosFlyout()}else{$("#hdnPowerLocationChange").val("Change");FillDefaults();clearDynamicSearchCount();execSearch()}}function OnSucceededRenew(a,e,c){switch(c){case"reset_Condos":OnSucceededCondosFlyOut(a,e,c);break;case"reset_Neighborhoods":var b="";$("#neighborhoodFlyoutBox div.header div.row").remove();if(a.length>0){for(i=0;i<a.length;i++)b+="<div class='row'><input type='checkbox' id='n_"+i+"' /><label for='n_"+i+"'>"+a[i][1]+"</label><input type='hidden' id='n_value_"+i+"' value='"+a[i][0]+"' /><input type='hidden' id='n_searchName_"+i+"' value='"+a[i][2]+"' /></div>";$("#neighborhoodFlyoutBox div.header").append(b)}var d={search:SearchID()};PageMethods.selected_Neighborhoods(d,OnSucceededReset,OnFailedXHR)}}function OnSucceededReset(a,c,d){switch(d){case"selected_Neighborhoods":if(a.length>0)for(i=0;i<a.length;i++)a[i]!=""&&$("#neighborhoodFlyoutBox input[value='"+a[i]+"']").parent().find("input[type=checkbox]").attr("checked",true);var b=$("#locationFlyOutBox input[type=hidden]:first").val().split("-"),c={islandName:jQuery.trim(b[0]),regionName:jQuery.trim(b[1]),neighborhoods:GetSelectedNeighborhoodsList()};PageMethods.reset_Condos(c,OnSucceededRenew,OnFailedXHR);break;case"selected_Condos":if(a.length>0)for(i=0;i<a.length;i++)a[i]!=""&&$("#condos-popup .condos-popup-content input[value='"+a[i]+"']").parent().find("input[type=checkbox]").attr("checked",true);if($("#condos-popup .condos-popup-content input[type=checkbox]:[checked=false]").length==0)$("#condos-popup .selectAll").attr("checked",true);else $("#condos-popup .selectAll").attr("checked",false);FillDefaults();clearDynamicSearchCount();execSearch()}}function updateStepFields(){if($(".propertyType input:checked").length>0){showStep2();if($(".propertyType span.singleFamily input").attr("checked"))$(".singleFamilyDisplay, .singleFamCondoDisplay").show();else $(".propertyType span.condo input").attr("checked")?$(".singleFamilyDisplay").hide():$(".singleFamilyDisplay, .singleFamCondoDisplay").hide();if($(".propertyType span.condo input").attr("checked"))$(".condoDisplay, .singleFamCondoDisplay").show();else if(!$(".propertyType span.townhouse input").attr("checked"))if($(".propertyType span.singleFamily input").attr("checked"))$(".condoDisplay").hide();else $(".condoDisplay, .singleFamCondoDisplay").hide();if($(".propertyType span.townhouse input").attr("checked"))$(".condoDisplay, .singleFamCondoDisplay").show();else if(!$(".propertyType span.condo input").attr("checked"))$(".propertyType span.singleFamily input").attr("checked")?$(".condoDisplay").hide():$(".condoDisplay, .singleFamCondoDisplay").hide();var a=!GetCheckboxValue(".propertyType input:eq(0)")&&!GetCheckboxValue(".propertyType input:eq(3)")&&!GetCheckboxValue(".propertyType input:eq(4)");$("#"+listOfClientId.landAreaMin).attr("disabled",a);$("#"+listOfClientId.landAreaMax).attr("disabled",a)}}function FillDefaults(){var d=$("#locationFlyOutBox input[type=hidden]:first").val();if(d!=""){var e=d.split("-"),c=jQuery.trim(e[0]),j=jQuery.trim(e[1]),g=c+" - "+j;$("#ddlPowerSearchFakeLoc option").text(g);$("#ddlPowerSearchFakeLoc option").val(c);var f=c.toLowerCase();currentIsland=f;$("#power-search").removeClass().addClass(currentIsland);$(".col3 .element:visible:first p").hasClass("closedHdr")&&$(".col3 .element:visible:first p").click();$("#ddlFakeNeighborhood").attr("disabled",false);if(currentIsland!=""){var i=$(".propertyType input:checked").length;if(i==0)var i=$(".propertyType input").attr("disabled",false)}for(var h=$("#neighbor-popup input:checked").length,a="",b=0;b<h;b++)if($($("#neighbor-popup input:checked")[b]).attr("id")!=null&&$($("#neighbor-popup input:checked")[b]).attr("id").indexOf("chkSelectAll")==-1)a+=jQuery.trim($($("#neighbor-popup input:checked")[b]).parent().parent().siblings("td").find("label").html())+", ";a=a.substr(0,a.lastIndexOf(", "));if(a=="")$("div.neighborhoodsSelected").css("display","none");else{$("#neighborhoodFlyoutBox input[type=hidden]:first").val(a);$("div.neighborhoodsSelected").css("display","block");$("div.neighborhoodsSelected").text(a)}a="";$("#condos-popup .condos-popup-content table").length>0&&$("#fakeCondo").attr("disabled",false);if($("#condos-popup .condos-popup-content input:checked").length>0)a+=$("#condos-popup .condos-popup-content input:checked").length+" condos selected.";if(a=="")$("div.condosSelected").hide();else{$("div.condosSelected").show();$("div.condosSelected").text(a)}$(".propertyType input").attr("disabled",false);updateStepFields()}else $("#listingResultsCount").val()&&ShowDynamicResultsCount($("#resultsCount img").attr("id"),"resultsCount span","power")}function UpdateDynamicResultLabelForPowerSearch(a,b){if(!b)setTimeout("showResults('"+a+"')",1e3);else showResults(a)}function showResults(a){$("#resultsCount span").css("text-align","right");$("#resultsCount span").html("<h4 style='text-align:right;'>"+a+" "+$("#hdnDynamicCountMessage").val()+" </h4>");hideImage()}jQuery(document).ready(function(a){fakeLocInitialValue=a("#ddlPowerSearchFakeLoc").val();a("#ddlFakeNeighborhood").attr("disabled",true);a(".propertyType input").attr("disabled",true);a(".propertyType input").change(function(){checkDefault(this,"Property Type")});bindCondoFlyoutBits();a("div.col2 input:checkbox").change(launchAdditionalProperty);a(".col3 .element p").prepend("<span></span>").addClass("closedHdr");a(".col3 .element p.closedHdr").live("click",function(){a(this).removeClass("closedHdr").addClass("openHdr");a(this).next(".toggle").show();setfocusofsection(this)});a(".col3 .element p.openHdr").live("click",function(){if(a(this).next(".toggle").find("input:checkbox:checked").length==0&&a(this).next(".toggle").find("select").find("option:gt(0):selected").length==0){a(this).removeClass("openHdr").addClass("closedHdr");a(this).next(".toggle").hide();var c=a(this).parent().nextAll(".col3 .element").children("p.openHdr:first");if(c.html()!=null)setfocusofsection(c);else{var b=a(this).parent().prevAll(".col3 .element").children("p.openHdr:first");b.html()!=null&&setfocusofsection(b)}}});a(".col3 .openAll").live("click",function(){a(".col3 .toggle").show();a(".col3 .closedHdr").removeClass("closedHdr").addClass("openHdr");a(this).removeClass("openAll").addClass("closeAll");a(this).find(".words").text("Collapse All");setfocusofsection(a(".col3 .element:first p.openHdr"))});a(".col3 .closeAll").live("click",function(){a(".col3 .element p.openHdr").click();a(this).removeClass("closeAll").addClass("openAll");a(this).find(".words").text("Expand All")});a(".col3 .toggle").hide();a(".col3 .element:first p").click();a("div.col3 input").click(launchColumn3PropertyChange);a("div.col3 select").change(launchColumn3PropertyChange);var e=navigator.userAgent;if(a("#locationFlyOutBox input:first").val()!=""||a("#locationFlyOutBox input:checked").length>0)updatevalues();else FillDefaults();for(var d=false,c=a(".col3 .element p"),b=0;b<c.length;b++)if(a(c[b]).next(".toggle").find("input:checkbox:checked").length!=0||a(c[b]).next(".toggle").find("select").find("option:gt(0):selected").length!=0){a(c[b]).removeClass("closedHdr").addClass("openHdr");a(c[b]).next(".toggle").show();d=true}if(d)a(".col3 .element:visible:first p").hasClass("openHdr")&&a(".col3 .element:visible:first p").click()});function needUpdateFF(a){if(a&&a!="")location.href=a}function setfocusofsection(b){var a=$(b).next(".toggle").find("input,select");a.length&&a.length>0&&$(a[0]).focus()}function bindCondoFlyoutBits(){$("#fakeCondo").bind("mousedown",function(){$("#condos-popup").unbind();changedCondo=false;$("#condos-popup").css("margin-left","0px");var a=$("#fakeCondo").offset();try{var b,c;b=a.left-75;c=a.top-110;$("#condos-popup").css({left:b,top:c})}catch(d){$("#condos-popup").offset(a)}$(this).hide();showFlyoutModalPopup("condos-popup");$("#condos-popup").find(".modalContent").attr("class","");$("#fakeCondo").show();!ffmac()&&$("#fakeCondo").hide();FillCondosFlyout()});$("#condos-popup .select-btn,#condos-popup .popup-close-btn").bind("click",function(){$("select#fakeCondo").show();var a="";if($("#condos-popup .condos-popup-content input:checked").length>0)a+=$("#condos-popup .condos-popup-content input:checked").length+" condos selected.";if(a=="")$("div.condosSelected").hide();else{$("div.condosSelected").show();$("div.condosSelected").text(a)}changedCondo&&launchAdditionalProperty();$("#condos-popup").parent().find("div.modalBackground").attr("class","");hideModalPopUp($("#condos-popup"))});hideModalPopUp($("#condos-popup"))}function InitCondoFlyOutEvents(){$("#condos-popup .popup-top-links .selectAll").click(function(){var a=$(this).attr("checked");if(a==undefined)a=false;$("#condos-popup .condos-popup-content input:checkbox").attr("checked",a);changedCondo=true});$("#condos-popup .condos-popup-content input:checkbox").click(function(){changedCondo=true});$("#condos-popup .reset-link").click(function(){$("#condos-popup .condos-popup-content input:checkbox").attr("checked",false);$("#condos-popup .popup-top-links .selectAll").attr("checked",false);changedCondo=true})}function FillCondosFlyout(){if($("#hdnPowerLocationChange").val()=="Change"||$("#hdnPowerNeighborhoodChange").val()=="Change"){$("#spinnerIconCondo").css("display","block");var a=$("#locationFlyOutBox input[type=hidden]:first").val().split("-"),b={islandName:jQuery.trim(a[0]),regionName:jQuery.trim(a[1]),neighborhoods:GetSelectedNeighborhoodsList(),search:SearchID()};$("#hdnPowerDynamicPropertyCountPageType")!=null&&$("#hdnPowerDynamicPropertyCountPageType")!=undefined&&$("#hdnPowerDynamicPropertyCountPageType").val()!=""&&PageMethods.set_path($("#hdnPowerDynamicPropertyCountPageType").val());PageMethods.reset_Condos(b,OnSucceededCondosFlyOut,OnFailedXHR,listOfClientId)}}function OnSucceededCondosFlyOut(a){$("#condos-popup .condos-popup-content").html("");var g="",d="",b=0,c="",e,f=0;e=[];f=0;if(a.length>0){c=a[0][1].substring(0,1);for(i=0;i<a.length;i++){selectAlphabet=a[i][1].substring(0,1);if(selectAlphabet>="0"&&selectAlphabet<="9"){d+=GenerateCondosFlyOutRowsData(a[i][0],a[i][1],b,"0",a[i][2]);if(c!="0")c="0";b++}else if(selectAlphabet==c){d+=GenerateCondosFlyOutRowsData(a[i][0],a[i][1],b,selectAlphabet,a[i][2]);b++}else{if(b!=0){e[f]=c;f++}d=GenerateCondosFlyOutEndFilterTextTable(b,c,d);b=0;c=a[i][1].substring(0,1);d+=GenerateCondosFlyOutRowsData(a[i][0],a[i][1],b,c,a[i][2]);b++}if(a.length==i+1){if(b!=0){e[f]=c;f++}d=GenerateCondosFlyOutEndFilterTextTable(b,c,d)}}g=d;$("#condos-popup .condos-popup-content").append(g);$("#condos-popup #glossaryLinks li").attr("disabled","disabled");$("#condos-popup #glossaryLinks li a").css("color","#959595");if(e.length>0)for(j=0;j<e.length;j++){$("#liFilteringText"+e[j]+"Condo").removeAttr("disabled");$("#FilteringLink"+e[j]+"Condo").removeAttr("style")}}else{$("#condos-popup #glossaryLinks li").attr("disabled","disabled");$("#condos-popup #glossaryLinks li a").css("color","#959595")}var h={search:SearchID()};if($("#condos-popup .condos-popup-content input[type=checkbox]:[checked=false]").length==0)$("#condos-popup .selectAll").attr("checked",true);else $("#condos-popup .selectAll").attr("checked",false);if($("#hdnPowerNeighborhoodChange").val()=="Change"){FillDefaults();clearDynamicSearchCount();if(IsMetroRegionCondoSelected())setTimeout("execSearch()",1e3);else execSearch()}InitCondoFlyOutEvents();$("#hdnPowerNeighborhoodChange").val("UnChange");$("#hdnPowerLocationChange").val("UnChange");$("#spinnerIconCondo").css("display","none")}function GenerateCondosFlyOutRowsData(e,c,b,a,d){tabldcondocheckboxesfilter="";if(b==0)if(a=="0")tabldcondocheckboxesfilter="<table ~widthfor"+a+' id="condotablefor'+a+'"><tbody><tr><th colspan="3">1-9</th></tr><tr><td class="glossaryData">';else tabldcondocheckboxesfilter="<table ~widthfor"+a+' id="condotablefor'+a+'"><tbody><tr><th colspan="3">'+a+'</th></tr><tr><td class="glossaryData">';else tabldcondocheckboxesfilter="<td>";tabldcondocheckboxesfilter+="<table><tbody><tr><td>";if(d=="true")tabldcondocheckboxesfilter+='<input type="checkbox" checked="true" id="condocheckbox'+a+"_"+b+'" class="condos-checkbox" name="chkbox">';else tabldcondocheckboxesfilter+='<input type="checkbox" id="condocheckbox'+a+"_"+b+'" class="condos-checkbox" name="chkbox">';tabldcondocheckboxesfilter+='<input type="hidden" value="'+e+'" id="hdnlblCondoId'+a+"_"+b+'"><input type="hidden" value="'+c+'" id="hdnlblCondoName'+a+"_"+b+'" name=""></td><td><label for="condocheckbox'+a+"_"+b+'" style="line-height:inherit;">'+c+"</label></td></tr></tbody></table></td>";if((b+1)%MaxNoOfColumnsInRow==0)tabldcondocheckboxesfilter+="</tr><tr>";return tabldcondocheckboxesfilter}function GenerateCondosFlyOutEndFilterTextTable(b,c,a){if(b<MaxNoOfColumnsInRow)a=a.replace("~widthfor"+c,"style='width:495px;'");else a=a.replace("~widthfor"+c,"");if(b%MaxNoOfColumnsInRow!=0)a+="<td>&nbsp;</td>";a+="</table>";return a}function showStep2(){$("#prudential-bg").addClass("prudential-bg");$(".step2").css("visibility","visible");$("#introContainer").hide();showHideMauiFields()}var minmaxObj;function MinMax(a){minmaxObj=a;if(IsMetroRegionCondoSelected())setTimeout("MinMaxContinue()",1e3);else MinMaxContinue()}function MinMaxContinue(){var e=minmaxObj,a=$(e).parent("div"),d=Number($(a).children("select:first").val()),c=Number($(a).children("select:eq(1)").val()),f=$(a).children("select:first").attr("id")==e.id;try{if(d>c&&c>0){f?$(a).children("select:eq(1)").children("option:[value="+d+"]").attr("selected","true"):$(a).children("select:first").children("option:[value="+c+"]").attr("selected","true");try{var b=$('<div style="display: none">Minimum should be less than maximum.</div>');b.click(function(){$(this).dialog("close")});b.bind("mouseleave",function(){$(this).dialog("close")});b.dialog({title:"Tip",position:[$(a).offset().left,$(a).offset().top],minHeight:80});b.focus()}catch(g){}}FillDefaults();clearDynamicSearchCount();execSearch()}catch(g){}}function launchBaseProperty(){FillDefaults();clearDynamicSearchCount();execSearch()}function launchAdditionalProperty(){FillDefaults();clearDynamicSearchCount();execSearch()}function launchColumn3PropertyChange(){FillDefaults();clearDynamicSearchCount();execSearch()}function resultsWarning(l,j,e,f){try{var g=$("#resultsCount span").text().replace(/,/g,"").replace(/ /g,""),d=Number(g.replace($("#hdnDynamicCountMessage").val().replace(/,/g,"").replace(/ /g,""),"")),i=$("#resultsCount span").text().replace($("#hdnDynamicCountMessage").val(),"").replace(/ /g,""),b=$("#"+e).offset().left-$(document).scrollLeft(),c=$("#"+e).offset().top-$(document).scrollTop();if(Number(d)>0){var k=f?"Too many results on a Map":"Too many results",h=f?"We can only display 400 results at a time on the map!  Please select more search criteria and try again":"Your search resulted in "+i+" results.  MLS rules only allow us to return  400 results at one time,  please narrow your search by selecting more search criteria and try again";if(Number(d)>j){var a=$('<div style="display: none">'+h+"</div>");a.click(function(){$(this).dialog("close")});a.bind("mouseleave",function(){$(this).dialog("close");return false});a.dialog({title:"Can not continue.",position:[b,c],minHeight:80});a.focus();return false}else return true}else{var a=$('<div style="display: none">No properties match your search!  Please expand your search criteria and try again.</div>');a.click(function(){$(this).dialog("close")});a.bind("mouseleave",function(){$(this).dialog("close");return false});a.dialog({title:"No Results",position:[b,c],minHeight:150});a.focus();return false}}catch(m){var a=$('<div style="display: none">No properties match your search!  Please expand your search criteria and try again.</div>');a.click(function(){$(this).dialog("close")});a.bind("mouseleave",function(){$(this).dialog("close");return false});a.dialog({title:"No Results",position:[b,c],minHeight:150});a.focus();return false}}function ffmac(){var a=0,b=navigator.userAgent;if(b.indexOf("Mac OS X")>-1)a++;if(b.indexOf("Firefox")>-1)a++;return a==2?true:false}function clearDynamicSearchCount(){jQuery.trim($("#resultsCount span").html())!=""&&$("#resultsCount span").html("<h4 style='text-align:right;'>"+$("#hdnDynamicCountMessage").val()+" </h4>")}function IsMetroRegionCondoSelected(){var d=$("#locationFlyOutBox input[type=hidden]:first").val().split("-"),b=GetCheckboxValue(".propertyType input:eq(1)"),a=GetCheckboxValue(".propertyType input:eq(2)"),c=jQuery.trim(d[1]);return c.toLowerCase()=="metro"&&(b||a)?true:false}function execSearch(){if(IsMetroRegionCondoSelected())setTimeout("execSearchContinue()",1e3);else execSearchContinue()}function execSearchContinue(){$("#resultsCount img").css("visibility","visible");$("#noNeedUpdate").attr("checked",true);var db=new Array(2),j=$("#locationFlyOutBox input[type=hidden]:first").val().split("-"),ub=jQuery.trim(j[0]),vb=jQuery.trim(j[1]),D=GetSelectedNeighborhoodsList(),t=GetCheckboxValue(".propertyType input:eq(0)"),M=GetCheckboxValue(".propertyType input:eq(1)"),E=GetCheckboxValue(".propertyType input:eq(2)"),v=GetCheckboxValue(".propertyType input:eq(3)"),x=GetCheckboxValue(".propertyType input:eq(4)"),h=$("#"+listOfClientId.minPrice+" :selected").val();if(h==undefined)h=0;var g=$("#"+listOfClientId.maxPrice+" :selected").val();if(g==undefined)g=0;var qb=GetBedrooms(),nb=GetBathrooms(),gb=GetCheckboxValue("#"+listOfClientId.statusActive),mb=GetCheckboxValue("#"+listOfClientId.statusSold),lb=GetSelectValue("#"+listOfClientId.soldWithin),c=GetcbValue("#"+listOfClientId.interiorAreaMin+" option:selected");if(c==undefined)c=0;var b=GetcbValue("#"+listOfClientId.interiorAreaMax+" option:selected");if(b==undefined)b=0;var e=GetcbValue("#"+listOfClientId.landAreaMin+" option:selected");if(e==undefined)e=0;var d=GetcbValue("#"+listOfClientId.landAreaMax+" option:selected");if(d==undefined)d=0;var S=GetCheckboxValue("#"+listOfClientId.tenureFeeSimple),T=GetCheckboxValue("#"+listOfClientId.tenureLeasehold),f=GetcbValue("#"+listOfClientId.yearBuilt+" option:selected");if(f==undefined)f=0;var i=GetPropertyCondition(),o=GetCheckboxValue(".singleFamilyDisplay input:eq(0)"),m=GetCheckboxValue(".singleFamilyDisplay input:eq(1)"),n=GetCheckboxValue(".singleFamilyDisplay input:eq(2)"),k=GetCheckboxValue(".singleFamilyDisplay input:eq(3)"),N=GetCheckboxValue(".singleFamilyDisplay input:eq(4)"),Y=GetSelectedCondosList(),J=GetCheckboxValue("#"+listOfClientId.condoFeaturesPool),q=GetCheckboxValue("#"+listOfClientId.condoFeaturesPetFriendly),r=GetCheckboxValue("#"+listOfClientId.condoFeaturesWasherDryer),C=GetCheckboxValue("#"+listOfClientId.condoFeaturesSecurity),a=Number(GetSelectValue("#"+listOfClientId.parking)),z=a==0,A=a==1,B=a==2,l=a>=3,L=GetSelectValue("#"+listOfClientId.maintenanceFeeMin),K=GetSelectValue("#"+listOfClientId.maintenanceFeeMax),sb=GetSelectValue("#"+listOfClientId.floorMin),rb=GetSelectValue("#"+listOfClientId.floorMax),ib=GetCheckboxValue("#"+listOfClientId.foreclosure),ob=GetCheckboxValue("#"+listOfClientId.shortsale),O=GetCheckboxValue("#"+listOfClientId.openHouseShowAll),u=GetCheckboxValue("#"+listOfClientId.openHouseShowWeeklyOnly),w=GetCheckboxValue("#"+listOfClientId.openHouseShowTodayOnly),H=GetSelectValue("#"+listOfClientId.priceReducedByValue),s=GetSelectValue("#"+listOfClientId.priceReducedByPercentage),jb=GetSelectValue("#"+listOfClientId.newOnMarket),P=GetSelectValue("#"+listOfClientId.schoolElementary),eb=GetSelectValue("#"+listOfClientId.schoolJunior),fb=GetSelectValue("#"+listOfClientId.schoolSenior),pb=GetCheckboxValue("#"+listOfClientId.viewOcean),ab=GetCheckboxValue("#"+listOfClientId.viewGolfCourse),hb=GetCheckboxValue("#"+listOfClientId.viewMountain),U=GetCheckboxValue("#"+listOfClientId.viewDiamondHead),V=GetCheckboxValue("#"+listOfClientId.viewMarinaCanal),tb=GetCheckboxValue("#"+listOfClientId.viewCity),F=GetCheckboxValue("#"+listOfClientId.frontagePreservation),cb=GetCheckboxValue("#"+listOfClientId.frontageOcean),bb=GetCheckboxValue("#"+listOfClientId.frontageBeach),Z=GetCheckboxValue("#"+listOfClientId.frontageMarina),I=GetCheckboxValue("#"+listOfClientId.frontageGolfCourse),G=GetCheckboxValue("#"+listOfClientId.frontageStreamCanal),W=GetCheckboxValue("#"+listOfClientId.waterfrontBeach),X=GetCheckboxValue("#"+listOfClientId.waterfrontOcean),p=GetCheckboxValue("#"+listOfClientId.waterfrontStreetFromOcean),Q=GetCheckboxValue("#"+listOfClientId.waterFrontMarina),wb=0,R=$("#"+listOfClientId.sellerFinancing).val(),y=$("#"+listOfClientId.shortTermRentalAllowed).val(),kb=listOfClientId,db={search:SearchID(),island:ub,region:vb,minPrice:h,maxPrice:g,neighborhoodsSelected:D,tenureFeeSimple:S,tenureLeasehold:T,statusActive:gb,statusSold:mb,soldWithin:lb,propertyTypeSingleFamily:t,propertyTypeCondo:M,propertyTypeTownhouse:E,propertyTypeMultiFamily:v,propertyTypeVacantLand:x,homeFeaturesOhanaDwelling:o,homeFeaturesOhanaAttached:m,homeFeaturesOhanaDetached:n,homeFeaturesSingleLevelHome:k,homeFeaturesPool:N,PropertyCondition:i,condosSelected:Y,condoFeaturesPool:J,condoFeaturesPetFriendly:q,condoFeaturesWasherDryer:r,condoFeaturesSecurity:C,condoFeaturesParking0:z,condoFeaturesParking1:A,condoFeaturesParking2:B,condoFeaturesParking3Plus:l,condoFeaturesPropertyCondition:i,maintenanceFeeMin:L,maintenanceFeeMax:K,floorMin:sb,floorMax:rb,bedrooms:qb,bathrooms:nb,interiorAreaMin:c,interiorAreaMax:b,landAreaMin:e,landAreaMax:d,foreclosure:ib,shortsale:ob,openHouseShowAll:O,openHouseShowWeeklyOnly:u,openHouseShowTodayOnly:w,priceReducedByValue:H,priceReducedByPercentage:s,viewOcean:pb,viewGolfCourse:ab,viewMountain:hb,viewDiamondHead:U,viewMarinaCanal:V,viewCity:tb,frontagePreservation:F,frontageOcean:cb,frontageBeach:bb,frontageMarina:Z,frontageGolfCourse:I,frontageStreamCanal:G,newOnMarket:jb,schoolElementary:P,schoolJunior:eb,schoolSenior:fb,yearBuilt:f,waterfrontBeach:W,waterfrontOcean:X,waterfrontStreetFromOcean:p,waterFrontMarina:Q,sellerFinancing:R,shortTermRentalAllowed:y};try{PageMethods.set_path($("#hdnPowerDynamicPropertyCountPageType").val());PageMethods.update_PowerSearchCount(db,OnSucceededPowerSearch,OnFailed,kb)}catch(xb){alert("An error has occurred. Please try again")}}function hideImage(){$("#resultsCount img").css("visibility","hidden");$("#resultsCount img").css("padding-left","88px")}function OnFailed(a){a!==null}function OnSucceededPowerSearch(a,d,c){if(c=="update_PowerSearchCount"){if(a!=0)if($("#listingResultsCount").val()==""){$("#listingResultsCount").val(a);ShowDynamicResultsCount($("#resultsCount img").attr("id"),"resultsCount span","power")}else{$("#listingResultsCount").val(a);UpdateDynamicResultLabelForPowerSearch(a,false)}else if($("#listingResultsCount").val()=="")ShowDynamicResultsCount($("#resultsCount img").attr("id"),"resultsCount span","power");else UpdateDynamicResultLabelForPowerSearch(0,false);var b={search:SearchID()};PageMethods.get_SearchCriteria(b,OnSucceededPowerSearch,OnFailed)}else $("#debug_criteria").text(a)}function GetSelectedNeighborhoodsList(){for(var b=[],c=$("#neighbor-popup input:checked").length,a=0;a<c;a++)$($("#neighbor-popup input:checked")[a]).attr("id")!=null&&$($("#neighbor-popup input:checked")[a]).attr("id").indexOf("chkSelectAll")==-1&&b.push({id:jQuery.trim($($("#neighbor-popup input:checked")[a]).parent().siblings("input[type=hidden]")[0].value),name:jQuery.trim($($("#neighbor-popup input:checked")[a]).parent().siblings("input[type=hidden]")[1].value)});return b}function GetCheckboxValue(b){var a=$(b).attr("checked");if(a==undefined)a=false;return a}function GetBedrooms(){return $("#"+listOfClientId.bedroom+" option:selected").val()+","+$("#"+listOfClientId.bedroom+" ~ select").val()}function GetBathrooms(){return $("#"+listOfClientId.bathroom+" option:selected").val()+","+$("#"+listOfClientId.bathroom+" ~ select").val()}function GetcbValue(a){return $(a).val()}function GetPropertyCondition(){var a=[],b=$(".singleFamCondoDisplay input:checked").length;$(".singleFamCondoDisplay input:checked").each(function(){a.push($(this).val())});return a}function GetSelectedCondosList(){var b=$("#condos-popup .condos-popup-content input:[type=checkbox]:checked").length,a=[];$("#condos-popup .condos-popup-content input:[type=checkbox]:checked").each(function(){a.push({id:"0",name:$(this).parent().find("input:[type=hidden]:first").next().val()})});return a}function GetSelectValue(a){return $(a+" option:selected").val()}function HandleBrowserScrollForCondo(a){a="condotablefor"+a;handleBrowserScrollFlagCondo="true";yPosCondo=$(window).scrollTop();if($("#"+a).length>=1){var b="condos-popup",c=$("#"+b).find("#glossarycondo").attr("id");$("#"+b+" #"+c).scrollTop($("#"+a)[0].offsetTop);$(window).scrollTop(yPosCondo)}};
