/* Copyright 2006-2008 SCube NewMedia.*/
if(window.addEventListener)window.addEventListener("unload",GUnload,false);else if(window.attachEvent)window.attachEvent("onunload",GUnload)
{function GeoCoderMap(GCM575,GCM2){this.GCM513=null;this.GCM245=null;this.GCM242=new GCM535();this.GCM91=null;this.GCM487=[];if(GBrowserIsCompatible()==true){this.GCM91=new GClientGeocoder();var GCM14="IT";if(navigator.language)GCM14=navigator.language.substring(0,2).toUpperCase();else if(navigator.userLanguage)GCM14=navigator.userLanguage.toUpperCase();this.GCM91.setBaseCountryCode(GCM14);var GCM118=new GLatLng(0,0);this.GCM513=new GMap2(document.getElementById(GCM575));this.GCM513.setCenter(GCM118);this.GCM513.addMapType(G_PHYSICAL_MAP);GCM568.GCM571({license:GCM2},this.GCM513.getContainer());this.GCM245=new GMarker(GCM118,{"draggable":true});this.GCM513.addOverlay(this.GCM245);this.GCM245.hide();this.GCM245.disableDragging();}else{throw new Error("Sorry, the Google Maps API is not compatible with this browser.");};}
GeoCoderMap.prototype.getGoogleMap=function(){return this.GCM513;}
GeoCoderMap.prototype.enableDragging=function(){this.GCM513.enableDragging();}
GeoCoderMap.prototype.disableDragging=function(){this.GCM513.disableDragging();}
GeoCoderMap.prototype.draggingEnabled=function(){return this.GCM513.draggingEnabled();}
GeoCoderMap.prototype.enableInfoWindow=function(){this.GCM513.enableInfoWindow();}
GeoCoderMap.prototype.disableInfoWindow=function(){this.GCM513.disableInfoWindow();}
GeoCoderMap.prototype.infoWindowEnabled=function(){return this.GCM513.infoWindowEnabled();}
GeoCoderMap.prototype.enableDoubleClickZoom=function(){this.GCM513.enableDoubleClickZoom();}
GeoCoderMap.prototype.disableDoubleClickZoom=function(){this.GCM513.disableDoubleClickZoom();}
GeoCoderMap.prototype.doubleClickZoomEnabled=function(){return this.GCM513.doubleClickZoomEnabled();}
GeoCoderMap.prototype.enableContinuousZoom=function(){this.GCM513.enableContinuousZoom();}
GeoCoderMap.prototype.disableContinuousZoom=function(){this.GCM513.disableContinuousZoom();}
GeoCoderMap.prototype.continuousZoomEnabled=function(){return this.GCM513.continuousZoomEnabled();}
GeoCoderMap.prototype.enableScrollWheelZoom=function(){this.GCM513.enableScrollWheelZoom();}
GeoCoderMap.prototype.disableScrollWheelZoom=function(){this.GCM513.disableScrollWheelZoom();}
GeoCoderMap.prototype.scrollWheelZoomEnabled=function(){return this.GCM513.scrollWheelZoomEnabled();}
GeoCoderMap.prototype.addSmallMapControl=function(){this.GCM513.addControl(new GSmallMapControl());}
GeoCoderMap.prototype.addLargeMapControl=function(){this.GCM513.addControl(new GLargeMapControl());}
GeoCoderMap.prototype.addSmallZoomControl=function(){this.GCM513.addControl(new GSmallZoomControl());}
GeoCoderMap.prototype.addScaleControl=function(){this.GCM513.addControl(new GScaleControl(),new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(160,5)));}
GeoCoderMap.prototype.addMapTypeControl=function(){this.GCM513.addControl(new GMapTypeControl());}
GeoCoderMap.prototype.addMenuMapTypeControl=function(){this.GCM513.addControl(new GMenuMapTypeControl());}
GeoCoderMap.prototype.addHierarchicalMapTypeControl=function(){this.GCM513.addControl(new GHierarchicalMapTypeControl());}
GeoCoderMap.prototype.addOverviewMapControl=function(){this.GCM513.addControl(new GOverviewMapControl());}
GeoCoderMap.prototype.setCenter=function(GCM323,GCM72){if(GCM323){GCM72=parseInt(GCM72);if(isNaN(GCM72)){GCM72=this.GCM513.getZoom();};this.GCM513.setCenter(new GLatLng(GCM323.lat(),GCM323.lng()),GCM72);this.GCM513.savePosition();};}
GeoCoderMap.prototype.setZoom=function(GCM72){if(GCM72){GCM72=parseInt(GCM72);if(isNaN(GCM72)){throw new Error("Valore di zoom specificato non valido");return;};this.GCM513.setZoom(GCM72);};}
GeoCoderMap.prototype.zoomIn=function(){this.GCM513.zoomIn();}
GeoCoderMap.prototype.zoomOut=function(){this.GCM513.zoomOut();}
GeoCoderMap.prototype.checkResize=function(){this.GCM513.checkResize();}
GeoCoderMap.prototype.searchLatLng=function(GCM323,GCM284){var GCM288=this;this.GCM91.getLocations(new GLatLng(GCM323.lat(),GCM323.lng()),function(GCM140){GCM288.GCM120(GCM140,GCM323,GCM284);});}
GeoCoderMap.prototype.searchAddress=function(GCM92,GCM284){var GCM288=this;this.GCM91.getLocations(GCM92,function(GCM140){var GCM118=null;if(GCM140.Status.code==G_GEO_SUCCESS){var GCM270=GCM140.Placemark[0].Point.coordinates;GCM118=new GLatLng(GCM270[1],GCM270[0]);var GCM114=0;var GCM108=GCM140.Placemark[0].AddressDetails.Accuracy;if(GCM108>=6){GCM114=15;}else if(GCM108>=4){GCM114=12;}else if(GCM108>=2){GCM114=7;}else{GCM114=5;};GCM288.GCM513.setCenter(GCM118,GCM114);};GCM288.GCM120(GCM140,GCM118,GCM284);});}
GeoCoderMap.prototype.GCM120=function(GCM140,GCM147,GCM284){var GCM374=[];if(GCM140.Placemark){for(var GCM460=0;GCM460<GCM140.Placemark.length;++GCM460){GCM374.push(new GeoLocation(GCM140.Placemark[GCM460]));};};if(GCM147!=null){if(this.GCM245.isHidden()){this.GCM245.show();};this.GCM245.setLatLng(GCM147);}else{if(!this.GCM245.isHidden()){this.GCM245.hide();};};GCM284.apply(null,[GCM140.name,GCM374]);}
GeoCoderMap.prototype.enableDraggingAddress=function(GCM284){GEvent.addListener(this.GCM245,"dragend",function(GCM147){GCM284.apply(null,[new GeoPoint(GCM147.lat(),GCM147.lng())]);});this.GCM245.enableDragging();}
GeoCoderMap.prototype.disableDraggingAddress=function(){this.GCM245.disableDragging();GEvent.clearInstanceListeners(this.GCM245);}
GeoCoderMap.prototype.drawCircle=function(GCM323,GCM190,GCM161,GCM201,GCM202,GCM203,GCM204,GCM205){GCM190=parseFloat(GCM190)||10;var GCM189=(GCM323)?(new GLatLng(GCM323.lat(),GCM323.lng())):this.GCM513.getCenter();var GCM174=GCM189.distanceFrom(new GLatLng(GCM189.lat()+0.1,GCM189.lng()))/100;var GCM178=GCM189.distanceFrom(new GLatLng(GCM189.lat(),GCM189.lng()+0.1))/100;var GCM514=new GLatLngBounds();var GCM200=[];var GCM185=parseInt(360/GCM161)||10;for(var i=0;i<=360;i+=GCM185){var GCM270=new GLatLng(GCM189.lat()+(GCM190/GCM174*Math.cos(i*Math.PI/180)),GCM189.lng()+(GCM190/GCM178*Math.sin(i*Math.PI/180)));GCM200.push(GCM270);GCM514.extend(GCM270);};GCM204=GCM204||GCM201||"#0055ff";GCM202=GCM202||2;var GCM216=new GPolygon(GCM200,GCM201,GCM202,GCM203,GCM204,GCM205);var GCM234=new GCM273(this.GCM242.GCM559,GCM216);this.GCM242.GCM554(GCM234.ID,GCM234);this.GCM513.addOverlay(GCM216);this.GCM513.setZoom(this.GCM513.getBoundsZoomLevel(GCM514));this.GCM513.panTo(GCM514.getCenter());this.GCM513.savePosition();return GCM234;}
GeoCoderMap.prototype.removeCircleById=function(GCM278){var GCM234=this.GCM242.GCM538(GCM278);if(GCM234){var GCM237=GCM234.GCM298;GEvent.clearInstanceListeners(GCM234);GEvent.clearInstanceListeners(GCM237);this.GCM513.removeOverlay(GCM237);}else{throw new Error("Impossibile accedere al cerchio con ID \""+GCM278+"\"");};}
GeoCoderMap.prototype.removeAllCircle=function(){for(var GCM244 in this.GCM242.GCM566){this.removeCircleById((this.GCM242.GCM550(GCM244)).ID);};}
GeoCoderMap.prototype.removeAddress=function(){this.GCM245.hide();}
GeoCoderMap.prototype.loadXmlData=function(GCM387,GCM509){var GCM252=new GCM375(this);GCM252.GCM383(GCM387,GCM509);}
GeoCoderMap.prototype.clear=function(){this.removeAllCircle();this.removeAddress();var GCM260=this.GCM487.length;for(var GCM460=0;GCM460<GCM260;GCM460++){this.GCM513.removeOverlay(this.GCM487.pop());};}
function GeoLocation(GCM266){this.GCM272=GCM266;}
GeoLocation.prototype.getPoint=function(){var GCM270=this.GCM272.Point.coordinates;return(new GeoPoint(GCM270[1],GCM270[0]));}
GeoLocation.prototype.getAddress=function(){return this.GCM272.address;}
GeoLocation.prototype.getAddressDetails=function(){return this.GCM272.AddressDetails;}
function GCM273(GCM278,GCM277){this.GCM298=GCM277;this.ID=GCM278;}
GCM273.prototype.addListener=function(GCM293,GCM284){var GCM288=this;GEvent.addListener(GCM288,GCM293,GCM284);GEvent.addListener(GCM288.GCM298,GCM293,function(){GEvent.trigger(GCM288,GCM293,arguments);});}
GCM273.prototype.removeListener=function(GCM293){GEvent.clearListeners(this,GCM293);GEvent.clearListeners(this.GCM298,GCM293);}
GCM273.prototype.setStrokeStyle=function(GCM299){this.GCM298.setStrokeStyle(GCM299);}
GCM273.prototype.setFillStyle=function(GCM299){this.GCM298.setFillStyle(GCM299);}
function GeoPoint(GCM309,GCM311){GCM309=parseFloat(GCM309);GCM311=parseFloat(GCM311);if(isNaN(GCM309)||isNaN(GCM311)){throw new Error("Coordinate geografiche specificate non valide");return;};this.GCM318=GCM309;this.GCM319=GCM311;}
GeoPoint.prototype.lat=function(){return this.GCM318;}
GeoPoint.prototype.lng=function(){return this.GCM319;}
GeoPoint.prototype.distanceFrom=function(GCM323){var GCM374=-1;if(GCM323){var GCM321=new GLatLng(this.GCM318,this.GCM319);GCM374=GCM321.distanceFrom(new GLatLng(GCM323.lat(),GCM323.lng()));};return GCM374;}
function GCM449(GCM329){this.GCM371={};this.GCM338=GCM329;}
GCM449.prototype.GCM472=function(GCM372){var GCM374=this.GCM371[GCM372];if(GCM374==null){if(this.GCM338!=null){var GCM360=this.GCM338[GCM372];if(GCM360!=null){var GCM350=GCM360.I;if(GCM350!=null){GCM374=new GIcon();var GCM369=GCM350.W;var GCM370=GCM350.H;GCM374.image=GCM350.P;GCM374.iconAnchor=new GPoint((GCM369/2),GCM370);GCM374.infoWindowAnchor=new GPoint((GCM369/2),0);GCM374.iconSize=new GSize(GCM369,GCM370);var GCM447=GCM360.S;if(GCM447!=null){GCM369=GCM447.W;GCM370=GCM447.H;GCM374.shadow=GCM447.P;GCM374.shadowSize=new GSize(GCM369,GCM370);};};this.GCM371[GCM372]=GCM374;};};};return GCM374;};function GCM375(GCM380){this.GCM486=GCM380;this.GCM513=GCM380.GCM513;this.GCM471=null;}
GCM375.prototype.GCM383=function(GCM387,GCM509){var GCM389=GXml.parse(GCM387);var GCM454=GCM389.documentElement;var GCM450={};var GCM459=this.GCM525(GCM454,"Style");for(var GCM460=0;GCM460<GCM459.length;++GCM460){var GCM615=GCM459[GCM460];var GCM445=this.GCM530(GCM615,"id");if(GCM445){GCM450[GCM445]={};var GCM438="width";var GCM443="height";var GCM427=this.GCM525(GCM615,"Icon")[0];if(GCM427){GCM450[GCM445].I={};GCM450[GCM445].I.W=this.GCM530(GCM427,GCM438);GCM450[GCM445].I.H=this.GCM530(GCM427,GCM443);GCM450[GCM445].I.P=this.GCM522(GCM427);};var GCM447=this.GCM525(GCM615,"Shadow")[0];if(GCM447){GCM450[GCM445].S={};GCM450[GCM445].S.W=this.GCM530(GCM447,GCM438);GCM450[GCM445].S.H=this.GCM530(GCM447,GCM443);GCM450[GCM445].S.P=this.GCM522(GCM447);};};};this.GCM471=new GCM449(GCM450);var GCM514=new GLatLngBounds();var GCM459=this.GCM525(GCM454,"Point");for(var GCM460=0;GCM460<GCM459.length;++GCM460){var GCM615=GCM459[GCM460];var GCM481=parseFloat(this.GCM530(GCM615,"lat"));var GCM482=parseFloat(this.GCM530(GCM615,"lng"));if(!isNaN(GCM481)&&!isNaN(GCM482)){var GCM483={};GCM483.icon=this.GCM471.GCM472(this.GCM522(this.GCM525(GCM615,"StyleRef")[0]));GCM483.title=this.GCM522(this.GCM525(GCM615,"Snippet")[0]);var GCM508=new GMarker(new GLatLng(GCM481,GCM482),GCM483);this.GCM513.addOverlay(GCM508);this.GCM486.GCM487.push(GCM508);var GCM506=[];var GCM497=this.GCM525(GCM615,"Ballon");for(var GCM498=0;GCM498<GCM497.length;++GCM498){GCM615=GCM497[GCM498];GCM506.push(new GInfoWindowTab(this.GCM530(GCM615,"name"),this.GCM522(GCM615)));};this.GCM515(GCM508,GCM506);if(GCM509){GCM514.extend(GCM508.getLatLng());}};};if(GCM509&&!GCM514.isEmpty()){this.GCM513.setZoom(this.GCM513.getBoundsZoomLevel(GCM514));this.GCM513.panTo(GCM514.getCenter());};}
GCM375.prototype.GCM515=function(GCM520,GCM521){if(GCM521.length>0){GEvent.addListener(GCM520,"click",function(){GCM520.openInfoWindowTabsHtml(GCM521);});};}
GCM375.prototype.GCM522=function(GCM533){return GXml.value(GCM533);}
GCM375.prototype.GCM525=function(GCM533,GCM534){return GCM533.getElementsByTagName(GCM534);}
GCM375.prototype.GCM530=function(GCM533,GCM534){return GCM533.getAttribute(GCM534);}
function GCM535(){this.GCM559=0;this.GCM566=[];}
GCM535.prototype.GCM538=function(GCM567){var GCM549;if(typeof(this.GCM566[GCM567])!='undefined'){this.GCM559--;var GCM549=this.GCM566[GCM567];delete this.GCM566[GCM567];}
return GCM549;}
GCM535.prototype.GCM550=function(GCM567){return this.GCM566[GCM567];}
GCM535.prototype.GCM554=function(GCM567,GCM563){if(typeof(this.GCM566[GCM567])=='undefined'){this.GCM559++;}
this.GCM566[GCM567]=GCM563;return GCM563;}
GCM535.prototype.GCM564=function(GCM567){return typeof(this.GCM566[GCM567])!='undefined';}
var GCM568=new function(){this.GCM600="G"+parseInt(Math.random()*1000);this.GCM614=null;this.GCM571=function(GCM586,GCM575){this.GCM614=GCM575;var GCM602=document.createElement("script");var GCM598=document.getElementsByTagName("head").item(0);var GCM589="id="+this.GCM600+"&a=GCM568.GCM596";for(var GCM587 in GCM586){GCM589=GCM589+"&"+GCM587+"="+encodeURIComponent(GCM586[GCM587]);};var GCM591="http://www.geocms.it/API/CheckLicense?"+GCM589;GCM602.setAttribute("src",GCM591);GCM602.setAttribute("id",this.GCM600);GCM598.appendChild(GCM602);}
this.GCM596=function(GCM609){var GCM598=document.getElementsByTagName("head").item(0);var GCM602=document.getElementById(this.GCM600);if(GCM602){GCM598.removeChild(GCM602);};var GCM615=document.createElement("div");GCM615.innerHTML=GCM609[0];this.GCM614.appendChild(GCM615);var GCM613=GCM609[1];if(GCM613.length>0){var GCM615=document.createElement("div");GCM615.innerHTML=GCM613;this.GCM614.appendChild(GCM615);};}}}
