function VTMap(AO){function BF(BJ){var BI=GBrowserIsCompatible.call(window);
if(BI){a=new GMap2(document.getElementById(AO.elementId));
a.checkResize();
if(a!==null){a.enableDragging();
a.enableScrollWheelZoom();
if(L===true||L===undefined){S=new VTMapScroller(false,false,AO.elementId+"_scroller",Al,A());
var BO,BN;
if(AO.controlPosition!==undefined){BO=AO.controlPosition[0];
BN=AO.controlPosition[1]
}else{BO=10;
BN=38
}a.addControl(S,new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(BO,BN)))
}GEvent.addListener(a,"load",Av);
var BK=a.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(-40,-180),new GLatLng(40,180)),a.getSize());
BK=Math.max(BK,2);
if(AC&&B==-1){B=BK
}if(!BG()){if((Aa!==undefined&&AR!==undefined)&&(Aa!==null&&AR!==null)){var BL=new GLatLngBounds(Aa,AR);
a.setCenter(BL.getCenter());
var BM=a.getBoundsZoomLevel(BL,a.getSize());
j=BM
}else{if(AO.initialCentre!==undefined){a.setCenter(AO.initialCentre)
}else{a.setCenter(new GLatLng(0,0),2)
}}if(AO.initialZoom!==undefined){a.setZoom(AO.initialZoom)
}else{if(j>-1){a.setZoom(j)
}else{a.setZoom(BK)
}}}if(A()){VT_BRAND_MAP.getMinimumResolution=function(BP){return B
}
}else{VT_BRAND_MAP.getMinimumResolution=function(BP){return 1
}
}VT_BRAND_MAP.getErrorMessage=function(){return""
};
for(var BH=0;
BH<G_DEFAULT_MAP_TYPES.length;
BH++){G_DEFAULT_MAP_TYPES[BH].getMinimumResolution=function(BP){return B
}
}G_PHYSICAL_MAP.getMinimumResolution=function(BP){return B
};
u(U.getModeForZoomLevel(a.getZoom()));
d();
E=true;
O();
if(Ak()){Ax()
}Ai()
}}}function Av(){}function Ap(){o();
GEvent.clearListeners(a)
}function AI(BH,BI){return G_PHYSICAL_MAP.getBoundsZoomLevel(new GLatLngBounds(new GLatLng(BH.lat,BH.lng),new GLatLng(BI.lat,BI.lng)),a.getSize())
}function BB(){GEvent.addListener(a,"dragstart",function(){J()
});
GEvent.addListener(a,"moveend",function(){Ai()
});
GEvent.addListener(a,"movestart",function(){Au()
});
GEvent.addListener(a,"zoomstart",function(){p()
});
GEvent.addListener(a,"zoomend",function(){C()
});
GEvent.addListener(a,"move",function(){AS()
});
jQuery(window).bind("resize",function(){n()
})
}function Ac(){window.setTimeout(function(){},0)
}function AS(){if(AG.contains(a.getCenter())){return 
}var BM=a.getCenter();
var BJ=BM.lng();
var BN=BM.lat();
var BI=AG.getNorthEast().lng();
var BH=AG.getNorthEast().lat();
var BL=AG.getSouthWest().lng();
var BK=AG.getSouthWest().lat();
if(BJ<BL){BJ=BL
}if(BJ>BI){BJ=BI
}if(BN<BK){BN=BK
}if(BN>BH){BN=BH
}a.setCenter(new GLatLng(BN,BJ))
}function BE(){}function Q(){if(Ag===false){a.setMapType(VT_BRAND_MAP);
BB();
jQuery("div:first",BC).css("background","#6BA7B9");
Ag=true
}}function An(){a.setMapType(G_PHYSICAL_MAP);
jQuery("div:first",BC).css("background","#263671");
Ag=false
}function d(){AX.css({bottom:145,left:-15,position:"absolute"})
}function D(){if(a.getZoom()!=B){if(ie){AX.show()
}else{AX.fadeIn(250)
}}window.setTimeout(AL,3000)
}function AL(){if(ie){AX.hide()
}else{AX.fadeOut(250)
}}function Ab(BJ){if(AY.length<VTMap.PIN_LIMIT&&!x(BJ.latlng)){var BI=iconManager.getMarkerForType(BJ.latlng,BJ.type);
var BH=new VTBubble({manager:Al,marker:BI,id:BJ.id,contentUrl:BJ.contentUrl,lazy:true,map:a});
BI.summaryBubble=new VTSummaryBubble({manager:Al,marker:BI,id:BJ.id,map:a,title:BJ.name});
BH.prepare();
BI.bubble=BH;
BI.type=BJ.type;
BI.bbox=BJ.bbox;
BI.cycle=BJ.cycle;
BI.isLocation=BJ.isLocation;
if(BJ.time!==null){BI.duration=BJ.time
}else{BI.duration=VTMap.DEFAULT_DISPLAY_TIME
}AY.push(BI);
BA(BI);
BI.dblclick(function(){g(BI)
});
BI.hover(function(){BI.bubble.loadContent(false);
if(BI.bbox!==undefined&&AB){var BM=new GLatLngBounds();
BM.extend(new GLatLng(BI.bbox.sw.lat,BI.bbox.sw.lng));
BM.extend(new GLatLng(BI.bbox.ne.lat,BI.bbox.ne.lng));
var BL=new GLatLng(BM.getNorthEast().lat(),BM.getSouthWest().lng());
var BO=BM.getNorthEast();
var BN=new GLatLng(BM.getSouthWest().lat(),BM.getNorthEast().lng());
var BK=BM.getSouthWest();
Ao=new GPolygon([BK,BL,BO,BN,BK],"#FFFFFF",1,0.25,"#FFFFFF",0.1);
a.addOverlay(Ao)
}},function(){F()
});
BI.click(function(){Am(BI);
if(AN){R()
}});
Ae()
}}function Ax(){var BI,BM=new GLatLngBounds(),BH;
G=P.getMarkers();
for(BI=0;
BI<G.length;
BI++){var BK=G[BI],BL=new GLatLng(BK.latLng.lat,BK.latLng.lng);
AZ(BK);
BM.extend(BL);
if(BK.isLocation){if(BI>0){var BJ=new GPolyline([BH,BL],"#000000",4,1,{geodesic:false});
a.addOverlay(BJ)
}BH=BL
}}As(BM.getSouthWest(),BM.getNorthEast());
a.setCenter(BM.getCenter())
}function AZ(BK){var BJ=new GLatLng(BK.latLng.lat,BK.latLng.lng),BI=iconManager.getMarkerForType(BJ,BK.bubbleType),BH=new VTBubble({manager:Al,marker:BI,id:BK.id,contentUrl:BK.bubbleUrl,lazy:true,map:a});
BH.prepare();
BI.latLng=BJ;
BI.bubble=BH;
BI.type=BK.type;
BI.bbox=BK.bbox;
BI.displayed=false;
BI.isLocation=BK.isLocation;
BI.fullBubbleShown=false;
if(BK.time!==null){BI.duration=BK.time
}else{BI.duration=VTMap.DEFAULT_DISPLAY_TIME
}AY.push(BI);
A4(BI);
BI.click(function(){Am(BI)
});
BI.dblclick(function(){K(BI)
});
BI.hover(function(){BI.bubble.loadContent(false)
},function(){})
}function BA(BH){if(jQuery.inArray(String(BH.type),AK)==-1||M()){a.addOverlay(BH)
}else{a.removeOverlay(BH)
}}function A4(BH){if(BH.isLocation||!BH.isLocation&&a.getZoom()>=VTMap.TRIPPOD_SWITCHZOOM){if(!BH.displayed){a.addOverlay(BH);
BH.displayed=true
}}else{if(BH.displayed){a.removeOverlay(BH);
BH.displayed=false
}}}function x(BJ){for(var BH=0;
BH<AY.length;
BH++){var BI=AY[BH];
if(BI.getLatLng().equals(BJ)){return true
}}return false
}function Y(BH){a.removeOverlay(BH)
}function F(){if(Ao!==null){a.removeOverlay(Ao);
Ao=null
}}function t(BH){AK.push(BH);
AT(BH)
}function At(BH){AK.splice(jQuery.inArray(BH,AK),1);
AT(BH)
}function A0(BJ){AA();
for(var BH=0;
BH<AY.length;
BH++){var BI=AY[BH];
if(BI!==null){A4(BI)
}}}function AT(BJ){AA();
for(var BH=0;
BH<AY.length;
BH++){var BI=AY[BH];
if(BI!==null&&BI.type==BJ){BA(BI)
}}}function J(){f=false
}function Ai(){if(A()){AH()
}z();
if(S!==null){S.onZoom()
}if(q>-1){window.clearTimeout(q)
}q=window.setTimeout(function(){A2=a.getCenter();
Az();
if(X){u(U.getModeForZoomLevel(a.getZoom()),U.hasModeChanged(AF,a.getZoom()));
if(h){h.onMapZoom()
}X=false;
AF=a.getZoom()
}},0);
if(f===false){o()
}}function Au(){D()
}function p(){D();
S.onZoom();
r()
}function C(){if(i===false){f=false
}else{i=false
}if(q>-1){window.clearTimeout(q)
}if(A()){if(U.hasModeChanged(AF,a.getZoom())||(AC&&AF==B)||(B==a.getZoom())){Aj()
}}else{A0()
}AA();
F();
X=true;
S.onZoom();
window.clearTimeout(q);
q=window.setTimeout(function(){if(AP){AP.onMapZoom()
}u(U.getModeForZoomLevel(a.getZoom()))
},VTMap.ACTION_TIMEOUT);
AF=a.getZoom();
if(f===false){o()
}}function n(){if(E){a.checkResize();
a.setCenter(A2);
d();
z()
}}function K(BH){a.setZoom(VTMap.TRIPPOD_SWITCHZOOM);
a.setCenter(BH.latLng)
}function g(BI){var BL=DEFAULT_BUBBLETYPES[BI.type];
R();
if(BL===undefined||BL.category==DEFAULT_PINTYPES.GEOGRAPHICAL){AA();
var BN=null,BJ=null;
if(BI.bbox===undefined||BI.bbox===null||BI.bbox.sw===null||BI.bbox.ne===null){BJ=U.getNextMode(AQ);
if(BJ!==null){BN=BJ.minLevel
}else{}}else{var BH=new GLatLng(BI.bbox.sw.lat,BI.bbox.sw.lng);
var BM=new GLatLng(BI.bbox.ne.lat,BI.bbox.ne.lng);
var BK=new GLatLngBounds(BH,BM);
BN=G_PHYSICAL_MAP.getBoundsZoomLevel(BK,a.getSize())
}if(BN<=a.getZoom()){BJ=U.getNextMode(AQ);
if(BJ!==null){BN=BJ.minLevel
}else{}}A1(BN,BI.getLatLng());
if(AN){b()
}}else{if(BL.category==DEFAULT_PINTYPES.ATTRACTIONS){}}}function u(BI,BH){if(BH===undefined){BH=true
}AQ=BI;
r();
AA();
z();
if(BH){if(A()){Aj();
Az()
}else{}}}function r(){if(v===null){a.setMapType(AQ.layer)
}else{if(v.getName()=="VTravelled"&&a.getZoom()>DEFAULT_MODES.world.maxLevel){An();
a.setMapType(AQ.layer);
if(A3!==undefined&&A3!==null){A3.call()
}}else{if(v.getName()=="VTravelled"){Q()
}else{An();
a.setMapType(v)
}}}if(k!==undefined&&k!==null){k.call(Al,a.getCurrentMapType().getName())
}}function As(BH,BK){var BJ=new GLatLngBounds();
var BI;
BJ.extend(BH);
BJ.extend(BK);
BI=G_PHYSICAL_MAP.getBoundsZoomLevel(BJ,a.getSize());
A1(BI,BJ.getCenter())
}function A1(BI,BH){D();
i=true;
if(BH!==null){a.setCenter(BH,BI)
}else{if(BI!==null){a.setZoom(BI)
}}}function AD(){var BH=0;
if(B>-1){BH=B
}else{if(j>-1){BH=j
}else{BH=2
}}A1(BH,new GLatLng(40,0));
Ai()
}function AA(){for(var BH=0;
BH<AY.length;
BH++){AM(AY[BH])
}A6=null
}function Am(BH){if(!BH.bubble.equals(A6)&&!T){T=true;
AA();
A6=BH.bubble;
BH.fullBubbleShown=true;
a.addOverlay(BH.bubble)
}}function N(BH){if(!BH.fullBubbleShown){a.addOverlay(BH.summaryBubble)
}}function AM(BH){if(BH!==null){if(Af===true){AU()
}BH.fullBubbleShown=false;
a.removeOverlay(BH.bubble);
BH.bubble.remove()
}}function Z(BH,BI){if(M()){a.panTo(BI)
}else{a.panBy(BH)
}}function z(){if(AY.length>0){for(var BH=0;
BH<AY.length;
BH++){AY[BH].bubble.reposition()
}}}function AV(){var BJ=jQuery("div.bubblectr:visible");
if(BJ.length>1){var BI;
if(this.hasZoomed){BI=BJ.length
}else{BI=BJ.length-1
}for(var BH=0;
BH<BI;
BH++){if(!ie){jQuery(BJ[BH]).fadeOut()
}else{jQuery(BJ[BH]).hide()
}}}}function Ae(){if(A8&&(A()&&AQ.rotation||(AC&&a.getZoom()<=B))){if(AJ&&!AN&&AY.length>0){Aw()
}}else{I()
}}function Aw(){if(A()&&AY.length>0){AN=true;
window.clearInterval(l);
AW=window.setTimeout(Ar,1000)
}}function I(){AN=false;
Af=false;
window.clearInterval(AW)
}function R(){I();
window.clearInterval(l);
l=window.setInterval(AU,VTMap.USER_INACTIVITY_TIMEOUT)
}function b(BH){Af=true;
window.clearInterval(AW)
}function AU(BH){Af=false;
window.clearInterval(l);
Aw()
}function Ah(BH){if(A()&&A8&&M()){var BI=BH.duration||8;
Af=false;
window.clearTimeout(AW);
AW=window.setTimeout(function(){Ar()
},BI*1000)
}}function Ar(){if(AY!==null&&AY.length>0){while(AY[e].cycle===false){e++;
e%=AY.length
}AA();
Am(AY[e]);
e++;
e%=AY.length
}}function o(){var BH=a.getBounds();
window.location.hash=BH.getSouthWest().toUrlValue()+"|"+BH.getNorthEast().toUrlValue();
s=window.location.hash
}function BD(){if(window.location!==null&&window.location.hash!=s){BG()
}}function BG(){if(!AO.isHomePage){return false
}var BI=window.location.href,BJ=BI.indexOf("#");
if(BJ>-1){var BL=BI.substr(BJ+1).split("|"),BH=BL[0].split(","),BK=BL[1].split(",");
f=true;
As(new GLatLng(BH[0],BH[1]),new GLatLng(BK[0],BK[1]));
return true
}return false
}function Aq(BK){if(A()){var BI=a.getBounds();
var BJ="";
if(a.getZoom()<=B){BJ="/home"
}var BH="/"+BI.getSouthWest().lat()+"/"+BI.getSouthWest().lng()+"/"+BI.getNorthEast().lat()+"/"+BI.getNorthEast().lng()+"/"+a.getZoom()+BJ;
if(a!==null&&BH!=A5){D();
lastQueryBBox=BI;
VTServicesManager.get("pins",BH,BK);
A5=BH
}}}function Az(){if(A()){if(a.getZoom()==B){if(AY.length>0){return 
}}Aq(function(BI){H(BI,this);
AL();
Ay=false;
for(var BH=0;
BH<AY.length;
BH++){if(AY[BH].cycle===true){Ay=true;
break
}}})
}else{A9()
}}function AH(){if(!M()){var BL=[];
var BJ=a.getBounds();
for(var BH=0;
BH<AY.length;
BH++){var BK=AY[BH];
var BI=BK.getLatLng();
if(BI.lat()<BJ.getSouthWest().lat()||BI.lat()>BJ.getNorthEast().lat()||BI.lng()<BJ.getSouthWest().lng()||BI.lng()>BJ.getNorthEast().lng()){Y(BK)
}else{BL.push(BK)
}}AY=BL
}}function H(BM,BH){var BN=BH.url.split("/");
var BL=0;
if(vtServiceUrl===""){BL=-1
}var BS=new GLatLng(BN[4+BL],BN[5+BL]);
var BJ=new GLatLng(BN[6+BL],BN[7+BL]);
var BT=BN[8+BL];
var BP=a.getBounds();
if(BS.equals(BP.getSouthWest())&&BJ.equals(BP.getNorthEast())&&BT==a.getZoom()){for(var BR=0;
BR<BM.length;
BR++){var BU=BM[BR];
var BQ=false;
var BO=new GLatLng(BU.latitude,BU.longitude);
for(var BK=0;
BK<AY.length;
BK++){var BI=AY[BK];
if(BO.equals(BI.getLatLng())){BQ=true
}}if(!BQ){Ab({latlng:BO,id:BU.id,contentUrl:BU.template,name:BU.name,type:BU.type,bbox:BU.box,time:BU.time,cycle:BU.cycle})
}}}else{}}function A9(){}function Aj(){if(a!==null){a.clearOverlays();
AY=[]
}}function M(){return E&&(AC&&a.getZoom()<=B)
}function O(){if(E){BB();
A2=a.getCenter();
AF=a.getZoom();
AG=new GLatLngBounds(new GLatLng(-80,-180),new GLatLng(80,180));
if(AO.rotate&&A()&&!ie6){}window.setInterval(AV,W);
window.setInterval(BD,750);
jQuery("img.btn-close").live("click",AA)
}}function A(){return c==EXPLORE_MAP
}function Ak(){return c==TRIPPOD_MAP
}this.initialize=function(){BE();
BF(AO.element)
};
this.getMap=function(){return a
};
this.hideThrobber=function(){AL()
};
this.setBubbleLoading=function(BH){T=BH
};
this.setNavigator=function(BH){AP=BH
};
this.setFilter=function(BH){h=BH
};
this.isShowingHomePage=function(){return M()
};
this.getCurrentMode=function(){return AQ
};
this.getCurrentZoom=function(){return a.getZoom()
};
this.getMapElement=function(){return BC
};
this.panLeft=function(){a.panDirection(-1,0)
};
this.panRight=function(){a.panDirection(1,0)
};
this.panUp=function(){a.panDirection(0,-1)
};
this.panDown=function(){a.panDirection(0,1)
};
this.fitToBubble=function(BH,BI){Z(BH,BI)
};
this.enableFilter=function(BH){t(BH)
};
this.disableFilter=function(BH){At(BH)
};
this.fireResize=function(){n()
};
this.restartRotationFromMarker=function(BH){if(A8){Ah(BH)
}};
this.zoomTo=function(BH){A1(BH,null)
};
this.zoomIn=function(){a.zoomIn()
};
this.zoomOut=function(){a.zoomOut()
};
this.zoomToBoundingBox=function(BH,BI){As(BH,BI)
};
this.toString=function(){return"VTMap: "+BC
};
this.clearBubbles=function(){AA()
};
this.isInitialized=function(){return E
};
this.enableBoundingBoxes=function(){AB=true
};
this.disableBoundingBoxes=function(){F();
AB=false
};
this.setRotationAllowed=function(BH){AJ=BH;
Ae()
};
this.setTravelVisionEnabled=function(BH){if(BH===undefined||BH===null){BH=false
}A8=BH;
jQuery.cookie("travelVision",BH);
Ae()
};
this.isTravelVisionEnabled=function(){return A8
};
this.startRotating=function(){Aw()
};
this.stopRotating=function(){I()
};
this.setCustomMapLayer=function(BH){v=jQuery("#"+BH).data("layer");
jQuery.cookie("mapLayer",BH);
r()
};
this.getCustomMapLayer=function(){return v
};
this.clearCustomMapLayer=function(){v=null;
jQuery.cookie("mapLayer","automatic-map");
r()
};
var Al=this;
var AP=null;
var S=null;
var c=AO.type||EXPLORE_MAP;
var P=AO.tripPod;
var k=AO.layerChangeCallback||function(){};
var A3=AO.layerAutoSwitchCallback||function(){};
var h=null;
var a=null;
var AY=[];
var G=[];
var AK=[];
var B=-1;
var Ag=false;
var f=false;
var m=AO.lazy;
var BC=jQuery("#"+AO.elementId);
var AX=jQuery("#"+AO.mapLoaderElementId);
var Aa=AO.sw;
var AR=AO.ne;
var U=new VTMapModes();
var AE=AO.pinTypes;
var y=AO.bubbleTypes;
var L=true;
if(AO.showControls!==null){L=AO.showControls
}if(AO.modes!==undefined){U=new VTMapModes({modes:AO.modes})
}var AC=Aa===null&&AR===null&&AO.isHomePage;
var A7=null;
var Ad=null;
var E=false;
var AN=false;
var Af=false;
var j=-1;
var A5=null;
var AQ=null;
var e=0;
var Ay=false;
var A6=null;
var Ao=null;
var X=false;
var AG=null;
var i=false;
var AB=false;
var T=false;
var AJ=true;
var v=null;
var A8=false;
var V=null;
var W=1000;
var AW=-1;
var q=-1;
var l=-1;
var w=null;
var s=window.location.hash;
if(!AO.deferLoading){BE();
BF(AO.element);
if(A()){if(jQuery.cookie("mapLayer")!==null){this.setCustomMapLayer(jQuery.cookie("mapLayer"));
jQuery("#"+jQuery.cookie("mapLayer")).attr("checked","checked");
jQuery(".ctrlset").each(function(){jQuery(this).removeClass("bg-grey-mid").addClass("bg-grey-light");
if(jQuery("input:checked",this).size()!==0){jQuery(this).toggleClass("bg-grey-mid").toggleClass("bg-grey-light")
}});
this.setTravelVisionEnabled(jQuery.cookie("travelVision")=="true")
}else{jQuery("#automatic-map").attr("checked","checked")
}}}if(A()){jQuery("div.gmnoprint:last").css({paddingLeft:"12px",paddingBottom:"18px"})
}else{jQuery("div.gmnoprint:last").css({paddingLeft:"12px",paddingBottom:"8px"})
}var A2=null;
var AF=-1
}VTMap.PIN_LIMIT=300;
VTMap.DEFAULT_DISPLAY_TIME=1000;
VTMap.ACTION_TIMEOUT=750;
VTMap.USER_INACTIVITY_TIMEOUT=60000;
VTMap.TRIPPOD_SWITCHZOOM=10;
VTMap.prototype=Object;
GMap2.prototype.click=function(A){GEvent.addListener(this,"click",A)
};
GOverlay.prototype.click=function(A){GEvent.addListener(this,"click",A)
};
GOverlay.prototype.hover=function(B,A){GEvent.addListener(this,"mouseover",B);
GEvent.addListener(this,"mouseout",A)
};
GOverlay.prototype.dblclick=function(A){GEvent.addListener(this,"dblclick",A)
};
VTSummaryBubble.prototype=new GOverlay();
function VTSummaryBubble(C){var H=false,F=C.marker,E=C.manager,B=C.id,A=C.map,D=null,G=C.title,I=this;
this.div=null;
this.equals=function(J){if(J===null){return false
}return this.getIdentifier()==J.getIdentifier()
};
this.reposition=function(){I.node.css("top",(A.fromLatLngToDivPixel(F.getPoint()).y-13)+"px");
I.node.css("left",(A.fromLatLngToDivPixel(F.getPoint()).x+4)+"px")
};
this.initialize=function(J){A=J;
this.prepare();
this.display()
};
this.display=function(J){mclog("display()");
H=true;
A.getPane(G_MAP_FLOAT_PANE).appendChild(I.node[0]);
if(!ie){jQuery(I.node).fadeIn(200)
}else{jQuery(I.node).show()
}};
this.remove=function(){if(!ie){jQuery(I.node).fadeOut(200,function(){jQuery(I.node).hide()
})
}else{jQuery(I.node).hide()
}};
this.redraw=function(){};
this.prepare=function(){I.node=jQuery("<div class='abs summary'><div class='contents'>"+G+"</div></div>");
I.node.hide();
I.reposition()
};
this.getIdentifier=function(){return contentUrl+B
};
this.getId=function(){return B
};
this.toString=function(){return"VTBubble: "+B+" "+contentUrl
}
};
function VTMapFilter(A){var G=A.mapManager,I=this;
function D(){G.setFilter(I);
if(G.isInitialized()){B();
F()
}}function F(){jQuery(".filter").each(function(){var J=jQuery(this);
J.attr("checked","checked").addClass("on");
J.next("label").css("cursor","pointer")
});
if(jQuery.cookie("travelVision")=="true"){jQuery("#filtertv").attr("checked","checked").addClass("on")
}jQuery(".filter:not(.disabled), #filtertv:not(.disabled)").live("click",function(){var J=jQuery(this);
H(J);
J.toggleClass("on");
if(J.attr("id")!=="#filtertv"){if(J.hasClass("on")){J.attr("src",vtBaseUrl+"/assets/img/map/filters/"+J.attr("rel")+".png");
J.next("label").removeClass("grey-light").addClass("white")
}else{J.attr("src",vtBaseUrl+"/assets/img/map/filters/off.png");
J.next("label").removeClass("white").addClass("grey-light")
}}});
jQuery(".checkbox-label:not(.disabled)").click(function(){jQuery(this).css("cursor","pointer").prev(".filter").click()
})
}function H(K){var J=K.attr("id").replace(/filter/,"");
if(!K.hasClass("disabled")){if(K.hasClass("on")){if(K.attr("id")=="filtertv"){G.setTravelVisionEnabled(false)
}else{G.enableFilter(J)
}}else{if(K.attr("id")=="filtertv"){G.setTravelVisionEnabled(true)
}else{G.disableFilter(J)
}}}}function B(){mclog("UPDATING FILTERS");
var K;
if(G.isShowingHomePage()){K=[];
E([jQuery("#filtertv")])
}else{K=G.getCurrentMode().show;
C([jQuery("#filtertv")])
}for(var J in DEFAULT_BUBBLETYPES){var M;
var N=false;
for(var L in K){if(DEFAULT_BUBBLETYPES[J].id==K[L].id){N=true;
break
}}M=jQuery("#filter"+DEFAULT_BUBBLETYPES[J].id);
if(N){E([M])
}else{C([M])
}}}function E(K){for(var J=0;
J<K.length;
J++){var L=K[J];
L.fadeTo(200,1).attr("disabled","").removeClass("disabled");
if(L.hasClass("on")){labelClass="white"
}else{labelClass="grey-light"
}L.next("label").removeClass("white").removeClass("grey-light").addClass(labelClass);
L.closest("div").removeClass("bg-grey-light").addClass("bg-grey-mid")
}}function C(K,N){if(N===undefined){N=true
}for(var J=0;
J<K.length;
J++){var M=K[J],L="";
M.fadeTo(200,0.25).attr("disabled","disabled").addClass("disabled");
if(M.hasClass("on")){L="white"
}else{L="grey-light"
}M.next("label").removeClass("white").removeClass("grey-light").addClass(L);
M.closest("div").removeClass("bg-grey-mid").addClass("bg-grey-light")
}}this.onMapZoom=function(){B()
};
this.toString=function(){return"VTMapFilter"
};
D()
}VTMapFilter.prototype=Object;
DEFAULT_PINTYPES={GEOGRAPHICAL:"sea-bright",MEDIA:"earth-bright",TRIPPODS:"land-bright",ATTRACTIONS:"sea-bright",FEATURED:"sand-dark",USER:"red"};
DESTINATION={id:0,category:DEFAULT_PINTYPES.GEOGRAPHICAL};
ATTRACTION={id:1,category:DEFAULT_PINTYPES.ATTRACTIONS};
USER={id:2,category:DEFAULT_PINTYPES.USER};
FEATURE={id:3,category:DEFAULT_PINTYPES.FEATURED};
MEDIA={id:4,category:DEFAULT_PINTYPES.MEDIA};
TRIPPOD={id:5,category:DEFAULT_PINTYPES.TRIPPODS};
SPONSOR={id:6,category:DEFAULT_PINTYPES.FEATURED};
var DEFAULT_BUBBLETYPES=[DESTINATION,ATTRACTION,USER,FEATURE,MEDIA,SPONSOR,TRIPPOD];
DEFAULT_BUBBLETYPES.getBubbleTypeById=function(B){for(var A in this){if(this[A].id==B){return this[A]
}}};
function VTMapModes(A){var B={};
if(A!==undefined&&A.modes!==null){B=A.modes
}else{B=DEFAULT_MODES
}this.getModeForZoomLevel=function(D){for(idx in B){var C=B[idx];
if(C.specificLevel==D){return C
}else{if(C.minLevel<=D&&D<=C.maxLevel){return C
}}}};
this.hasModeChanged=function(E,D){var C=this.getModeForZoomLevel(E)!=this.getModeForZoomLevel(D);
return C
};
this.findMode=function(C){for(idx in B){if(B[idx]==C){return C
}}};
this.getPrevMode=function(C){return this.getModeForZoomLevel(C.minLevel-1)
};
this.getNextMode=function(C){return this.getModeForZoomLevel(C.maxLevel+1)
}
};
VTMapScroller.prototype=new GControl();
function VTMapScroller(E,F,C,B,I){VTMapScroller.instances[C]=this;
var A=jQuery(document.createElement("div"));
html="<img class='pngfix' src='"+vtBaseUrl+"/assets/img/map/control/arrows.png' usemap='#arrowmap' class='arrows' /><img class='pngfix' src='"+vtBaseUrl+"/assets/img/map/control/plus.png' onclick='VTMapScroller.onZoomInClick(\""+C+"\")'/><div class='levels_ctr'></div><img class='pngfix' src='"+vtBaseUrl+"/assets/img/map/control/minus.png' onclick='VTMapScroller.onZoomOutClick(\""+C+"\")'/><map name='arrowmap'><area shape='poly' coords='4, 0, 25, 25, 4, 47, 4, 0' onmouseover='VTMapScroller.onLeftHover(\""+C+"\")' onclick='VTMapScroller.onLeftClick(\""+C+"\")'/><area shape='poly' coords='4, 0, 25, 25, 47, 0, 4, 0' onmouseover='VTMapScroller.onUpHover(\""+C+"\")' onclick='VTMapScroller.onUpClick(\""+C+"\")'/><area shape='poly' coords='47, 0, 25, 25, 47, 47, 47, 0' onmouseover='VTMapScroller.onRightHover(\""+C+"\")' onclick='VTMapScroller.onRightClick(\""+C+"\")'/><area shape='poly' coords='47, 47, 25, 25, 4, 47, 47, 47' onmouseover='VTMapScroller.onDownHover(\""+C+"\")' onclick='VTMapScroller.onDownClick(\""+C+"\")'/></map>",levelsInitialized=false,levelsCtr=null,grip=null,gripDragging=false,gripPosition=-1,lastActionDrag=false,minResolution=-1,maxResolution=-1,mapZoom=-1;
function H(){minResolution=B.getMap().getCurrentMapType().getMinimumResolution();
currentZoom=B.getMap().getZoom();
var K=J();
if(lastActionDrag){lastActionDrag=false
}if(K!==undefined&&!isNaN(K)){grip.css({top:"",bottom:K,left:1})
}gripPosition=B.getMap().getZoom()
}function J(){return 9*(currentZoom-minResolution)
}function D(K){return maxResolution-Math.round(((K+9)/9))+minResolution-1
}function G(){return maxResolution-Math.round(((gripPosition+9)/9))+minResolution-1
}this.manager=B;
this.setManager=function(K){B=K
};
this.initialize=function(M){A.attr("id",C).html(html).addClass("abs scroller");
if(!I){jQuery("img:first",A).remove()
}jQuery(M.getContainer()).append(A);
jQuery("img.arrows",A).mouseout(function(){jQuery(this).attr("src",vtBaseUrl+"/assets/img/map/control/arrows.png")
});
minResolution=B.getMap().getCurrentMapType().getMinimumResolution();
maxResolution=B.getMap().getCurrentMapType().getMaximumResolution();
currentZoom=B.getMap().getZoom();
levelsCtr=jQuery(".levels_ctr",A);
levelsCtr.empty();
for(var L=minResolution;
L<maxResolution;
L++){var K=jQuery("<img class='pngfix' src='"+vtBaseUrl+"/assets/img/map/control/level.png'/>");
K.click(function(){var N=jQuery(this);
B.zoomTo(D(N.position().top))
}).css("cursor","pointer");
levelsCtr.append(K)
}grip=jQuery(document.createElement("img"));
grip.attr("src",vtBaseUrl+"/assets/img/map/control/grip.png").addClass("abs pngfix");
grip.bind("mousedown",this.startDragging);
A.bind("mousemove",this.dragGrip);
A.bind("mouseup",this.stopDragging);
levelsCtr.append(grip);
H();
return A.get(0)
};
this.startDragging=function(K){K.preventDefault();
gripDragging=true
};
this.dragGrip=function(K){K.preventDefault();
if(gripDragging){K.pageY-=9;
var M=K.pageY-levelsCtr.offset().top;
var L=3;
M=Math.max(M,M=0-L);
M=Math.min(M,135);
M=9*Math.round(M/9);
grip.css({top:M+3,bottom:""});
gripPosition=M
}};
this.stopDragging=function(K){K.preventDefault();
if(gripDragging){B.zoomTo(G());
gripDragging=false;
lastActionDrag=true
}};
this.printable=function(){return true
};
this.selectable=function(){return false
};
this.onZoom=function(){H()
};
this.toString=function(){return"VTMapScroller : "+C
}
}VTMapScroller.instances={};
VTMapScroller.onLeftClick=function(A){VTMapScroller.instances[A].manager.panRight()
};
VTMapScroller.onUpClick=function(A){VTMapScroller.instances[A].manager.panDown()
};
VTMapScroller.onRightClick=function(A){VTMapScroller.instances[A].manager.panLeft()
};
VTMapScroller.onDownClick=function(A){VTMapScroller.instances[A].manager.panUp()
};
VTMapScroller.onLeftHover=function(A){jQuery("img.arrows",VTMapScroller.instances[A].div).attr("src",vtBaseUrl+"/assets/img/map/control/arrows-l.png")
};
VTMapScroller.onUpHover=function(A){jQuery("img.arrows",VTMapScroller.instances[A].div).attr("src",vtBaseUrl+"/assets/img/map/control/arrows-t.png")
};
VTMapScroller.onRightHover=function(A){jQuery("img.arrows",VTMapScroller.instances[A].div).attr("src",vtBaseUrl+"/assets/img/map/control/arrows-r.png")
};
VTMapScroller.onDownHover=function(A){jQuery("img.arrows",VTMapScroller.instances[A].div).attr("src",vtBaseUrl+"/assets/img/map/control/arrows-b.png")
};
VTMapScroller.onZoomInClick=function(A){VTMapScroller.instances[A].manager.zoomIn()
};
VTMapScroller.onZoomOutClick=function(A){VTMapScroller.instances[A].manager.zoomOut()
};
VTBubble.prototype=new GOverlay();
function VTBubble(D){var K=false,H=D.marker,G=D.manager,B=D.id,F=D.contentUrl,C=D.lazy,A=D.map,E=null,L=this,J=null;
this.div=null;
function I(){var M=jQuery(J),N=jQuery("h2.subheading",J).text()
}this.equals=function(M){if(M===null){return false
}return this.getIdentifier()==M.getIdentifier()
};
this.reposition=function(){L.node.css("top",(A.fromLatLngToDivPixel(H.getPoint()).y)+"px");
L.node.css("left",(A.fromLatLngToDivPixel(H.getPoint()).x+25)+"px")
};
this.initialize=function(M){A=M;
if(!K){L.loadContent(true)
}else{console.log("Else");
var N=L.node.find("DIV.image IMG");
if(N.length>1){N.load(L.display)
}else{L.display()
}}};
this.loadContent=function(M){if(F!==null){jQuery.get(vtServiceUrl+F+"/"+B,null,function(N){J=N;
I();
K=true;
if(M){window.setTimeout(L.display,2000)
}G.setBubbleLoading(false)
})
}};
this.display=function(){mclog("display()");
L.node.html(J);
removed=false;
K=true;
A.getPane(G_MAP_FLOAT_PANE).appendChild(L.div);
var S=jQuery(this.div),Y=jQuery("div:first div:first",G.getMapElement()),T=S.css("top").toValue(),M=S.css("left").toValue(),U=S.outerWidth(),b=S.outerHeight(),O=Y.css("left").toValue(),X=Y.css("top").toValue(),Z=A.getSize().width-O,W=A.getSize().height-X,V=X+T,a=O+M,N=(M+U)-Z,c=(T+b)-W,Q=new GSize(0,0);
if(V<40){Q.height=-V+50
}if(a<10){Q.width=-a+50
}if(N>0){Q.width=-N-50
}if(c>0){Q.height=-c-50
}var d=new GPoint(M+(U/2),T+(b/2));
var P=10;
var R=A.fromDivPixelToLatLng(d);
G.fitToBubble(Q,R);
if(!ie){L.node.hide();
L.node.fadeIn()
}else{L.node.show()
}G.restartRotationFromMarker(H);
G.setBubbleLoading(false);
S=null;
Y=null
};
this.remove=function(){removed=true;
if(!ie){jQuery(L.div).fadeOut(function(){jQuery(L.div).hide()
})
}else{jQuery(L.div).hide()
}};
this.redraw=function(){};
this.prepare=function(){if(!C&&L.contentUrl!==null){L.loadContent(false)
}L.div=document.createElement("div");
L.node=jQuery(L.div);
L.node.addClass("abs bubblectr").hide();
L.reposition()
};
this.getIdentifier=function(){return F+B
};
this.getId=function(){return B
};
this.toString=function(){return"VTBubble: "+B+" "+F
}
};

function VTMapNavigator(W){var H=W.mapManager,M=this,O=W.country,E=W.continent,D=W.region,Q=W.city,V=W.reset,X,A=null;
function B(){H.setNavigator(M);
if(H.isInitialized()){X=H.getMap();
E=jQuery(E);
O=jQuery(O);
D=jQuery(D);
Q=jQuery(Q);
V=jQuery(V);
E.change(function(){I()
});
O.change(function(){U()
});
D.change(function(){G()
});
Q.change(function(){L()
});
V.click(function(){J()
});
F(SELECTCONTINENT)
}}function T(d){var Z,c;
if(d==SELECTCONTINENT){c=X.getBounds()
}else{c=P(d)
}var a="/"+d.type+"/"+c.getSouthWest().lat()+"/"+c.getSouthWest().lng()+"/"+c.getNorthEast().lat()+"/"+c.getNorthEast().lng()+"/"+X.getZoom();
var b=d.selectBox;
var Y=d.boxText;
VTServicesManager.get("geodata",a,function(e){S(e,b,Y)
})
}function S(b,c,Z){c=jQuery("#"+c);
c.removeOption(/./);
c.addOption(Z,Z);
var a=0;
for(var Y=0;
Y<b.length;
Y++){if(b[Y].name!==null){c.addOption(b[Y].name,b[Y].name);
A.data[b[Y].name]=b[Y]
}}c[0].selectedIndex=0;
jQuery("option:first",c).attr("disabled","disabled")
}function P(d){if(d===undefined){d=A
}else{switch(d){case SELECTCOUNTRY:d=SELECTCONTINENT;
break;
case SELECTREGION:d=SELECTCOUNTRY;
break;
case SELECTCITY:d=SELECTCOUNTRY;
break
}}var b=jQuery("#"+d.selectBox);
var Z=b.selectedValues()[0];
var c=d.data[Z];
var Y=new GLatLng(c.sw.lat,c.sw.lng);
var a=new GLatLng(c.ne.lat,c.ne.lng);
return new GLatLngBounds(Y,a)
}function R(){var a=P();
var Y=new GLatLng(a.getSouthWest().lat(),a.getSouthWest().lng());
var Z=new GLatLng(a.getNorthEast().lat(),a.getNorthEast().lng());
H.zoomToBoundingBox(Y,Z)
}function J(){N();
F(SELECTCONTINENT)
}function N(){for(var Y=0;
Y<NAVIGATORMODES.length;
Y++){var a=NAVIGATORMODES[Y];
var Z=jQuery("#"+a.selectBox);
Z.removeOption(/./);
Z.addOption(a.boxText,a.boxText)
}}function F(Y){if(Y!=SELECTCONTINENT){R()
}if(Y==SELECTCONTINENT){K([E]);
C([D,Q,O]);
T(SELECTCONTINENT)
}else{if(Y==SELECTCOUNTRY){C([E],false);
K([O]);
T(SELECTCOUNTRY)
}else{if(Y==SELECTREGION){K([D,Q]);
C([O],false);
T(SELECTREGION);
T(SELECTCITY)
}else{if(Y==SELECTCITY){C([D],false);
T(SELECTCITY)
}else{if(Y==SELECTED){C([D,Q],false)
}}}}}A=Y
}function I(){F(SELECTCOUNTRY)
}function U(){F(SELECTREGION)
}function G(){F(SELECTCITY)
}function L(){F(SELECTED)
}function K(Z){for(var Y=0;
Y<Z.length;
Y++){var a=Z[Y];
a.fadeTo(500,1).attr("disabled","")
}}function C(Z,b){if(b===undefined){b=true
}for(var Y=0;
Y<Z.length;
Y++){var a=Z[Y];
a.attr("disabled","disabled");
if(b){a.fadeTo(200,0.4)
}}}this.onMapZoom=function(){};
this.toString=function(){return"VTMapNavigator"
};
B()
}VTMapNavigator.prototype=Object;
function VTMapMode(B){for(var A in B){this[A]=B[A]
}function C(){return Math.round((this.minLevel+this.maxLevel)/2)
}};
var baseIcon=new GIcon(G_DEFAULT_ICON);
baseIcon.iconSize=new GSize(30,30);
baseIcon.shadow=null;
baseIcon.shadowSize=new GSize(0,0);
baseIcon.iconAnchor=new GPoint(15,15);
VTIconManager.prototype=Object;
function VTIconManager(B){var A=[],C={};
this.getMarkerForType=function(E,D){if(D!==null){return new GMarker(E,{icon:A[C.getBubbleTypeById(D).category]})
}else{return new GMarker(E,{icon:A[0]})
}};
this.getTripPodMarkerForType=function(E,D){if(D!==null){return new GMarker(E,{icon:A[C.getBubbleTypeById(D).category]})
}else{return new GMarker(E,{icon:A[0]})
}};
this.initialize=function(E){for(var D in E){var F=E[D];
A[F]=new GIcon(baseIcon,vtBaseUrl+"/assets/img/map/pin-"+F+".png")
}};
if(B===null||B.pinTypes===undefined){this.initialize(DEFAULT_PINTYPES)
}else{A=B.pinTypes
}if(B===null||B.bubbleTypes===undefined){C=DEFAULT_BUBBLETYPES
}else{C=B.bubbleTypes
}};
