function homeRadiusOff(){var $selector;
if($("#agentSearch").css("display")=="none"){$selector=$("#propertySearch")
}else{$selector=$("#agentSearch")
}var countryId=$selector.find(".countryHiddenSelect").val();
switch(countryId){case"9":$selector.find(".selectRadiusDropDownChoice .dropdownTitle span").html("0 Km.");
$selector.find("#radius01.sprite-text-indent").css("background-position","-100px -51px");
$selector.find("#radius01Hover.sprite-text-indent").css("background-position","-100px 0");
$selector.find(".selectRadiusDropDownChoice .dropdownWrapper").css("visibility","visible");
$(".MLSSpan").html("ID #");
break;
case"1":$selector.find(".selectRadiusDropDownChoice .dropdownTitle span").html("0 Ml.");
$selector.find("#radius01.sprite-text-indent").css("background-position","-100px -51px");
$selector.find("#radius01Hover.sprite-text-indent").css("background-position","-100px 0");
$selector.find(".selectRadiusDropDownChoice .dropdownWrapper").css("visibility","visible");
$(".MLSSpan").html("MLS #");
break;
default:$selector.find("#radius01.sprite-text-indent").css("background-position","-665px -161px");
$selector.find("#radius01Hover.sprite-text-indent").css("background-position","-665px -161px");
$selector.find(".selectRadiusDropDownChoice .dropdownWrapper").css("visibility","hidden");
$(".MLSSpan").html("ID #");
break
}}var homesearch=new tabgroup();
homesearch.onTabAgents=function(){globalautocomplete.checkInit("agent","home");
homeRadiusOff();
var agentLocation=$("#agentLocation .mainSearchInput").val();
var cookie_freeTextAddress=$.cookie("freeTextAddress");
cookie_freeTextAddress=(cookie_freeTextAddress.charAt(0)=='"')?cookie_freeTextAddress.substring(1):cookie_freeTextAddress;
cookie_freeTextAddress=(cookie_freeTextAddress.charAt(cookie_freeTextAddress.length-1)=='"')?cookie_freeTextAddress.substring(0,cookie_freeTextAddress.length-1):cookie_freeTextAddress;
if(homesearch.backTab=="properties"&&agentLocation!=cookie_freeTextAddress){$("#agentLocation .mainSearchInput").val($("#propertyLocation .mainSearchInput").val())
}};
homesearch.onTabOffice=function(){globalautocomplete.checkInit("office","home");
homeRadiusOff();
var officeLocation=$("#officeLocation .mainSearchInput").val();
var cookie_freeTextAddress=$.cookie("freeTextAddress");
cookie_freeTextAddress=(cookie_freeTextAddress.charAt(0)=='"')?cookie_freeTextAddress.substring(1):cookie_freeTextAddress;
cookie_freeTextAddress=(cookie_freeTextAddress.charAt(cookie_freeTextAddress.length-1)=='"')?cookie_freeTextAddress.substring(0,cookie_freeTextAddress.length-1):cookie_freeTextAddress;
if(homesearch.backTab=="properties"&&officeLocation!=cookie_freeTextAddress){$("#officeLocation .mainSearchInput").val($("#propertyLocation .mainSearchInput").val())
}};
var homesearchfunc={addTabs:function(){homesearch.addTab("properties","homesearchTabsProperties","propertySearch");
homesearch.addTab("agents","homesearchTabsAgents","agentSearch");
homesearch.addTab("offices","homesearchTabsOffices","officeSearch")
},submitProperty:function(e){alert(e.keyCode)
}};
var homesearchgraphics={agentOfficeGlowing:false,propertyGlowing:false,glowingSpeed:800,propertyAutocompleting:false,agentAutocompleting:false,officeAutocompleting:false,initMoreOptions:function(){$("div#propertiesMoreOptions div#moreOptionsComponent img.lessOptionsImage").removeClass("hidden")
},initGlowingSearchButtons:function(){$("#propertyTopRow .searchHomeShowResults").mouseover(function(){$("#propertyFormHomeWrapper select, #propertyFormHomeWrapper input").unbind("change")
});
$("#agentTopRow .searchHomeShowResults").mouseover(function(){$("#agentFormHomeWrapper select, #agentFormHomeWrapper input").unbind("change")
});
$("#agentTopRow .searchHomeShowResults").mouseout(function(){homesearchgraphics.bindGlowingButtonEvents("agent")
});
$("#propertyTopRow .searchHomeShowResults").mouseout(function(){homesearchgraphics.bindGlowingButtonEvents("property")
});
homesearchgraphics.bindGlowingButtonEvents("agent");
homesearchgraphics.bindGlowingButtonEvents("property")
},bindGlowingButtonEvents:function(type){if(type=="agent"){$("#agentFormHomeWrapper select, #agentFormHomeWrapper input").change(function(){if(!homesearchgraphics.agentOfficeGlowing){homesearchgraphics.searchButtonsGlow("agentsOffices");
homesearchgraphics.agentOfficeGlowing=true
}if(!$.cookie("showedSearchBtnTooltip")){rollover.clickfadeOn("searchBtnTooltip");
setTimeout('rollover.clickfadeOff("searchBtnTooltip")',5000);
$.cookie("showedSearchBtnTooltip",true)
}})
}else{if(type=="property"){$("#propertyFormHomeWrapper select, #propertyFormHomeWrapper input").change(function(){if(!homesearchgraphics.propertyGlowing){homesearchgraphics.searchButtonsGlow("property");
homesearchgraphics.propertyGlowing=true
}if(!$.cookie("showedSearchBtnTooltip")){rollover.clickfadeOn("searchBtnTooltip");
setTimeout('rollover.clickfadeOff("searchBtnTooltip")',5000);
$.cookie("showedSearchBtnTooltip",true)
}})
}}},searchButtonsGlow:function(type){if(type=="agentsOffices"){rollover.clickfadeOn("agentOfficeListButton");
rollover.clickfadeOn("agentOfficeMapButton");
setTimeout('homesearchgraphics.searchButtonsUnglow("agentsOffices")',homesearchgraphics.glowingSpeed)
}else{if(type=="property"){rollover.clickfadeOn("propertyListButton");
rollover.clickfadeOn("propertyMapButton");
setTimeout('homesearchgraphics.searchButtonsUnglow("property")',homesearchgraphics.glowingSpeed)
}}},searchButtonsUnglow:function(type){if(type=="agentsOffices"){rollover.clickfadeOff("agentOfficeListButton");
rollover.clickfadeOff("agentOfficeMapButton");
setTimeout('homesearchgraphics.searchButtonsGlow("agentsOffices")',homesearchgraphics.glowingSpeed)
}else{if(type=="property"){rollover.clickfadeOff("propertyListButton");
rollover.clickfadeOff("propertyMapButton");
setTimeout('homesearchgraphics.searchButtonsGlow("property")',homesearchgraphics.glowingSpeed)
}}},initTooltips:function(){if(!outdatedBrowser.isIE7){if(!$.cookie("showedSearchFieldTooltip")){$("#homesearch .mainSearchInput").focus(function(){if(!$.cookie("showedSearchFieldTooltip")){rollover.clickfadeOn("searchFieldTooltip");
setTimeout('rollover.clickfadeOff("searchFieldTooltip")',5000);
$.cookie("showedSearchFieldTooltip",true)
}})
}}}};
$(document).ready(function(){homesearchfunc.addTabs();
homesearch.setCurrentTab("properties",false);
homesearchgraphics.initMoreOptions();
globalautocomplete.checkInit("property","home");
$("input.homeSearchProperty").keypress(function(e){if(e.keyCode==13){$("#propertySearchButton a").trigger("click")
}});
$("input.homeSearchAgent").keypress(function(e){if(e.keyCode==13){$("#agentSearchButton a").trigger("click")
}});
$("input.homeSearchOffice").keypress(function(e){if(e.keyCode==13){$("#officeSearchButton a").trigger("click")
}});
homeRadiusOff()
});
