function globalRadiusOff(){var $selector;
if($("#globalPropertySearch").css("display")=="none"){$selector=$("#globalPropertySearch")
}else{$selector=$("#globalAgentsOfficesSearch")
}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");
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");
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");
break
}}var globalsearch=new tabgroup();
globalsearch.onTabProperty=function(){globalsearch.checkAgentMoreOptions();
globalautocomplete.checkInit("property","global");
setTimeout("globalRadiusOff()",700)
};
globalsearch.onTabAgents=function(){globalsearch.checkAgentMoreOptions();
globalautocomplete.checkInit("agent","global");
var globalAgentLocation=$("#globalAgentLocation .mainSearchInput").val();
if(globalsearch.backTab!="agentsoffices"&&globalAgentLocation==""){$("#globalAgentLocation .mainSearchInput").val($("#globalPropertyLocation .mainSearchInput").val())
}globalRadiusOff()
};
globalsearch.onTabSavedItems=function(){if(typeof(saveditems)!="undefined"){saveditems.populateTab()
}globalsearch.checkAgentMoreOptions()
};
globalsearch.checkAgentMoreOptions=function(){var selectAgentOffice=$("#formTypeOption input").val();
if(selectAgentOffice=="Office"){rollover.clickfadeOn("agentMoreOptionsBtn")
}else{}};
var globalsearchfunc={addTabs:function(){globalsearch.addTab("properties","globalsearchTabsProperties","globalPropertySearch");
globalsearch.addTab("agentsoffices","globalsearchTabsAgentsOffices","globalAgentsOfficesSearch");
globalsearch.addTab("saveditems","globalsearchTabsSavedItems","globalSavedItems");
globalsearchfunc.updateMoreOptionsImage()
},updateAgentFreeTextAdress:function(){$("div#globalAgentSearchField .mainSearchInput").val($("div#globalPropertyLocation .mainSearchInput").val())
},updatePropertyFreeTextAdress:function(){$("div#globalPropertyLocation .mainSearchInput").val($("div#globalAgentSearchField .mainSearchInput").val())
},updatePropertyFreeTextAdress:function(){$("div#globalPropertyLocation .mainSearchInput").val($("div#globalAgentSearchField .mainSearchInput").val())
},updateMoreOptionsImage:function(){globalfunc.checked("pr");
globalfunc.checked("of");
globalgraphics.changeMoreOptionsPosition()
}};
var globalsearchgraphics={propertyGlowing:false,agentOfficeGlowing:false,glowingSpeed:800,propertyAutocompleting:false,agentAutocompleting:false,initGlowingSearchButtons:function(){$("#globalPropertySearchField #propertyListButton input, #globalPropertySearchField #propertyMapButton input").mouseover(function(){$("#globalPropertySearch select, #globalPropertySearch input").unbind("change")
});
$("#globalAgentSearchField #agentOfficeListButton input, #globalAgentSearchField #agentOfficeMapButton input").mouseover(function(){$("#globalAgentsOfficesSearch select, #globalAgentsOfficesSearch input").unbind("change")
});
$("#globalAgentSearchField #agentOfficeListButton input, #globalAgentSearchField #agentOfficeMapButton input").mouseout(function(){globalsearchgraphics.bindGlowingButtonEvents("agent")
});
$("#globalPropertySearchField #propertyListButton input, #globalPropertySearchField #propertyMapButton input").mouseout(function(){globalsearchgraphics.bindGlowingButtonEvents("property")
});
globalsearchgraphics.bindGlowingButtonEvents("agent");
globalsearchgraphics.bindGlowingButtonEvents("property")
},bindGlowingButtonEvents:function(type){if(type=="agent"){$("#globalAgentsOfficesSearch select, #globalAgentsOfficesSearch input").change(function(){if(!globalsearchgraphics.agentOfficeGlowing){globalsearchgraphics.searchButtonsGlow("agentsOffices");
globalsearchgraphics.agentOfficeGlowing=true
}if(!$.cookie("showedSearchBtnTooltip")){rollover.clickfadeOn("searchBtnTooltip");
setTimeout('rollover.clickfadeOff("searchBtnTooltip")',5000);
$.cookie("showedSearchBtnTooltip",true)
}})
}else{if(type=="property"){$("#globalPropertySearch select, #globalPropertySearch input").change(function(){if(!globalsearchgraphics.propertyGlowing){globalsearchgraphics.searchButtonsGlow("property");
globalsearchgraphics.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('globalsearchgraphics.searchButtonsUnglow("agentsOffices")',globalsearchgraphics.glowingSpeed)
}else{if(type=="property"){rollover.clickfadeOn("propertyListButton");
rollover.clickfadeOn("propertyMapButton");
setTimeout('globalsearchgraphics.searchButtonsUnglow("property")',globalsearchgraphics.glowingSpeed)
}}},searchButtonsUnglow:function(type){if(type=="agentsOffices"){rollover.clickfadeOff("agentOfficeListButton");
rollover.clickfadeOff("agentOfficeMapButton");
setTimeout('globalsearchgraphics.searchButtonsGlow("agentsOffices")',globalsearchgraphics.glowingSpeed)
}else{if(type=="property"){rollover.clickfadeOff("propertyListButton");
rollover.clickfadeOff("propertyMapButton");
setTimeout('globalsearchgraphics.searchButtonsGlow("property")',globalsearchgraphics.glowingSpeed)
}}},initTooltips:function(){if(!$.cookie("showedSearchFieldTooltip")){$("#globalsearch .mainSearchInput").focus(function(){if(!$.cookie("showedSearchFieldTooltip")){rollover.clickfadeOn("searchFieldTooltip");
setTimeout('rollover.clickfadeOff("searchFieldTooltip")',5000);
$.cookie("showedSearchFieldTooltip",true)
}})
}}};
$(document).ready(function(){globalsearchgraphics.initGlowingSearchButtons();
globalsearchgraphics.initTooltips();
if(globalsearch.currentTab=="properties"){globalautocomplete.checkInit("property","global")
}else{if(globalsearch.currentTab=="agentsoffices"){globalautocomplete.checkInit("agent","global")
}}globalRadiusOff()
});
