
var locationInfo;function SearchBox()
{var me=this;var handleSubmit=function()
{if(locationInfo&&locationInfo.visible==true)
{locationInfo.visible=false;locationInfo.panel.hide();}
this.submit();};var handleCancel=function()
{if(locationInfo&&locationInfo.visible==true)
{locationInfo.visible=false;locationInfo.panel.hide();}
this.cancel();};var searchDiv=document.getElementById('search');SearchBox.dialog=new YAHOO.widget.Dialog("searchBox",{visible:false,zIndex:15000,constraintoviewport:false,close:false,underlay:'none',modal:true,postmethod:'form',buttons:[{text:"Submit",handler:handleSubmit,isDefault:true},{text:"Cancel",handler:handleCancel}]});SearchBox.dialog.validate=function()
{var geocoder;var map;var xlatitude=document.getElementById('xlatitude');var xlongitude=document.getElementById('xlongitude');var address=document.getElementById('xlocation');if(address&&address.value.length>0)
{if(xlatitude.value.length>0&&xlongitude.value.length>0)
{return true;}
geocoder=new GClientGeocoder();geocoder.getLatLng(address.value,function(point)
{if(!point||point==null)
{address.value="";}
else
{xlatitude.value=point.lat();xlongitude.value=point.lng();}
SearchBox.dialog.submit();});return false;}
else
{return true;}};SearchBox.dialog.render();SearchBox.dialog.submitEvent.subscribe(SearchBox.onhide);me.show=function()
{var searchPanel=document.getElementById('searchBox');searchPanel.style.display='block';SearchBox.dialog.cfg.setProperty("context",["search","tr","br"]);SearchBox.dialog.show();}
YAHOO.util.Event.addListener("search","click",me.show,SearchBox.dialog,true);}
SearchBox.onhide=function()
{var containerDiv=document.getElementById('scheduleContainer');var scheduleDiv=document.getElementById('theschedule');showLoading(containerDiv,scheduleDiv);return true;}
SearchBox.init=function()
{new SearchBox();}
function LocationInfo()
{var locationInfoEl=document.getElementById('locationinfo');if(!locationInfoEl)
{return;}
var me=this;LocationInfo.panel=new YAHOO.widget.Panel('locationInfoPanel',{width:'230px',visible:false,close:true});LocationInfo.panel.setHeader('Location');LocationInfo.panel.setBody('Enter a "City", a "City, State" or "Zip Code".<br/><br/>A full street address can be entered for more precise results.');LocationInfo.panel.render('locationinfo');me.panel=LocationInfo.panel;me.show=function()
{if(me.visible){LocationInfo.panel.hide();me.visible=false;}
else
{LocationInfo.panel.cfg.setProperty("context",["locationinfo","br","br"]);LocationInfo.panel.cfg.setProperty("constraintoviewport",false);var xy=LocationInfo.panel.cfg.getProperty('xy');xy[0]+=10;xy[1]+=35;LocationInfo.panel.cfg.setProperty('xy',xy);LocationInfo.panel.show();me.visible=true;}}
YAHOO.util.Event.addListener("locationinfo","click",me.show,LocationInfo.Panel,true);locationInfo=me;}
LocationInfo.init=function(){new LocationInfo();}
YAHOO.util.Event.addListener(window,'load',SearchBox.init);YAHOO.util.Event.addListener(window,'load',LocationInfo.init);