google.load("maps","2");var domReady=false;var map;function cycleUntilReady(A){if(domReady){A()}else{window.setTimeout(function(){cycleUntilReady(A)},100)}}var tt_GmapMenu=Class.create({initialize:function(){this.shown=true;this.help_shown=true;this.elements={arrow:"gom_showhide_arrow",cat_frame:"gom_cat_outer_frame",explanation:"gom_explanation_section",toggle_help:"gom_showhelp_q",prefix:"gom_cat_"}},toggle_help:function(){if($(this.elements.explanation)){if(this.help_shown){$(this.elements.explanation).style.display="none";$(this.elements.toggle_help).style.backgroundPosition="right"}else{$(this.elements.explanation).style.display="block";$(this.elements.toggle_help).style.backgroundPosition="left"}this.help_shown=!this.help_shown}else{this.help_shown=false}},toggle:function(){if(this.help_shown){this.toggle_help()}if(this.shown){$(this.elements.cat_frame).style.display="none";$(this.elements.arrow).style.backgroundPosition="right"}else{$(this.elements.cat_frame).style.display="block";$(this.elements.arrow).style.backgroundPosition="left"}this.shown=!this.shown},toggle_cat:function(F,G){var E;var D;var A=map.ttOpts.cats[F];var B;var C;map.closeInfoWindow();if(this.help_shown){this.toggle_help()}for(E=0;E<A.businesses.length;E++){perform_action=true;B=map.ttOpts.marker[A.businesses[E]];if(typeof (B)!=="undefined"){for(D=0;D<B.cats.length;D++){if($(this.elements.prefix+B.cats[D]).checked&&B.cats[D]!==A.id){perform_action=false}}if(perform_action){if(G){map.addOverlay(B.obj)}else{map.removeOverlay(B.obj)}}}}}});function tt_hoverOnMarker(A){try{gom_menu.shown=true;gom_menu.toggle()}catch(F){}var E=this;if(!isNaN(A)){try{E=map.ttOpts.marker[A]}catch(F){}}var H=map.getBounds();var B=H.getNorthEast();var I=H.getSouthWest();var C=(B.lng()>I.lng())?B.lng()-I.lng():I.lng()-B.lng();var J=(B.lat()>I.lat())?B.lat()-I.lat():I.lat()-B.lat();var G=E.obj.getLatLng();var D=new google.maps.LatLng(G.lat()+J/4,G.lng()+C/20);map.setCenter(D);E.obj.openInfoWindowHtml(E.html)}function tt_mapInit(){if($("gmap_frame")&&ttOpts){var B=new google.maps.Icon(G_DEFAULT_ICON);B.infoWindowAnchor=new google.maps.Point(10,32);function D(H){var E=new google.maps.Icon(B);if(map.ttOpts.marker[H].image){E.image=map.ttOpts.marker[H].image}var G={icon:E,title:map.ttOpts.marker[H].name};var F=new google.maps.Marker(new google.maps.LatLng(map.ttOpts.marker[H].gc_y,map.ttOpts.marker[H].gc_x),G);F.mapIndex=H;if(typeof (map.ttOpts.marker[H].html)!=="undefined"){google.maps.Event.addListener(F,"click",tt_hoverOnMarker.bind(map.ttOpts.marker[H]))}return F}map=new google.maps.Map2($("gmap_frame"));map.ttOpts=ttOpts;switch(map.ttOpts.type){case"single":for(i in map.ttOpts.marker){map.setCenter(new google.maps.LatLng(map.ttOpts.marker[i].gc_y,map.ttOpts.marker[i].gc_x),map.ttOpts.default_zoom);break}break;case"results":zoomLevel=map.getBoundsZoomLevel(new google.maps.LatLngBounds(new google.maps.LatLng(map.ttOpts.limits.y_min,map.ttOpts.limits.x_min),new google.maps.LatLng(map.ttOpts.limits.y_max,map.ttOpts.limits.x_max)))-1;map.setCenter(new google.maps.LatLng(map.ttOpts.limits.y_mid,map.ttOpts.limits.x_mid),Math.min(zoomLevel,map.ttOpts.default_zoom));break;case"directory":zoomLevel=map.getBoundsZoomLevel(new google.maps.LatLngBounds(new google.maps.LatLng(map.ttOpts.limits.y_min,map.ttOpts.limits.x_min),new google.maps.LatLng(map.ttOpts.limits.y_max,map.ttOpts.limits.x_max)));map.setCenter(new google.maps.LatLng(map.ttOpts.limits.y_mid,map.ttOpts.limits.x_mid),Math.min(zoomLevel,map.ttOpts.default_zoom));break}map.addControl(new google.maps.LargeMapControl());map.addControl(new google.maps.HierarchicalMapTypeControl(),new google.maps.ControlPosition(G_ANCHOR_TOP_LEFT,new google.maps.Size(50,4)));map.addControl(new google.maps.OverviewMapControl(),new google.maps.ControlPosition(G_ANCHOR_BOTTOM_RIGHT));var A=/'/g;switch(map.ttOpts.type){case"single":case"results":for(i in map.ttOpts.marker){map.ttOpts.marker[i].name=map.ttOpts.marker[i].name.replace(A,"\\'");map.ttOpts.marker[i].obj=D(i);map.addOverlay(map.ttOpts.marker[i].obj)}break;case"directory":for(i in map.ttOpts.marker){map.ttOpts.marker[i].name=map.ttOpts.marker[i].name.replace(A,"\\'");map.ttOpts.marker[i].obj=D(i)}break}if(typeof (gom_menu)!=="undefined"){try{gom_menu.toggle()}catch(C){}}try{gom_menu.toggle_help()}catch(C){}}};