var ghlst=[];function Mapper(){var _map=null,_dt=null,_which="",_po,_z;this.setMap=function(id,which){_map=new GMap2(document.getElementById(id));};this.getMap=function(id){return(_map);};this.getShow=function(id){return(eval("_"+id+"Show"));};this.setWhich=function(str){_which=str;};this.addControls=function(){_map.addMapType(G_PHYSICAL_MAP);_map.addControl(new GLargeMapControl());var mapControl=new GHierarchicalMapTypeControl();mapControl.clearRelationships();mapControl.addRelationship(G_SATELLITE_MAP,G_HYBRID_MAP,"Labels",false);_map.addControl(mapControl);_map.addControl(new GScaleControl());};this.gf=function(){var str=document.URL;if(str.contains("#"))str=str.before("#");if(str.contains(".html")) str=str.before(".html")+"/";if(str.contains("attractions/"))str=str.before("attractions/");else if(str.contains("hotels/"))str=str.before("hotels/");return(str+"mpcfg.html");};this.createIcon=function(a,b){var icon=new GIcon();icon.image=a+"/images/map/"+b+".gif";icon.iconSize=new GSize(17,18);icon.iconAnchor=new GPoint(8,8);icon.infoWindowAnchor=new GPoint(12,6);icon.shadow="";icon.shadowSize=new GSize(0,0);return(icon);};this.genGlobalArrays=function(lst){var i=lst.length,tmp;do{tmp=lst[i-1];eval("_"+tmp+"Mrkr=[];");eval("_"+tmp+"Show=false;");}while(--i);};this.createMarker=function(point,nm,icn,ttl,id,c){var marker=(icn=="")?new GMarker(point,{title:ttl}):new GMarker(point,{icon:icn,title:ttl});GEvent.addListener(marker,"click",function(){marker.openInfoWindowHtml(nm,{maxWidth:360});});if(id!=""&&document.getElementById("c"+id.urlise()))GEvent.addDomListener(document.getElementById("c"+id.urlise()),"mouseover",function(){marker.openInfoWindowHtml(nm);});ghlst[c]=marker;return(marker);};this.mrkrs=function(lst,which){var cfg =lst.before("%1%");_dt=eval("("+cfg+");");var lalst=[],lblst=[],rtn=[],ar=_dt.ar, tmp,marker,la,lb,cntnt,bnds,b1,b2,tmp,ttl,base="http://"+document.domain,po="",o="",z=_dt.z;if(_dt.rplc){var rplc=_dt.rplc;for(i=0;i<rplc.length-1;i++) while(lst.contains(rplc[i]))lst=lst.replace(rplc[i],rplc[i+1]);};if(document.getElementById("po")){o=(document.getElementById("po").innerHTML).urlise();};lst=lst.split("%5%");i=(lst.length-1), j=0;_map.setCenter(new GLatLng(_dt.l[0],_dt.l[1]),z);j=ar.length;do{if(validStr(ar[j-1])!=""){eval("_"+ar[j-1]+"Mrkr=[];");eval("var "+ar[j-1]+"Icon=this.createIcon(base,\""+ar[j-1]+"Icn\");");eval("_"+ar[j-1]+"Show=false;"); }}while(--j);if(i>0) do{marker=lst[i-1].after("%1%").before("%2%");la=lst[i-1].after("%2%").before("%3%");lb=lst[i-1].after("%3%").before("%4%");cntnt="<div class=\"mpxcrpt\"><table width=\"320\" height=\"120\"><tr><td>"+lst[i-1].after("%4%")+"</td></tr></table></div>";ttl=cntnt.after("<b>").before("</b>").replace(/&#([0-9]+)(;?)/g," ").normalize();pnt=new GLatLng(la,lb);rtn.push(cntnt);eval("_"+marker+"Mrkr.push(this.createMarker(pnt,cntnt,"+marker+"Icon,\""+ttl+"\",'',''));");if(marker=="hot"||marker=="cty"){lalst.push(la);lblst.push(lb);}if(o!="") if((ttl.urlise())==o){eval("po=_"+marker+"Mrkr");po=po[po.length-1];}if((i%50)==0)setTimeout("",5);}while(--i);for(j=0;j<ar.length;j++){if(eval("_dt."+ar[j]+"shw==1")){this.showwndw(ar[j]);}}if(po!=""){switch(_which){case "city":z=13;break;default:z=14;break;}this.setLocateAddress(po,z);this.locateOnMap();}};this.setLocateAddress=function(po,z){_po=po;_z=z;};this.locateOnMap=function(){_map.setCenter(new GLatLng((_po.getLatLng()).lat(),(_po.getLatLng()).lng()),_z);GEvent.trigger(_po,"click");_po.show();};   this.showwndw=function(str){eval("var lst=_"+str+"Mrkr");var i=lst.length;if(i>0) do{_map.addOverlay(lst[i-1]);}while(--i);if(document.getElementById(str+"Tog")){document.getElementById(str+"Tog").checked=true;}eval("_"+str+"Show=true");};this.hidewndw=function(str){eval("var lst=_"+str+"Mrkr");var i=lst.length;if(i>0)do{try{_map.removeOverlay(lst[i-1].remove());}catch(e){}}while(--i);document.getElementById(str+"Tog").checked=false;eval("_"+str+"Show=false;");};this.zoomer=function(a,b,c){_map.setCenter(new GLatLng(a,b),parseInt(c,10)+1);};this.printHotel=function(){var map=new GMap(document.getElementById("map"));map.addControl(new GSmallZoomControl());map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());var point=new GLatLng(l2,l1);map.centerAndZoom(new GPoint(l1, l2),2);function createMarker(point){var marker=new GMarker(point);GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(hn);});return marker;}map.addOverlay(createMarker(point));};this.run=function(which){var t=this;this.setWhich(which);switch(true){case(which=="home"||which=="country"||which=="state"||which=="city"||which=="hotel"||which=="attraction"||which=="continent"):GDownloadUrl(this.gf(),function(data,responseCode){t.mrkrs(data,which)});break;case(which=="hotelprint"):this.printHotel();break;}}};var mppr=new Mapper();function load(which) {if(GBrowserIsCompatible()){mppr.setMap("themap",which);mppr.addControls();mppr.run(which);}};function locate(){mppr.locateOnMap();}function tog(a){switch(eval("mppr.getShow('"+a+"')")){case false:eval("mppr.showwndw('"+a+"')");break;case true:eval("mppr.hidewndw('"+a+"')");break;}};function zmit(a,b,c){mppr.zoomer(a,b,c);};function mo(i){GEvent.trigger(ghlst[i],"click");};