function addEvent(b,a,c){if(b.addEventListener){b.addEventListener(a,c,false);}else{if(b.attachEvent){b.attachEvent("on"+a,c);}else{throw"Unable to add event listener for '"+b.id+"'";}}}function launchwin(b,a,c){shortlistWin=window.open(b,a,c);shortlistWin.focus();}function stopAction(a){if(typeof(a.preventDefault)!="undefined"){a.preventDefault();}else{a.returnValue=false;}if(typeof(a.cancelBubble)!="undefined"){a.cancelBubble=true;}}function toggleMessage(b){var a=b.parentNode.parentNode;if(b.checked==true){a.className+=" expanded";}else{a.className=b.parentNode.className.replace(/expanded/,"");}}function toggleDisplay(b,c){var a=$$(b);if(a){a.each(function(d,e){var f="";if(typeof(c)!="boolean"){c=(d.getStyle("display")=="none");}f=c?"block":"none";d.setStyle("display",f);});}}function resizeElementOnOverflow(c,b,d){if(!c){return;}var a=window.getSize();if(a.y<b){if(!isNaN(d)&&(d<1)){d=Math.floor(a.y*d);}if(typeof document.body.style.maxHeight!="undefined"){c.setStyle("max-height",d+"px");}else{if(c.scrollHeight>0&&c.scrollHeight<d){d=c.scrollHeight;}c.setStyle("height",d+"px");}c.setStyle("overflow","auto");}}function getSingleElemBySelector(a){if(!window["$$"]){return;}var b=$$(a);if(b&&(b.length>0)){b=b[0];}return b;}function RemoveFromShortList(b,a,d){if(AjaxHost.RemoveFromShortList(b).Value){var c=$(a);c.innerHTML='<a href="javascript:void(0);" id="addToShortlistLink'+b+'" '+((d)?'class="iconAdd btnTxt"':"")+'onclick="javascript:AddToShortList('+b+",'"+a+"',"+d+');return false;">Add to shortlist</a>';}else{alert("Unable to remove listing from shortlist");}}function AddToShortList(b,a,d){if(AjaxHost.AddToShortList(b).Value){var c=$(a);c.innerHTML='<a href="javascript:void(0);" id="removeFromShortlistLink'+b+'" '+((d)?'class="iconDelete btnTxt"':"")+'onclick="javascript:RemoveFromShortList('+b+",'"+a+"',"+d+');return false;">Remove from shortlist</a>';}else{alert("Unable to add listing to shortlist");}}if(!window.Domain){Domain={};}if(!Domain.SearchLightboxClient){Domain.SearchLightboxClient=function(f,i,h,l,g){var d=false;var a=i;var e=h;var c=l;var b=g;var j=0.7;var k=800;this.init=function(){resizeElementOnOverflow(getSingleElemBySelector(f),k,j);if(d){return;}$(c).addEvent("click",function(m){toggleDisplay(a,$(c).checked);});toggleDisplay(a,$(c).checked);bindButtonToTextbox(e,b);d=false;};};}if(!Domain.HomeAlertLightboxClient){Domain.HomeAlertLightboxClient=function(c){var b=0.7;var a=800;this.init=function(){resizeElementOnOverflow(getSingleElemBySelector(c),a,b);};};}if(typeof(Sys)!=="undefined"){Sys.Application.notifyScriptLoaded();}
