var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(C){var A="";var J,H,F,I,G,E,D;var B=0;C=Base64._utf8_encode(C);while(B<C.length){J=C.charCodeAt(B++);H=C.charCodeAt(B++);F=C.charCodeAt(B++);I=J>>2;G=((J&3)<<4)|(H>>4);E=((H&15)<<2)|(F>>6);D=F&63;if(isNaN(H)){E=D=64;}else{if(isNaN(F)){D=64;}}A=A+this._keyStr.charAt(I)+this._keyStr.charAt(G)+this._keyStr.charAt(E)+this._keyStr.charAt(D);}return A;},decode:function(C){var A="";var J,H,F;var I,G,E,D;var B=0;C=C.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(B<C.length){I=this._keyStr.indexOf(C.charAt(B++));G=this._keyStr.indexOf(C.charAt(B++));E=this._keyStr.indexOf(C.charAt(B++));D=this._keyStr.indexOf(C.charAt(B++));J=(I<<2)|(G>>4);H=((G&15)<<4)|(E>>2);F=((E&3)<<6)|D;A=A+String.fromCharCode(J);if(E!=64){A=A+String.fromCharCode(H);}if(D!=64){A=A+String.fromCharCode(F);}}A=Base64._utf8_decode(A);return A;},_utf8_encode:function(B){B=B.replace(/\r\n/g,"\n");var A="";for(var D=0;D<B.length;D++){var C=B.charCodeAt(D);if(C<128){A+=String.fromCharCode(C);}else{if((C>127)&&(C<2048)){A+=String.fromCharCode((C>>6)|192);A+=String.fromCharCode((C&63)|128);}else{A+=String.fromCharCode((C>>12)|224);A+=String.fromCharCode(((C>>6)&63)|128);A+=String.fromCharCode((C&63)|128);}}}return A;},_utf8_decode:function(A){var B="";var C=0;var D=c1=c2=0;while(C<A.length){D=A.charCodeAt(C);if(D<128){B+=String.fromCharCode(D);C++;}else{if((D>191)&&(D<224)){c2=A.charCodeAt(C+1);B+=String.fromCharCode(((D&31)<<6)|(c2&63));C+=2;}else{c2=A.charCodeAt(C+1);c3=A.charCodeAt(C+2);B+=String.fromCharCode(((D&15)<<12)|((c2&63)<<6)|(c3&63));C+=3;}}}return B;}};var GoogleMapViewer=Class.create();GoogleMapViewer.prototype={initialize:function(A){this.mapcontainer=$(A);this.fitAvailableHeight();Event.observe(window,"resize",function(){this.fitAvailableHeight();}.bind(this));if(GBrowserIsCompatible()){this.map=new GMap2(this.mapcontainer);this.map.addControl(new GLargeMapControl());this.map.addControl(new GMapTypeControl());this.map.addControl(new GOverviewMapControl());this.map.setCenter(new GLatLng(0,0),0);this.bounds=new GLatLngBounds();this.marker=new Array();Event.observe(window,"unload",function(){GUnload();});return this;}else{alert("Google Maps not supported on this browser.");return false;}},addMarker:function(G,A,E,H,F,J){var I=new GLatLng(G,A);this.marker[E]=new GMarker(I,this.getIcon(E));this.marker[E]._contact=Base64.decode(F);this.marker[E]._title=Base64.decode(H);this.marker[E]._links=Base64.decode(J);var B=$("Matches");var C=Builder.node("a",{className:"marker"+E},this.marker[E]._title);Event.observe(C,"click",this.infoWindow.bind(this,E));var D=Builder.node("li",C);B.appendChild(D);GEvent.addListener(this.marker[E],"click",this.infoWindow.bind(this,E));this.map.addOverlay(this.marker[E]);this.bounds.extend(this.marker[E].getPoint());},centreAndZoom:function(){this.map.setZoom(this.map.getBoundsZoomLevel(this.bounds));this.map.setCenter(this.bounds.getCenter());this.map.savePosition();},getIcon:function(A){var B=new GIcon();B.image="/_asset/image/icon/marker/"+A+".png";B.shadow="/_asset/image/icon/marker/shadow.png";B.iconSize=new GSize(14,19);B.shadowSize=new GSize(30,20);B.iconAnchor=new GPoint(7,19);B.infoWindowAnchor=new GPoint(14,0);return B;},infoWindow:function(B){var A=this.marker[B];GEvent.addListener(A,"infowindowopen",function(){var C=new GMap(document.getElementById("map_mini"+B));var D=new GMarker(A.getLatLng(),this.getIcon("marker"));C.centerAndZoom(D.getLatLng(),1);C.addOverlay(D);}.bind(this));A.openInfoWindowHtml('<div class="details"><h3>'+A._title+"</h3>"+A._contact+A._links+'</div><div class="map_mini" id="map_mini'+B+'" style="width:125px; height:148px"></div>',{onOpenFn:function(){alert("!");},maxWidth:350});},infoWindowMap:function(){alert("open");},maximize:function(A){this.marker[A].maximize();},setCenter:function(A,B){this.map.setCenter(A,B);},fitAvailableHeight:function(){var A=$("Header").getHeight()+$("Footer").getHeight()+$("User").getHeight()+56;this.mapcontainer.setStyle("height: "+(document.viewport.getHeight()-A)+"px");$("SearchResult").setStyle("height: "+(document.viewport.getHeight()-A-30)+"px");}};