function setBedroomsState(n,t,i){disableControlConditionalMultiselect(n,t,i)}function disableControlConditionalMultiselect(n,t,i){var r=MultiselectDropdown.getSelectedValues(n),u;r===null&&(r=[]),u=r.length>0,$.each(r,function(n,t){var r=!1;$.each(i.split(","),function(n,i){if(t===i)return r=!0,!1}),r||(u=!1)}),$(t).each(function(){var t=$(this),i=t.attr("disabled");u&&!i&&(t.attr("type")==="select-one"&&t.attr("selectedIndex",0),disableSelect(this)),!u&&i&&enableSelect(this)})}function disableControlConditional(n,t,i){var f=$(n).val().replace("+"," "),r=$("select#136"),e=$("select#135"),u;r.length>0&&e.length>0&&(f==="Retirement villages"?(r.attr("selectedIndex",0),r.attr("disabled","disabled")):e.get(0).selectedIndex>0&&r.removeAttr("disabled")),u=!1,$.each(i.split(","),function(n,t){if(f===t)return u=!0,!1}),$('[name="'+t+'"]').each(function(){var t=$(this),i=t.attr("disabled");u&&!i&&(t.attr("type")==="select-one"&&t.attr("selectedIndex",0),disableSelect(this)),!u&&i&&enableSelect(this)})}function cascadeDdls(n,t,i,r,u){var h=$("#"+r),e=document.getElementById(u),w=e.options[0].text,a,f,s,o,y,p;if(h.length===0||h.val()==="")e.disabled||(e.disabled=!0),e.options.length=1;else{for(a=h[0].options[h[0].selectedIndex].value,f=1;f<=t.length;f++)if(t[f][1]==a){iCurrSource=f;break}if(n[iCurrSource]===null)e.options.length=1,e.disabled||(e.disabled=!0);else{e.disabled&&(e.disabled=!1),s=[];for(destArrLoop in n[iCurrSource])s[destArrLoop]=destArrLoop;sortedOptions=[],sortIndex=0;for(iLoop in s)s[iLoop]!==null&&(sortedOptions[sortIndex]=s[iLoop],sortIndex=sortIndex+1);for(o=new Array(sortIndex),f=0;f<sortIndex;f++)o[f]=new Array(1),o[f][0]=i[sortedOptions[f]][0],o[f][1]=i[sortedOptions[f]][1];e.options.length=1;var v="selected_"+u,c=$("#"+v),l=0;for(f=0;f<o.length;f++)c.length>0&&c.val()!==""&&c.val()==o[f][1]&&(l=f+1),o[f][0]&&(e.options[f+1]=new Option(o[f][0],o[f][1],!1,!1));if(e.options[l].selected=!0,v==="selected_84"&&l===0&&c.val()!==""&&(y=removeWhiteSpaces($("#searchType option:selected").text()),$("#CategoryNavigator_CategoryPlaceholder").length===0))for(f=0;f<e.options.length;f++)if(p=removeWhiteSpaces(e.options[f].text),y==p){e.options[f].selected=!0;break}}}}function removeWhiteSpaces(n){return $.trim(n).replace(/\xA0/g,"")}function getBitArray(n){var t=[];for(iLoop=0;iLoop<n.length;iLoop++)t[n[iLoop]]=1;return t}