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