function getPdMarkerRevisionInfo(){var cr="<br/>";var s="2.03  10/02/07 - fixed zindex bug (setMarkerZIndex, topMarkerZIndex)"+cr+"2.02  05/22/07 - fixed minor issues (blink, initDetailWin)"+cr+"2.01  04/29/07 - improved left hand side detail window positioning, uses new Google setImage & show "+"routines for added reliability, fixed zoomToMarkers for single marker case."+cr+"2.00  04/22/07 - fix for setImage when using Explorer 7."+cr+"1.99f 07/09/06 - zoomToMarkers now takes into account markers not displayed."+cr+"1.99e 05/05/06 - fixed zoomed tooltip positioning & non-centered marker graphics."+cr+"1.99d 05/01/06 - fixed display & blink when defining .transparent."+cr+"1.99c 04/25/06 - added display and blink."+cr+"1.99b 04/21/06 - added 'Powered By' version & marker count display."+cr+"1.99a 04/18/06 - revised for Google Maps API Version 2, GMap2 required."+cr+"0.99c 01/30/06 - added setDetailWinClass and resetDetailWinClass."+cr+"0.99a 10/12/05 - now handles maps in containers with undefined widths"+cr+"define a div with id 'pdmarkerwork' to reduce flicker"+cr+"0.99  10/03/05 - added setImageEnabled, allowLeftTooltips (global)"+cr+"0.98  09/30/05 - fixed zoomToMarkers"+cr+"0.97  09/24/05 - added setHoverImage, setShowDetailOnClick, setDetailWinHTML, showDetailWin, closeDetailWin"+cr+"0.96  09/22/05 - added setTooltipHiding, getTooltipHiding"+cr+"0.95  09/20/05 - handle zoom for lingering tooltips mouseOutEnabled(false) "+"disables setImage and restoreImage"+cr+"0.94  09/20/05 - added setTooltipClass and resetTooltipClass"+cr+"0.93  09/19/05 - added slopPercentage [optional] parameter to zoomToMarkers"+cr+"0.92  09/18/05 - added getMouseOutEnabled, setMouseOutEnabled"+cr+"0.91  09/17/05 - fixed setOpacity";return s;}
function getPdMarkerVersion(){return getPdMarkerRevisionInfo().substring(0,15);}
function getPdMarkerShortVersion(){return getPdMarkerRevisionInfo().substring(0,5);}
var APIkey="";function getGoogleMapsVersion(){var i,a,b,c;var v="unknown";if(document.getElementsByTagName)
for(i=0;(a=document.getElementsByTagName("script")[i]);i++)
if(a.getAttribute("src"))
{b=a.getAttribute("src");c=b.indexOf("/mapfiles/maps");d=b.indexOf("http://maps.google.com/maps?file=api");e=b.indexOf("key=");f=b.indexOf("/mapfiles/");g=b.indexOf("/maps");if(c>0)
v=parseFloat(b.substring(c+14));else if(f>0)
v="2."+b.substring(f+10,g);if(d>=0)
if(e>0)
APIkey=b.substring(e+4);}
return v;}
function latLongToPixel(map,coord,zoom){return map.fromLatLngToDivPixel(coord);}
var pdMarkerExtList=[];function PdMarkerAddToExtList(marker){pdMarkerExtList.push(marker);}
function PdMarkerRemoveFromExtList(id){for(var i=0;i<pdMarkerExtList.length;i++)
if(pdMarkerExtList[i].internalId==id)
pdMarkerExtList.splice(i,1);}
function PdMarkerFindInExtList(id){for(var i=0;i<pdMarkerExtList.length;i++)
if(pdMarkerExtList[i].internalId==id)
return pdMarkerExtList[i];}
function PdMarkerClose(id){for(var i=0;i<pdMarkerExtList.length;i++)
if(pdMarkerExtList[i].internalId==id)
{pdMarkerExtList[i].closeDetailWin();pdMarkerExtList.splice(i,1);}}
function PdMarkerBlinkOnOff(id){var marker=PdMarkerFindInExtList(id);if(marker)
{if(!marker.blinking)return;marker.blinkOn=!marker.blinkOn;marker.display(marker.blinkOn);setTimeout("PdMarkerBlinkOnOff("+marker.getId()+");",marker.blinkSpeed);}}
function isPdMarker(a){if(a.isMarker)
return true;return false;}
function getPdMarkerCount(a){if(a.pdMarkers)
return a.pdMarkers.length;return 0;}
GMap2.prototype.getMarkerById=function(id){var count=getPdMarkerCount(this);for(var i=0;i<count;i++)
if(isPdMarker(this.pdMarkers[i]))
if(this.pdMarkers[i].internalId==id)
{this.cursor=i;return this.pdMarkers[i];}
return null;}
GMap2.prototype.getFirstMarker=function(){var count=getPdMarkerCount(this);for(var i=0;i<count;i++)
if(isPdMarker(this.pdMarkers[i]))
{this.cursor=i;return this.pdMarkers[i];}
return null;}
GMap2.prototype.getNextMarker=function(){var count=getPdMarkerCount(this);if(count>0)
if(this.cursor>=0)
for(var i=this.cursor+1;i<count;i++)
if(isPdMarker(this.pdMarkers[i]))
{this.cursor=i;return this.pdMarkers[i];}
return null;}
GMap2.prototype.getNthMarker=function(nTh){var count=getPdMarkerCount(this);for(var i=0;i<count;i++)
if(isPdMarker(this.pdMarkers[i]))
{nTh--;if(nTh==0)
{this.cursor=i;return this.pdMarkers[i];}}
return null;}
GMap2.prototype.getMarkerCount=function(){return getPdMarkerCount(this);}
GMap2.prototype.boxMap=function(center,span){var spec=this.spec;var zoom=spec.getLowestZoomLevel(center,span,this.viewSize);this.centerAndZoom(new GPoint(center.x,center.y),zoom);}
GMap2.prototype.zoomToMarkers=function(slopPercentage,heightOffsetPct){var count=0;var thePoint,x,y,minX,maxX,minY,maxY,span;var marker=this.getFirstMarker();while(marker!=null)
{if(!marker.isHidden())
{thePoint=marker.getPoint();x=thePoint.lat();y=thePoint.lng();if(count==0)
{minX=x;maxX=x;minY=y;maxY=y;}
else
{if(x<minX)minX=x;if(x>maxX)maxX=x;if(y<minY)minY=y;if(y>maxY)maxY=y;}
count++;}
marker=this.getNextMarker();}
if(count==1)
this.setCenter(new GLatLng(x,y),this.getZoom());else if(count>1)
{var center=new GLatLng((minX+maxX)/2,(minY+maxY)/2)
span=new GSize(Math.abs(maxX-minX),Math.abs(maxY-minY));slopWid=0;slopHgt=0;if(typeof slopPercentage!="undefined")
{slopWid=span.width*slopPercentage/200;slopHgt=span.height*slopPercentage/200;span.width*=1+slopPercentage/100;span.height*=1+slopPercentage/100;}
deltaHgt=0;if(typeof heightOffsetPct!="undefined")
{deltaHgt=span.height*heightOffsetPct/100;center=new GLatLng(center.lat()+deltaHgt,center.lng());}
var bounds=new GLatLngBounds(new GLatLng(minX-slopHgt,minY-slopWid),new GLatLng(maxX+slopHgt,maxY+slopWid));var zoom=this.getBoundsZoomLevel(bounds);this.setCenter(center,zoom);}}
function shorten(x){var factor=1000000
return Math.round(x*factor)/factor;}
function poweredByClick(map){var center=map.getCenter();var span=map.getBounds().toSpan();var zoom=map.getZoom();var url="http://maps.google.com/maps?ll="+center.lat()+","+center.lng()+"&spn="+shorten(span.lat())+","+shorten(span.lng())+"&z="+zoom+"&key="+APIkey;document.location=url;}
function poweredByMouseover(map){var marker=map.getFirstMarker();var bounds=map.getBounds();var visibleCount=0;var totalCount=0;while(marker!=null){if(!marker.isHidden())
{var point=marker.getPoint();if(bounds.contains(point))
visibleCount++;totalCount=totalCount+1;}
marker=map.getNextMarker();}
var title=map.poweredByTitle+" ("+visibleCount+" markers of "+totalCount+" visible)"
map.poweredByObj.setAttribute("title",title);map.poweredByObj.setAttribute("alt",title);}
function getPoweredBy(map){try{var tooltip="GMap "+getGoogleMapsVersion()+" & PdMarker "+getPdMarkerShortVersion();map.poweredByTitle=tooltip;var b=document.createElement("img");b.setAttribute("src","http://www.google.com/intl/en_ALL/mapfiles/transparent.gif");b.setAttribute("width",62);b.setAttribute("alt",tooltip);b.setAttribute("title",tooltip);b.setAttribute("height",30);b.style.display="block";b.style.position="absolute";b.style.left="2px";b.style.bottom="0px";b.style.width="62px";b.style.height="30px";b.style.cursor="pointer";b.style.zIndex=600001;b.onclick=function(){poweredByClick(map);};b.onmouseover=function(){poweredByMouseover(map);};map.getPane(G_MAP_FLOAT_PANE).parentNode.parentNode.appendChild(b);return b;}
catch(e){}
return true;}
function setPoweredBy(map){if(!map.poweredByObj){getGoogleMapsVersion();map.poweredByObj=getPoweredBy(map);}}
function PdMarkerNamespace(){var userAgent=navigator.userAgent.toLowerCase();var n4=(document.layers);var n6=(document.getElementById&&!document.all);var ie=(document.all);var o6=(userAgent.indexOf("opera")!=-1);var safari=(userAgent.indexOf("safari")!=-1);var msie=(userAgent.indexOf("msie")!=-1)&&(userAgent.indexOf("opera")==-1);var msiePre7=false;if(msie)
msiePre7=userAgent.substr(userAgent.indexOf("msie")+5,2)<7;var nextMarkerId=10;var permitLeft=true;var icon=new GIcon();icon.shadow="http://www.google.com/mapfiles/shadow50.png";icon.iconSize=new GSize(20,34);icon.shadowSize=new GSize(37,34);icon.iconAnchor=new GPoint(9,34);icon.infoWindowAnchor=new GPoint(9,2);icon.infoShadowAnchor=new GPoint(18,25);icon.image="http://www.google.com/mapfiles/marker.png";function PdMarker(a,b,tooltip){this.inheritFrom=GMarker;if(typeof b=="undefined")
b=icon;this.inheritFrom(a,b);if(typeof tooltip!="undefined")
this.pendingTitle=tooltip;else
this.pendingTitle="";if(typeof b!="undefined")
this.oldImagePath=b.image;else
this.oldImagePath="http://www.google.com/mapfiles/marker.png";this.internalId=nextMarkerId;nextMarkerId+=1;this.zIndexSaved=false;this.pendingCursor="";this.percentOpacity=70;this.mouseOutEnabled=true;this.setImageOn=true;this.hidingEnabled=true;this.showDetailOnClick=true;this.detailOpen=false;this.userData="";this.displayed=true;}
PdMarker.prototype=new GMarker(new GLatLng(1,1));function addMarkerToMapList(map,marker){try{if(map.pdMarkers.length);}
catch(e){map.pdMarkers=new Array();}
map.pdMarkers.push(marker);}
function removeMarkerFromMapList(map,marker){var id=marker.internalId;for(var i=0;i<map.pdMarkers.length;i++)
if(map.pdMarkers[i].internalId==id)
{map.pdMarkers.splice(i,1);return;}}
PdMarker.prototype.initialize=function(a){if(typeof a=="GMap")
{GLog.write("PdMarker requires GMap2");return;}
addMarkerToMapList(a,this);try
{GMarker.prototype.initialize.call(this,a);this.isMarker=true;if(this.pendingTitle.length>0)
this.setTitle(this.pendingTitle);if(this.pendingCursor.length>0)
this.setCursor(this.pendingCursor);this.map=a;setPoweredBy(a);GEvent.bindDom(this,"mouseover",this,this.onMouseOver);GEvent.bindDom(this,"mouseout",this,this.onMouseOut);GEvent.bindDom(this,"click",this,this.onClick);GEvent.bind(this.map,"zoomend",this,this.reZoom);}
catch(e){alert("PdMarker initialize error: "+e);}}
PdMarker.prototype.allowLeftTooltips=function(a){permitLeft=a;}
PdMarker.prototype.reZoom=function(){var didSet=false;if(this.tooltipObject)
if(this.tooltipObject.style.display=="block")
{setTTPosition(this);didSet=true;}
if(this.detailObject)
{if(!didSet)
setTTPosition(this);setDetailPosition(this);}}
PdMarker.prototype.setId=function(id){this.internalId=id;}
PdMarker.prototype.getId=function(){return this.internalId;}
PdMarker.prototype.setName=function(a){this.name=a;}
PdMarker.prototype.getName=function(){if(this.name)
return this.name;else
return null;}
PdMarker.prototype.setUserData=function(a){this.userData=a;}
PdMarker.prototype.getUserData=function(){if(this.userData)
return this.userData;else
return"";}
PdMarker.prototype.setUserData2=function(a){this.userData2=a;}
PdMarker.prototype.getUserData2=function(){if(this.userData2)
return this.userData2;else
return"";}
PdMarker.prototype.setImageEnabled=function(a){this.setImageOn=a;}
var PdMIN="";var PdMIA="";function PdCompPdMIN(marker){if(PdMIN.length==0)
for(var i in marker)
if(eval("typeof marker."+i)=="object")
try{if(eval("typeof marker."+i+"[0].src")!="undefined")
{PdMIA="this."+i;PdMIN=PdMIA+"[0]";}}
catch(e){}}
PdMarker.prototype.setImageOld=function(a){var msFilter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+a+'")';if(this.mouseOutEnabled&&this.setImageOn)
{PdCompPdMIN(this);try{if(this.oldImagePath.length==0)
eval("this.oldImagePath = "+PdMIN+".src");if(msie&&msiePre7)
eval(PdMIN+".style.filter = msFilter");else
eval(PdMIN+".src = a");}
catch(e){}}}
PdMarker.prototype.setImage=function(a){if(this.mouseOutEnabled&&this.setImageOn)
GMarker.prototype.setImage.call(this,a);}
PdMarker.prototype.restoreImage=function(){if(this.mouseOutEnabled&&this.setImageOn&&this.oldImagePath.length>0)
this.setImage(this.oldImagePath);}
PdMarker.prototype.display=function(a){if(a)
this.show();else
this.hide();}
PdMarker.prototype.blink=function(a,b){if(a)
{this.blinkOn=true;this.blinkSpeed=b;if(!this.blinking)
{this.blinking=a;PdMarkerAddToExtList(this);PdMarkerBlinkOnOff(this.getId());}}
else
{this.blinking=a;this.display(true);PdMarkerRemoveFromExtList(this);}}
PdMarker.prototype.setIcon=function(a){this.remove();this.icon=a;this.initialize(this.map);this.redraw(true);}
PdMarker.prototype.setMarkerZIndex=function(a){PdCompPdMIN(this);if(!this.zIndexSaved)
{this.zIndexSaved=true;this.oldZIndex=eval(PdMIN+".style.zIndex");}
eval(PdMIN+".style.zIndex = a")
this.redraw(true);}
PdMarker.prototype.topMarkerZIndex=function(){this.setMarkerZIndex(600000);}
PdMarker.prototype.restoreMarkerZIndex=function(){PdCompPdMIN(this);if(this.zIndexSaved)
{this.zIndexSaved=false;eval(PdMIN+".style.zIndex = this.oldZIndex")
this.redraw(true);}}
PdMarker.prototype.onInfoWindowOpen=function(){this.hideTooltip();GMarker.prototype.onInfoWindowOpen.call(this);}
PdMarker.prototype.setHoverImage=function(a){this.hoverImage=a;}
var inMouseOver=false;PdMarker.prototype.onMouseOver=function(){if(inMouseOver)
return;inMouseOver=true;if(this.hoverImage)
this.setImage(this.hoverImage);if(!this.detailOpen)
this.showTooltip();inMouseOver=false;}
PdMarker.prototype.onMouseOut=function(){if(this.hoverImage)
this.restoreImage();if(!this.detailOpen)
if(this.mouseOutEnabled)
this.hideTooltip();}
PdMarker.prototype.setMouseOutEnabled=function(a){this.mouseOutEnabled=a;}
PdMarker.prototype.getMouseOutEnabled=function(){return this.mouseOutEnabled;}
PdMarker.prototype.setTooltipHiding=function(a){this.hidingEnabled=a;}
PdMarker.prototype.getTooltipHiding=function(){return this.hidingEnabled;}
PdMarker.prototype.setTitle=function(a){this.tooltipText="";PdCompPdMIN(this);try{eval(PdMIN+".title = a");}
catch(e){this.pendingTitle=a;}}
PdMarker.prototype.setCursor=function(a){PdCompPdMIN(this);try{eval(PdMIN+".style.cursor = a");}
catch(e){this.pendingCursor=a;}}
PdMarker.prototype.setTooltipClass=function(a){this.pendingClassName=a;if(this.tooltipObject)
{var showing=(this.tooltipObject.style.display!="none");this.deleteObjects();if(this.tooltipRaw)
this.setTooltipNoResize(this.tooltipRaw);if(showing)
this.showTooltip();}
else
if(this.tooltipRaw)
this.setTooltipNoResize(this.tooltipRaw);}
PdMarker.prototype.resetTooltipClass=function(){this.setTooltipClass("markerTooltip");}
PdMarker.prototype.getTooltip=function(){try{return this.tooltipRaw;}
catch(e)
{return"";}}
PdMarker.prototype.setTooltipNoResize=function(a){this.setTitle("");var ttClass="markerTooltip";if(this.pendingClassName)
ttClass=this.pendingClassName;this.tooltipRaw=a;this.tooltipText="<div class='"+ttClass+"'>"+a+"</div>";if(this.tooltipObject)
this.tooltipObject.innerHTML=this.tooltipText;}
PdMarker.prototype.setTooltip=function(a){this.setTooltipNoResize(a);this.deleteObjects();}
PdMarker.prototype.showTooltip=function(){if(this.tooltipText)
{if(!this.tooltipObject)
initTooltip(this);setTTPosition(this);this.tooltipObject.style.display="block";}}
PdMarker.prototype.hideTooltip=function(){if(this.tooltipObject)
if(this.hidingEnabled)
this.tooltipObject.style.display="none";}
PdMarker.prototype.onClick=function(a){if(this.showDetailOnClick&&this.detailWinHTML)
this.showDetailWin();}
PdMarker.prototype.setShowDetailOnClick=function(a){this.showDetailOnClick=a;}
PdMarker.prototype.setDetailWinHTML=function(a){this.detailWinHTML=a;}
PdMarker.prototype.setDetailWinClass=function(a){this.pendingDetailClassName=a;}
PdMarker.prototype.resetDetailWinClass=function(){this.setDetailWinClass("markerDetail");}
PdMarker.prototype.showDetailWin=function(){if(this.detailOpen)
{this.closeDetailWin();return;}
this.hideTooltip();this.setMouseOutEnabled(false);var winClass="markerDetail";if(this.pendingWinClassName)
winClass=this.pendingWinClassName;var html="<table><tr><td>"+this.detailWinHTML+"<\/td><td valign='top'><a class='markerDetailClose' href='javascript:PdMarkerClose("+this.internalId+")'><img src='http://www.google.com/mapfiles/close.gif' width='14' height='13'><\/a><\/td><\/tr><\/table>";html="<div class='"+winClass+"'>"+html+"</div>";this.detailOpen=true;if(!this.tooltipText)
{this.ttWidth=150;this.ttHeight=30;setTTPosition(this);}
initDetailWin(this,this.ttTop,this.ttLeft,html);PdMarkerAddToExtList(this);}
PdMarker.prototype.closeDetailWin=function(){this.detailOpen=false;if(this.detailObject)
{this.setMouseOutEnabled(true);this.onMouseOut();this.map.getPane(G_MAP_FLOAT_PANE).removeChild(this.detailObject);this.detailObject=null;}}
PdMarker.prototype.deleteObjects=function(){if(this.tooltipObject)
{this.map.getPane(G_MAP_FLOAT_PANE).removeChild(this.tooltipObject);this.tooltipObject=null;}
if(this.detailObject)
{this.map.getPane(G_MAP_FLOAT_PANE).removeChild(this.detailObject);this.detailObject=null;}}
PdMarker.prototype.remove=function(a){removeMarkerFromMapList(this.map,this);PdMarkerRemoveFromExtList(this.getId());GMarker.prototype.remove.call(this);this.deleteObjects();}
PdMarker.prototype.setOpacity=function(b){if(b<0)
b=0;if(b>=100)
b=100;var c=b/100;this.percentOpacity=b;var d=document.getElementById(this.objId);if(d)
{if(typeof(d.style.filter)=='string'){d.style.filter='alpha(opacity:'+b+')';}
if(typeof(d.style.KHTMLOpacity)=='string'){d.style.KHTMLOpacity=c;}
if(typeof(d.style.MozOpacity)=='string'){d.style.MozOpacity=c;}
if(typeof(d.style.opacity)=='string'){d.style.opacity=c;}}}
PdMarker.prototype.setOpacityNew=function(b){setObjOpacity(this.objId);this.percentOpacity=b;}
function setObjOpacity(objId,b){if(b<0)
b=0;if(b>=100)
b=100;var c=b/100;var d=document.getElementById(objId);if(d)
{if(typeof(d.style.filter)=='string'){d.style.filter='alpha(opacity:'+b+')';}
if(typeof(d.style.KHTMLOpacity)=='string'){d.style.KHTMLOpacity=c;}
if(typeof(d.style.MozOpacity)=='string'){d.style.MozOpacity=c;}
if(typeof(d.style.opacity)=='string'){d.style.opacity=c;}}}
function idToElemId(id){return"ttobj"+id;}
function initTooltip(theObj){theObj.objId=idToElemId(theObj.internalId);theObj.anchorLatLng=theObj.point;var b=document.createElement('span');theObj.tooltipObject=b;b.setAttribute('id',theObj.objId);b.innerHTML=theObj.tooltipText;var c=document.body;var d=document.getElementById("pdmarkerwork");if(d)
c=d;c.appendChild(b);b.style.position="absolute";b.style.bottom="5px";b.style.left="5px";b.style.zIndex=1;if(theObj.percentOpacity)
theObj.setOpacity(theObj.percentOpacity);var tempObj=document.getElementById(theObj.objId);theObj.ttWidth=tempObj.offsetWidth;theObj.ttHeight=tempObj.offsetHeight;c.removeChild(b);b.style.zIndex=600000;b.style.bottom="";b.style.left="";theObj.map.getPane(G_MAP_FLOAT_PANE).appendChild(b);}
function initDetailWin(theObj,top,left,html){theObj.detailId="detail"+theObj.internalId;var b=document.createElement('span');theObj.detailObject=b;b.setAttribute('id',theObj.detailId);b.innerHTML=html;b.style.display="block";b.style.position="absolute";b.style.top=top+"px";if(theObj.rightSide)
b.style.left=left+"px";else
b.style.right=-left+"px";b.style.zIndex=600001;theObj.map.getPane(G_MAP_FLOAT_PANE).appendChild(b);}
function setTTPosition(theObj){var gap=5;var map=theObj.map;var pt=theObj.getPoint();var ttPos=latLongToPixel(map,pt,map.getZoom());var theIcon=theObj.getIcon();ttPos.y-=Math.floor(theIcon.iconAnchor.y/2);var rightSide=true;var bounds=map.getBounds();var boundsSpan=bounds.toSpan();var longSpan=boundsSpan.lng();var mapWidth=map.getSize().width;var tooltipWidthInDeg=(theObj.ttWidth+theIcon.iconSize.width+6)/mapWidth*longSpan;if(pt.lng()+tooltipWidthInDeg>bounds.getNorthEast().lng()&&permitLeft)
rightSide=false;ttPos.y-=Math.floor(theObj.ttHeight/2);delta=(theIcon.iconSize.width-theIcon.iconAnchor.x)+gap;if(rightSide)
ttPos.x+=delta;else
ttPos.x-=delta
theObj.rightSide=rightSide;theObj.ttLeft=ttPos.x;theObj.ttTop=ttPos.y;if(theObj.tooltipObject)
{if(rightSide){theObj.tooltipObject.style.left=ttPos.x+"px";theObj.tooltipObject.style.right=null;}
else{theObj.tooltipObject.style.left=null;theObj.tooltipObject.style.right=-ttPos.x+"px";}
theObj.tooltipObject.style.top=ttPos.y+"px";}}
function makeInterface(a){var b=a||window;b.PdMarker=PdMarker;}
makeInterface();}
PdMarkerNamespace();
var iconArrow=new GIcon();iconArrow.image=site_url+'assets/images/icons-map/arrow.png';iconArrow.shadow=site_url+'assets/images/icons-map/arrow_shadow.png';iconArrow.iconSize=new GSize(39,34);iconArrow.shadowSize=new GSize(39,34);iconArrow.iconAnchor=new GPoint(10,34);iconArrow.infoWindowAnchor=new GPoint(6,17);var iconMonument=new GIcon();iconMonument.image=site_url+'assets/images/icons-map/monument.png';iconMonument.iconSize=new GSize(25,29);iconMonument.iconAnchor=new GPoint(12,29);iconMonument.infoWindowAnchor=new GPoint(12,15);var iconCastle=new GIcon();iconCastle.image=site_url+'assets/images/icons-map/castle.png';iconCastle.iconSize=new GSize(25,29);iconCastle.iconAnchor=new GPoint(12,29);iconCastle.infoWindowAnchor=new GPoint(12,15);var iconChurch=new GIcon();iconChurch.image=site_url+'assets/images/icons-map/church.png';iconChurch.iconSize=new GSize(25,29);iconChurch.iconAnchor=new GPoint(12,29);iconChurch.infoWindowAnchor=new GPoint(12,15);var iconMuseum=new GIcon();iconMuseum.image=site_url+'assets/images/icons-map/museum.png';iconMuseum.iconSize=new GSize(25,29);iconMuseum.iconAnchor=new GPoint(12,29);iconMuseum.infoWindowAnchor=new GPoint(12,15);var iconVillage=new GIcon();iconVillage.image=site_url+'assets/images/icons-map/village.png';iconVillage.iconSize=new GSize(25,29);iconVillage.iconAnchor=new GPoint(12,29);iconVillage.infoWindowAnchor=new GPoint(12,15);var iconTheatre=new GIcon();iconTheatre.image=site_url+'assets/images/icons-map/theatre.png';iconTheatre.iconSize=new GSize(25,29);iconTheatre.iconAnchor=new GPoint(12,29);iconTheatre.infoWindowAnchor=new GPoint(12,15);var iconRestaurant=new GIcon();iconRestaurant.image=site_url+'assets/images/icons-map/restaurant.png';iconRestaurant.iconSize=new GSize(25,29);iconRestaurant.iconAnchor=new GPoint(12,29);iconRestaurant.infoWindowAnchor=new GPoint(12,15);var iconPub=new GIcon();iconPub.image=site_url+'assets/images/icons-map/pub.png';iconPub.iconSize=new GSize(25,29);iconPub.iconAnchor=new GPoint(12,29);iconPub.infoWindowAnchor=new GPoint(12,15);var iconWinery=new GIcon();iconWinery.image=site_url+'assets/images/icons-map/winery.png';iconWinery.iconSize=new GSize(25,29);iconWinery.iconAnchor=new GPoint(12,29);iconWinery.infoWindowAnchor=new GPoint(12,15);var iconDisco=new GIcon();iconDisco.image=site_url+'assets/images/icons-map/disco.png';iconDisco.iconSize=new GSize(25,29);iconDisco.iconAnchor=new GPoint(12,29);iconDisco.infoWindowAnchor=new GPoint(12,15);var iconCinema=new GIcon();iconCinema.image=site_url+'assets/images/icons-map/cinema.png';iconCinema.iconSize=new GSize(25,29);iconCinema.iconAnchor=new GPoint(12,29);iconCinema.infoWindowAnchor=new GPoint(12,15);var iconHospital=new GIcon();iconHospital.image=site_url+'assets/images/icons-map/hospital.png';iconHospital.iconSize=new GSize(25,29);iconHospital.iconAnchor=new GPoint(12,29);iconHospital.infoWindowAnchor=new GPoint(12,15);var iconShopping=new GIcon();iconShopping.image=site_url+'assets/images/icons-map/shopping.png';iconShopping.iconSize=new GSize(25,29);iconShopping.iconAnchor=new GPoint(12,29);iconShopping.infoWindowAnchor=new GPoint(12,15);var iconSoccer=new GIcon();iconSoccer.image=site_url+'assets/images/icons-map/soccer.png';iconSoccer.iconSize=new GSize(25,29);iconSoccer.iconAnchor=new GPoint(12,29);iconSoccer.infoWindowAnchor=new GPoint(12,15);var iconCashmachine=new GIcon();iconCashmachine.image=site_url+'assets/images/icons-map/cashmachine.png';iconCashmachine.iconSize=new GSize(25,29);iconCashmachine.iconAnchor=new GPoint(12,29);iconCashmachine.infoWindowAnchor=new GPoint(12,15);var iconAccommodation=new GIcon();iconAccommodation.image=site_url+'assets/images/icons-map/mm_20_red.png';iconAccommodation.shadow=site_url+'assets/images/icons-map/mm_20_shadow.png';iconAccommodation.iconSize=new GSize(12,20);iconAccommodation.shadowSize=new GSize(22,20);iconAccommodation.iconAnchor=new GPoint(6,20);iconAccommodation.infoWindowAnchor=new GPoint(6,12);var iconCurrent=new GIcon();iconCurrent.image=site_url+'assets/images/icons-map/accommodation.png';iconCurrent.iconSize=new GSize(32,32);iconCurrent.iconAnchor=new GPoint(16,32);iconCurrent.infoWindowAnchor=new GPoint(16,16);var iconAccommodationH=new GIcon();iconAccommodationH.image=site_url+'assets/images/icons-map/highlight.png';iconAccommodationH.iconSize=new GSize(20,34);iconAccommodationH.iconAnchor=new GPoint(10,34);iconAccommodationH.infoWindowAnchor=new GPoint(10,17);var customIcons=[];customIcons["monument"]=iconMonument;customIcons["castle"]=iconCastle;customIcons["church"]=iconChurch;customIcons["museum"]=iconMuseum;customIcons["village"]=iconVillage;customIcons["theatre"]=iconTheatre;customIcons["restaurant"]=iconRestaurant;customIcons["pub"]=iconPub;customIcons["winery"]=iconWinery;customIcons["disco"]=iconDisco;customIcons["cinema"]=iconCinema;customIcons["hospital"]=iconHospital;customIcons["shopping"]=iconShopping;customIcons["soccer"]=iconSoccer;customIcons["cashmachine"]=iconCashmachine;customIcons["accommodation"]=iconAccommodation;var gmarkers=[];var markerGroups={"monument":[],"castle":[],"church":[],"museum":[],"village":[],"theatre":[],"restaurant":[],"pub":[],"winery":[],"disco":[],"cinema":[],"hospital":[],"shopping":[],"soccer":[],"cashmachine":[],"accommodation":[]};var markerGroupsClick={"monument":[],"castle":[],"church":[],"museum":[],"village":[],"theatre":[],"restaurant":[],"pub":[],"winery":[],"disco":[],"cinema":[],"hospital":[],"shopping":[],"soccer":[],"cashmachine":[],"accommodation":[]};var namesGroup=[];var namesGroupByType={"monument":[],"castle":[],"church":[],"museum":[],"village":[],"theatre":[],"restaurant":[],"pub":[],"winery":[],"disco":[],"cinema":[],"hospital":[],"shopping":[],"soccer":[],"cashmachine":[],"accommodation":[]};var pointsGroup=[];var pointsGroup2={"monument":[],"castle":[],"church":[],"museum":[],"village":[],"theatre":[],"restaurant":[],"pub":[],"winery":[],"disco":[],"cinema":[],"hospital":[],"shopping":[],"soccer":[],"cashmachine":[],"accommodation":[]};var idGroup=[];var indexGroup=0;var lastMarkerPosition=0;var map;var geocoder;var gdir;var modelCarousel1=null;var modelCarousel2=null;var reasons=[];reasons[G_GEO_SUCCESS]="Success";reasons[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";reasons[G_GEO_UNKNOWN_ADDRESS]="Indirizzo sconosciuto:  Prova ad indicare il comune e la provincia. ES: Ostia, Roma";reasons[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";reasons[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";reasons[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";reasons[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";reasons[G_GEO_BAD_REQUEST]="A directions request could not be successfully parsed.";reasons[G_GEO_MISSING_QUERY]="No query was specified in the input.";reasons[G_GEO_UNKNOWN_DIRECTIONS]="The GDirections object could not compute directions between the points.";function load(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));geocoder=new GClientGeocoder();gdir=new GDirections(map,document.getElementById("directions"));GEvent.addListener(gdir,"error",function(){var code=gdir.getStatus().code;var reason="Code "+code;if(reasons[code]){reason=reasons[code]}
alert("Failed to obtain directions, "+reason);});GEvent.addListener(gdir,"addoverlay",gdirLoaded);map.addControl(new GLargeMapControl3D(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(0,30)));map.addControl(new GMapTypeControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(0,0)));map.setCenter(new GLatLng(accommodation_lat,accommodation_lng),zoom_level);map.addControl(new MoreControl(),new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(621,0)));loadMarkers();var accommodation_point=new GLatLng(accommodation_lat,accommodation_lng);accommodation_marker=new PdMarker(accommodation_point,iconCurrent);accommodation_marker.setTooltip(accommodation_name);map.addOverlay(accommodation_marker);GEvent.addListener(accommodation_marker,'click',loadThisAccommodation);accommodation_marker.topMarkerZIndex();}}
function loadMarkers(){GDownloadUrl(XMLMARKER,function(data){var xml=GXml.parse(data);var markers=xml.documentElement.getElementsByTagName("marker");for(var i=0;i<markers.length;i++){indexGroup=0;id=markers[i].getAttribute("id");idGroup.push(id);name=markers[i].getAttribute("name");namesGroup.push(name);address=markers[i].getAttribute("address");picture=markers[i].getAttribute("img");type=markers[i].getAttribute("type");point=new GLatLng(parseFloat(markers[i].getAttribute("lat")),parseFloat(markers[i].getAttribute("lng")));namesGroupByType[type].push(name);pointsGroup.push(point);pointsGroup2[type].push(point);var marker=createMarker(id,point,name,address,picture,type);map.addOverlay(marker);marker.hide();}});}
function createMarker(id,point,name,address,picture,type){var marker=new PdMarker(point,customIcons[type]);marker.setTooltip(name);markerGroups[type].push(marker);markerGroupsClick[type].push(0);if(type!="accommodation"){GEvent.addListener(marker,"click",getMarkerLocation);}
else{var img_tag="";if(picture!=""){img_tag="<img src='"+picture+"' />";}
title="<b>"+name+"</b>";var html=makeHtml(title,img_tag,address);GEvent.addListener(marker,'click',loadAccommodation);}
return marker;}
function getMarkerLocation(markerPosition){geocoder.getLocations(markerPosition,function(addresses){if(addresses.Status.code!=200){alert("Reverse geocoder failed to find an address for "+addresses.Status.code);}
else{place=addresses.Placemark[0];len=pointsGroup.length;for(var i=0;i<len;i++){if(markerPosition==pointsGroup[i])
name=namesGroup[i];}
var htmlInfo="<b>"+name+"</b><br/>"+place.address;htmlInfo=htmlInfo+'<form action="javascript:getDirections()">'+takeinfofrompdi+'<br /><input type="hidden" id="daddr" value="'+name+'@'+markerPosition+'" />'+walk+'<input type="checkbox" name="walk" id="walk" />'+nohighway+'<input type="checkbox" name="highways" id="highways" /><input type="hidden" id="saddr" value="'+accommodation_name+'@'+accommodation_lat+','+accommodation_lng+'" /><input value="'+takeinfofrompdi_btt+'" type="submit" class="ajax_r_submit_directions_poi"><input type="hidden" id="walk" value="1" /><input type="hidden" id="highways" value="" /></form>';map.openInfoWindowHtml(markerPosition,htmlInfo);}});}
function makeHtml(title,picture,address){var out="<table style='height:110px'>"+"<tr><td colspan='2'>"+title+"</td></tr>"+"<tr>"+"<td>"+picture+"</td>"+"<td>"+address+"</td>"+"</tr>"+"</table>";return out;}
function toggleGroup(type){for(var i=0;i<markerGroups[type].length;i++){var marker=markerGroups[type][i];if(marker.isHidden()){marker.show();if(type=='accommodation')
marker.topMarkerZIndex();}else{marker.hide();}}
accommodation_marker.topMarkerZIndex();map.zoomToMarkers(3,2);}
function resetGroup(type){for(var i=0;i<markerGroups[type].length;i++){var marker=markerGroups[type][i];marker.hide();}}
function resetMarkers(){resetGroup('accommodation');resetGroup('monument');resetGroup('castle');resetGroup('church');resetGroup('museum');resetGroup('village');resetGroup('theatre');resetGroup('restaurant');resetGroup('pub');resetGroup('winery');resetGroup('disco');resetGroup('cinema');resetGroup('shopping');resetGroup('soccer');resetGroup('hospital');resetGroup('cashmachine');}
function getDirections(){var opts={};if(document.getElementById("walk").checked){opts.travelMode=G_TRAVEL_MODE_WALKING;}
if(document.getElementById("highways").checked){opts.avoidHighways=true;}
var saddr=document.getElementById("saddr").value
var daddr=document.getElementById("daddr").value
gdir.load("from: "+saddr+" to: "+daddr,opts);}
function gdirLoaded(){if(gdir.getStatus().code==200){if(!$('#map_accommodation_info').is(":hidden"))
closeInfoMap();document.getElementById('delete_directions_info').style.visibility="visible";}}
function clearDirections(){gdir.clear();document.getElementById('delete_directions_info').style.visibility="hidden";}
function dothingswithsleep(part){if(part==0){setTimeout(function(){dothingswithsleep(1);},210);}else if(part==1){$('#map_accommodation_info').slideDown("slow");}}
function loadThisAccommodation(markerPosition){accommodation_marker.openInfoWindowHtml(accommodation_html);highLightMarker(0);if(lastMarkerPosition!=markerPosition&&$('#map_accommodation_info').is(":hidden")){lastMarkerPosition=markerPosition;$('#map_accommodation_info').show("slow");$("#map_accommodation_info").load(site_url+"accommodation/info_map_accommodation/?lang="+lang+"&acmid="+thisacmid,null,activeEffects);}else if(lastMarkerPosition!=markerPosition){$('#map_accommodation_info').slideUp("slow");$('#map_accommodation_info').show("slow");$("#map_accommodation_info").load(site_url+"accommodation/info_map_accommodation/?lang="+lang+"&acmid="+thisacmid,null,activeEffects);lastMarkerPosition=markerPosition;}}
function highLightMarker(markerPosition){if(markerPosition!=0){len=pointsGroup2['accommodation'].length;for(var x=0;x<len;x++){if(markerGroups['accommodation'][x]&&pointsGroup2['accommodation'][x]==markerPosition){map.removeOverlay(markerGroups['accommodation'][x]);markerGroups['accommodation'][x]=new PdMarker(pointsGroup2['accommodation'][x],iconArrow);map.addOverlay(markerGroups['accommodation'][x]);markerGroups['accommodation'][x].topMarkerZIndex();GEvent.addListener(markerGroups['accommodation'][x],'click',loadAccommodation);markerGroupsClick['accommodation'][x]=1;}
else if(markerGroupsClick['accommodation'][x]==1){map.removeOverlay(markerGroups['accommodation'][x]);markerGroups['accommodation'][x]=new PdMarker(pointsGroup2['accommodation'][x],iconAccommodationH);map.addOverlay(markerGroups['accommodation'][x]);markerGroups['accommodation'][x].setTooltip(namesGroupByType['accommodation'][x]);GEvent.addListener(markerGroups['accommodation'][x],'click',loadAccommodation);}}}
accommodation_marker.topMarkerZIndex();}
function loadAccommodation(markerPosition){highLightMarker(markerPosition);if(lastMarkerPosition!=markerPosition&&$('#map_accommodation_info').is(":hidden")){lastMarkerPosition=markerPosition;acmid=getAcmid(markerPosition);$('#map_accommodation_info').show("slow");$("#map_accommodation_info").load(site_url+"accommodation/info_map_accommodation/?lang="+lang+"&acmid="+acmid,null,activeEffects);}else if(lastMarkerPosition!=markerPosition){$('#map_accommodation_info').slideUp("slow");slideUpEnd(markerPosition);}}
function getAcmid(markerPosition){acmid=0;len=pointsGroup.length;for(var i=0;i<len;i++){if(markerPosition==pointsGroup[i]){acmid=idGroup[i];}}
return acmid;}
function slideUpEnd(markerPosition){$('#map_accommodation_info').show("slow");acmid=getAcmid(markerPosition);$("#map_accommodation_info").load(site_url+"accommodation/info_map_accommodation/?lang="+lang+"&acmid="+acmid,null,activeEffects);lastMarkerPosition=markerPosition;}
function closeInfoMap(){$('#map_accommodation_info').slideUp("slow");lastMarkerPosition=0;}
function modelCarousel_initCallback1(carousel){modelCarousel1=carousel;}
function modelCarousel_initCallback2(carousel){modelCarousel2=carousel;}
function activeEffects(){if($("#first-carousel").length>0){jQuery('#first-carousel').jcarousel({scroll:1});}
if($("#price-carousel").length>0){jQuery('#price-carousel').jcarousel({vertical:true,scroll:1});}}
function clearEffects(){if(modelCarousel1!=null){modelCarousel1.reset();}
if(modelCarousel2!=null){modelCarousel2.reset();}}
function hideAll(){var boxes=document.getElementsByName("mark");for(var i=0;i<boxes.length;i++){if(boxes[i].checked){boxes[i].checked=false;switchLayer(false,layers[i].obj);chosen.push(i);}}}
function checkChecked(){var boxes=document.getElementsByName("mark");for(var i=0;i<boxes.length;i++){if(boxes[i].checked)return true;}
return false;}
function switchLayer(checked,layer){var layerbox=document.getElementById("box");var boxlink=document.getElementById("boxlink");var button=document.getElementById("more_inner");if(checked){map.addOverlay(layer);chosen.length=0;boxlink.className="highlight";}
else{map.removeOverlay(layer);if(!checkChecked()){boxlink.blur();boxlink.className="";layerbox.className="";button.className="";}}}
function showLayerbox(){if(window.timer)clearTimeout(timer);toggleMoreBtt();}
function setClose(){timer=window.setTimeout("toggleMoreBtt()",400);}
function toggleMoreBtt(){if($('#map_menu_other').is(":hidden"))
{$('#map_menu_other').slideDown("slow");}else{$('#map_menu_other').slideUp("slow");}}
function toggleLayers(){if(chosen.length>0){var copy=chosen.slice();for(var i=0;i<copy.length;i++){var index=parseInt(copy[i]);switchLayer(true,layers[index].obj);document.getElementsByName("mark")[index].checked=true;}}
else{hideAll();}}
function MoreControl(){};MoreControl.prototype=new GControl();MoreControl.prototype.initialize=function(map){var more=document.getElementById("outer_more");var buttonDiv=document.createElement("div");buttonDiv.id="morebutton";buttonDiv.title="";buttonDiv.style.border="1px solid black";buttonDiv.style.width="122px";var textDiv=document.createElement("div");textDiv.id="more_inner";textDiv.appendChild(document.createTextNode(more_btt_label));buttonDiv.appendChild(textDiv);$('#map_menu_other').hide();more.insertBefore(buttonDiv,document.getElementById("box").parentNode);map.getContainer().appendChild(more);$('#more_inner').click(toggleMoreBtt);return more;};MoreControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(278,7));};
