 var cj=null;var bJ=null;var ao=null;var aA=null;var ap=null;var aB=null;var am=null;var an=null;var ay=null;var ck=null;var bK=null;var bX=null;var bL=null;var bc=null;var bM=new Array();var cg=0;var bp="";var bz=false;var bb=0;var aM=null;var aP=1;var aQ=1;var networkLink=null;var cq=null;var cr=null;if((navigator.userAgent.indexOf('MSIE')!=-1)&&(navigator.userAgent.indexOf('Win')!=-1)){bz=true;}aT=42.102244;aV=2.505167;bl=8;if(getCookie("AmpleFinestra")=="1"){bl=8;}if(zxs!=""){aT=42.102244;aV=2.505167;bl=2;}function c(){};function O(){};function r(){};function K(){};function e(){};function v(){};function d(){};function m(){};function o(){};function n(){};function H(){};function J(){};function I(){};function k(){};function F(){};function f(){};function w(){};function g(){};function B(){};function j(){};function D(){};function l(){};function G(){};function t(){};function Z(){var bm=window.open("/ajuda.html","ajuwin","width=600,height=550,scrollbars=yes,resizable=yes");};function ac(){bC='';document.getElementById("missatges_mapa").innerHTML=bC;switch(aM){case "PHYSICAL":bJ.setMapType(G_PHYSICAL_MAP);bJ.addControl(av);bJ.addControl(ax);bJ.addControl(aI);break;case "NORMAL":bJ.setMapType(G_NORMAL_MAP);bJ.addControl(aH);bJ.addControl(ax);bJ.addControl(aw);break;case "SATELLITE":bJ.setMapType(G_SATELLITE_MAP);bJ.addControl(av);bJ.addControl(aJ);bJ.addControl(aw);break;default:bJ.setMapType(G_PHYSICAL_MAP);bJ.addControl(av);bJ.addControl(ax);bJ.addControl(aI);}bJ.addControl(an);bJ.addControl(az);bJ.addControl(at);bJ.addControl(aq);bJ.addControl(ar);bJ.addControl(as);bJ.addControl(au);if(ck!=""){ge.getGlobe().getFeatures().removeChild(networkLink);bJ.setCenter(cq,cr);bJ.addControl(am);bJ.addControl(ay);if(aP==1){bJ.addControl(ap);}else{bJ.addControl(aB);}if(aQ==1){bJ.addControl(ao);ag();}else{bJ.addControl(aA);}if(bp!=""){switch(bp){case "5":bJ.addControl(aF);break;case "10":bJ.addControl(aC);break;case "25":bJ.addControl(aD);break;case "50":bJ.addControl(aE);break;case "g50":bJ.addControl(aG);break;}V();}}};function IniciaGoogleEarth(object){ge=object;ge.getWindow().setVisibility(true);var navControl=ge.getNavigationControl();navControl.setVisibility(ge.VISIBILITY_SHOW);ge.getLayerRoot().enableLayerById(ge.LAYER_TERRAIN,true);if(aQ==1)loadOverlay();};function ErrorGoogleEarth(object){alert("Error inesperat al carregar el plugin de Google Earth");};function loadOverlay(){networkLink=ge.createNetworkLink("");networkLink.setDescription("NetworkLink open to fetched content");networkLink.setName("Open NetworkLink");networkLink.setFlyToView(true);var link=ge.createLink("");link.setHref(ck);networkLink.setLink(link);ge.getFeatures().appendChild(networkLink);};function ab(){if(bb==0){bK.closeInfoWindow();}bC='<A href="javascript:void(0)" OnClick="ac();return false;"><img src="/wp-content/icons_googlemaps/arrow-reverse.png" width="39" height="32" border=0 ALT="Tornar a la vista de relleu" TITLE="Tornar a la vista de relleu"></A>';document.getElementById("missatges_mapa").innerHTML=bC;ah();bJ.removeControl(an);switch(aM){case "PHYSICAL":bJ.setMapType(G_PHYSICAL_MAP);bJ.removeControl(av);bJ.removeControl(ax);bJ.removeControl(aI);break;case "NORMAL":bJ.setMapType(G_NORMAL_MAP);bJ.removeControl(aH);bJ.removeControl(ax);bJ.removeControl(aw);break;case "SATELLITE":bJ.setMapType(G_SATELLITE_MAP);bJ.removeControl(av);bJ.removeControl(aJ);bJ.removeControl(aw);break;default:bJ.setMapType(G_PHYSICAL_MAP);bJ.removeControl(av);bJ.removeControl(ax);bJ.removeControl(aI);}bJ.removeControl(az);bJ.removeControl(at);bJ.removeControl(aq);bJ.removeControl(ar);bJ.removeControl(as);bJ.removeControl(au);switch(bp){case "5":bJ.removeControl(aF);break;case "10":bJ.removeControl(aC);break;case "25":bJ.removeControl(aD);break;case "50":bJ.removeControl(aE);break;case "g50":bJ.removeControl(aG);break;}if(aQ==1){R();}cq=bJ.getCenter();cr=bJ.getZoom();bJ.setMapType(G_SATELLITE_3D_MAP);bJ.getEarthInstance(GEvent.callback(this,this.IniciaGoogleEarth));};function Y(){window.location.href=ck;};function ad(bW,options){var bd=new GMarker(bW,options);GEvent.addListener(bd,"click",function(){html='<div id="globus" style="width:350px;">'+'<a href="'+options.link+'" style="text-decoration:none"><img align="left" src="'+options.imatge+'" width="100" ALT="Consultar la ruta" TITLE="Consultar la ruta" border=0/></a>'+'<span class="titol">'+options.titol+'</span>'+'<br /><span class="descripcio" style="text-align:justify">'+options.descripcio+'</span>'+'<div id="globus" style="width:345px;text-align:right;padding-right:0px;">';if(options.link_track!=""){html+='<a href="javascript:ae(\'http://www.senderisme.tk'+options.link_track+'?'+Math.random()+'\')" style="text-decoration:none"><img src="/wp-content/icons_googlemaps/track.png" border=0 ALT="Veure el track" TITLE="Veure el track"></a>';}html+='<a href="'+options.link+'" style="text-decoration:none"><img src="/wp-content/icons_googlemaps/ampliar.png" border=0 ALT="Consultar la ruta" TITLE="Consultar la ruta"></a></div>'+'</div>';bd.openInfoWindowHtml(html);ai();});return bd;};function aa(bW,options){var aR=new GMarker(bW,options);GEvent.addListener(aR,"click",function(){html='<div id="globus" style="width:250px;">'+'<span class="titol"><a href="http://www.panoramio.com/" target="_blank" style="text-decoration:none">PANORAMIO</a></span>'+'<br /><a target="_blank" href="http://www.panoramio.com/photo/'+options.lafoto_id+'" style="text-decoration:none"><img width=200 src="http://www.panoramio.com/photos/small/'+options.lafoto_id+'.jpg"/ ALT="Veure la foto" TITLE="Veure la foto"></a><br />'+'<br /><span class="descripcio"><strong>'+options.lafoto_titol+'</strong><br />Foto feta per <a target="_blank" href="http://www.panoramio.com/user/'+options.lafoto_propid+'" style="text-decoration:none" >'+options.lafoto_propnom+'</a></span>'+'</div>';aR.openInfoWindowHtml(html);});return aR;};function ae(ci){ck=ci;bJ.closeInfoWindow();var cl=bJ.getBounds();var cn=cl.toString().split("\,");for(var ee=0;ee<4;ee++){cn[ee]=cn[ee].toString().split("(").join("");cn[ee]=cn[ee].toString().split(")").join("");cn[ee]=cn[ee].toString().split(" ").join("");}var bP=(1*cn[3]+1*cn[1])/2;var bN=(1*cn[2]-1*cn[0])/8;var bO=cn[0]*1+bN;bX=new GLatLng(bO,bP);bK=new GMarker(bX);bJ.addOverlay(bK);var html='<div id="globus" style="width:300px;">'+'<img align="left" src="http://www.senderisme.tk/wp-content/icons_googlemaps/missatge.png" width="32" height="32"/>'+'<span class="titol">Carregant track</span>'+'<br /><span class="descripcio" style="text-align:justify">Si us plau esperi un moment, estic carregant el track...</span>'+'</div>';bK.openInfoWindowHtml(html,{'onCloseFn':bJ.removeOverlay(bK)});bJ.removeOverlay(cj);cj=new GGeoXml(ci,aj);};function aj(){bJ.addOverlay(cj);cj.gotoDefaultViewport(bJ);var cl=cj.getDefaultBounds();bK.closeInfoWindow();if(cl!=null){var cn=cl.toString().split("\,");for(var ee=0;ee<4;ee++){cn[ee]=cn[ee].toString().split("(").join("");cn[ee]=cn[ee].toString().split(")").join("");cn[ee]=cn[ee].toString().split(" ").join("");}var bV="/js/recull_fotos.php?miny="+cn[0]+"&minx="+cn[1]+"&maxy="+cn[2]+"&maxx="+cn[3];var bY=new Json.Remote(bV,{'onComplete':function(bA){cg=bA.photos.length;for(i=0;i<cg;i++){var bD=new GIcon(G_DEFAULT_ICON);bD.image=bA.photos[i].photo_file_url.toString().split("/square/").join("/mini_square/");bD.iconSize=new GSize(32,32);bD.shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/noombra.png";bD.shadowSize=new GSize(32,32);var bt=new GLatLng(bA.photos[i].latitude,bA.photos[i].longitude);lafoto_id=bA.photos[i].photo_id;lafoto_titol=bA.photos[i].photo_title;lafoto_propid=bA.photos[i].owner_id;lafoto_propnom=bA.photos[i].owner_name;bM[i]=aa(bt,{'icon':bD,'lafoto_id':lafoto_id,'lafoto_titol':lafoto_titol,'lafoto_propid':lafoto_propid,'lafoto_propnom':lafoto_propnom});bJ.addOverlay(bM[i]);}bJ.addControl(ap);}});bY.send();bJ.addControl(ao);bJ.addControl(am);bJ.addControl(ay);}else{alert("Error inesperat al definir els límits del track");}};function ai(){ck="";ah();bJ.removeOverlay(cj);cj=new GGeoXml();bJ.addOverlay(cj);for(var h=0;h<cg;h++){bJ.removeOverlay(bM[h]);}cg=0;};function ah(){bJ.removeControl(ay);bJ.removeControl(am);bJ.removeControl(ao);bJ.removeControl(aA);bJ.removeControl(ap);bJ.removeControl(aB);};function ag(){bJ.addOverlay(cj);};function af(){for(var h=0;h<cg;h++){bJ.addOverlay(bM[h]);}};function R(){bJ.removeOverlay(cj);};function Q(){for(var h=0;h<cg;h++){bJ.removeOverlay(bM[h]);}};var bq=null;function V(){var bu=new GCopyrightCollection("Capes Ràster &copy;");var bv=new GCopyright(99,new GLatLngBounds(new GLatLng(-90,-180),new GLatLng(90,180)),7,"Institut Cartogràfic de Catalunya");bu.addCopyright(bv);var bh=new Array();bh[0]=new GTileLayer(bu,7,19);bh[0].getTileUrl=function(bf,bg){var ak=256;var al=256;var aK=new GPoint(bf.x*ak,bf.y*al);var aL=new GPoint((bf.x+1)*ak,(bf.y+1)*al);var aN=G_SATELLITE_MAP.getProjection().fromPixelToLatLng(aK,bg);var aO=G_SATELLITE_MAP.getProjection().fromPixelToLatLng(aL,bg);switch(bp){case "5":bs="mtc5m";break;case "10":bs="mtc10m";break;case "25":bs="mtc25m";break;case "50":bs="mtc50m";break;case "g50":bs="mgc50m";break;case "default":bs="mtc50m";}var be=aN.x+","+aO.y+","+aO.x+","+aN.y;var bR="http://shagrat.icc.es/lizardtech/iserv/ows?VERSION=1.1.1&REQUEST=GetMap&Service=WMS&LAYERS="+bs+"&SRS=EPSG:4326&WIDTH="+ak+"&HEIGHT="+al+"&TRANSPARENT=FALSE&FORMAT=image/jpeg&STYLES=&EXCEPTION=INIMAGE&BBOX="+be;document.getElementById("missatges_mapa").innerHTML="<div>Les capes raster han estat proveïdes per l'Institut Cartogràfic de Catalunya <A href='http://www.icc.cat' target='_blank'>www.icc.cat</A></div>";return bR;};bh[1]=G_HYBRID_MAP.getTileLayers()[1];bq=new GMapType(bh,G_SATELLITE_MAP.getProjection(),"ICC",{errorMessage:"No puc servir aquest mapa"});bJ.setMapType(bq);};function X(aS,aW){var a=6378388.000;var by=0.006722670022;var bG=0.9996;var bw=0.01745329251994;var ba=(aW+180.0)-parseInt((aW+180.0)/360.0)*360.0-180.0;var aU=aS*bw;var aZ=ba*bw;var bk=parseInt(((ba+180.0)/6.0)+1);if(aS>=56.0&&aS<64.0&&ba>=3.0&&ba<12.0)bk=32;var aX=((bk-1.0)*6.0-180.0+3.0);var aY=(aX*bw);var bx=(by)/(1.0-by);var N=(a/Math.sqrt(1-by*Math.sin(aU)*Math.sin(aU)));var T=(Math.tan(aU)*Math.tan(aU));var C=(bx*Math.cos(aU)*Math.cos(aU));var A=(Math.cos(aU)*(aZ-aY));var M=(a*((1.0-by/4.0-3.0*by*by/64.0-5.0*by*by*by/256.0)*aU-(3.0*by/8.0+3.0*by*by/32.0+45.0*by*by*by/1024.0)*Math.sin(2.0*aU)+(15.0*by*by/256.0+45.0*by*by*by/1024.0)*Math.sin(4.0*aU)-(35.0*by*by*by/3072.0)*Math.sin(6.0*aU)));bi=(bG*N*(A+(1.0-T+C)*A*A*A/6.0+(5.0-18.0*T+T*T+72.0*C-58.0*bx)*A*A*A*A*A/120.0)+500000.0);bj=(bG*(M+N*Math.tan(aU)*(A*A/2.0+(5.0-T+9.0*C+4*C*C)*A*A*A*A/24.0+(61.0-58.0*T+T*T+600.0*C-330.0*bx)*A*A*A*A*A*A/720.0)));var bZ=new Array(bj,bi);return bZ;};function P(bU){document.getElementById("missatges_mapa").innerHTML="<div></div>";if(bU==1){switch(aM){case "PHYSICAL":bJ.setMapType(G_PHYSICAL_MAP);break;case "NORMAL":bJ.setMapType(G_NORMAL_MAP);break;case "SATELLITE":bJ.setMapType(G_SATELLITE_MAP);break;}}else{switch(bp){case "5":bJ.removeControl(aF);bJ.addControl(at);break;case "10":bJ.removeControl(aC);bJ.addControl(aq);break;case "25":bJ.removeControl(aD);bJ.addControl(ar);break;case "50":bJ.removeControl(aE);bJ.addControl(as);break;case "g50":bJ.removeControl(aG);bJ.addControl(au);break;}}bp="";};function CarregaMapa(){if(!GBrowserIsCompatible()){alert("El seu navegador no és compatible amb l'API de Google Maps");}else{U();}};function U(){if(!bz){var L=navigator.plugins.length;for(var i=0;i<L;i++){if(navigator.plugins[i].name=="Google Earth Plugin"){bb=1;i=L;}}}bJ=new GMap2(document.getElementById("mapagoogle"));bJ.addControl(new GLargeMapControl());bJ.addControl(new GMapTypeControl());bJ.addControl(new GScaleControl());m.prototype=new GControl();m.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/mapa_off.png";bF.ALT="Mostrar mapa de carrers";bF.TITLE="Mostrar mapa de carrers";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aM="NORMAL";if(bJ.getCurrentMapType().getName()=="ICC"){P(0);}bJ.setMapType(G_NORMAL_MAP);bJ.removeControl(av);bJ.addControl(aH);bJ.removeControl(aJ);bJ.addControl(ax);bJ.removeControl(aI);bJ.addControl(aw);});bJ.getContainer().appendChild(container);return container;};m.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,5));};m.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";button.style.cursor="pointer";};H.prototype=new GControl();H.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/mapa.png";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);bJ.getContainer().appendChild(container);return container;};H.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,5));};H.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";};o.prototype=new GControl();o.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/satelit_off.png";bF.ALT="Mostrar imatges de satèl·lit";bF.TITLE="Mostrar imatges de satèl·lit";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aM="SATELLITE";if(bJ.getCurrentMapType().getName()=="ICC"){P(0);}bJ.setMapType(G_SATELLITE_MAP);bJ.removeControl(ax);bJ.addControl(aJ);bJ.removeControl(aH);bJ.addControl(av);bJ.removeControl(aI);bJ.addControl(aw);});bJ.getContainer().appendChild(container);return container;};o.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,55));};o.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";button.style.cursor="pointer";};J.prototype=new GControl();J.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/satelit.png";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);bJ.getContainer().appendChild(container);return container;};J.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,55));};J.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";};n.prototype=new GControl();n.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/relleu_off.png";bF.ALT="Mostrar relleu del terreny";bF.TITLE="Mostrar relleu del terreny";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aM="PHYSICAL";if(bJ.getCurrentMapType().getName()=="ICC"){P(0);}bJ.setMapType(G_PHYSICAL_MAP);bJ.removeControl(aw);bJ.addControl(aI);bJ.removeControl(aH);bJ.addControl(av);bJ.removeControl(aJ);bJ.addControl(ax);});bJ.getContainer().appendChild(container);return container;};n.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,105));};n.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";button.style.cursor="pointer";};I.prototype=new GControl();I.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/relleu.png";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);bJ.getContainer().appendChild(container);return container;};I.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,105));};I.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";};t.prototype=new GControl();t.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/iccpanel.png";bF.width="36";bF.height="215";var container=document.createElement("div");container.appendChild(bF);bJ.getContainer().appendChild(container);return container;};t.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(3,155));};k.prototype=new GControl();k.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc5k_off.png";bF.ALT="Capa raster 1:5000";bF.TITLE="Capa raster 1:5000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(aF);if(bp==""){bp="5";V();bJ.removeControl(at);}else{switch(bp){case "5":bJ.removeControl(at);break;case "10":bJ.removeControl(aC);bJ.addControl(aq);break;case "25":bJ.removeControl(aD);bJ.addControl(ar);break;case "50":bJ.removeControl(aE);bJ.addControl(as);break;case "g50":bJ.removeControl(aG);bJ.addControl(au);break;}bp="5";V();}});bJ.getContainer().appendChild(container);return container;};k.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,190));};k.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};F.prototype=new GControl();F.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc5k.png";bF.ALT="Capa raster 1:5000";bF.TITLE="Capa raster 1:5000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(at);bJ.removeControl(aF);P(1);});bJ.getContainer().appendChild(container);return container;};F.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,190));};F.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};f.prototype=new GControl();f.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc10k_off.png";bF.ALT="Capa raster 1:10000";bF.TITLE="Capa raster 1:10000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(aC);if(bp==""){bp="10";V();bJ.removeControl(aq);}else{switch(bp){case "5":bJ.removeControl(aF);bJ.addControl(at);break;case "10":bJ.removeControl(aq);break;case "25":bJ.removeControl(aD);bJ.addControl(ar);break;case "50":bJ.removeControl(aE);bJ.addControl(as);break;case "g50":bJ.removeControl(aG);bJ.addControl(au);break;}bp="10";V();}});bJ.getContainer().appendChild(container);return container;};f.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,225));};f.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};w.prototype=new GControl();w.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc10k.png";bF.ALT="Capa raster 1:10000";bF.TITLE="Capa raster 1:10000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(aq);bJ.removeControl(aC);P(1);});bJ.getContainer().appendChild(container);return container;};w.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,225));};w.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};g.prototype=new GControl();g.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc25k_off.png";bF.ALT="Capa raster 1:25000";bF.TITLE="Capa raster 1:25000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(aD);if(bp==""){bp="25";V();bJ.removeControl(ar);}else{switch(bp){case "5":bJ.removeControl(aF);bJ.addControl(at);break;case "10":bJ.removeControl(aC);bJ.addControl(aq);break;case "25":bJ.removeControl(ar);break;case "50":bJ.removeControl(aE);bJ.addControl(as);break;case "g50":bJ.removeControl(aG);bJ.addControl(au);break;}bp="25";V();}});bJ.getContainer().appendChild(container);return container;};g.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,260));};g.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};B.prototype=new GControl();B.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc25k.png";bF.ALT="Capa raster 1:25000";bF.TITLE="Capa raster 1:25000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(ar);bJ.removeControl(aD);P(1);});bJ.getContainer().appendChild(container);return container;};B.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,260));};B.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};j.prototype=new GControl();j.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc50k_off.png";bF.ALT="Capa raster 1:50000";bF.TITLE="Capa raster 1:50000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(aE);if(bp==""){bp="50";V();bJ.removeControl(as);}else{switch(bp){case "5":bJ.removeControl(aF);bJ.addControl(at);break;case "10":bJ.removeControl(aC);bJ.addControl(aq);break;case "25":bJ.removeControl(aD);bJ.addControl(ar);break;case "50":bJ.removeControl(as);break;case "g50":bJ.removeControl(aG);bJ.addControl(au);break;}bp="50";V();}});bJ.getContainer().appendChild(container);return container;};j.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,295));};j.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};D.prototype=new GControl();D.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/icc50k.png";bF.ALT="Capa raster 1:50000";bF.TITLE="Capa raster 1:50000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(as);bJ.removeControl(aE);P(1);});bJ.getContainer().appendChild(container);return container;};D.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,295));};D.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};l.prototype=new GControl();l.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/iccg50k_off.png";bF.ALT="Capa raster geologia 1:50000";bF.TITLE="Capa raster geologia 1:50000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(aG);if(bp==""){bp="g50";V();bJ.removeControl(au);}else{switch(bp){case "5":bJ.removeControl(aF);bJ.addControl(at);break;case "10":bJ.removeControl(aC);bJ.addControl(aq);break;case "25":bJ.removeControl(aD);bJ.addControl(ar);break;case "50":bJ.removeControl(aE);bJ.addControl(as);break;case "g50":bJ.removeControl(au);break;}bp="g50";V();}});bJ.getContainer().appendChild(container);return container;};l.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,330));};l.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};G.prototype=new GControl();G.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/iccg50k.png";bF.ALT="Capa raster geologia 1:50000";bF.TITLE="Capa raster geologia 1:50000";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){bJ.addControl(au);bJ.removeControl(aG);P(1);});bJ.getContainer().appendChild(container);return container;};G.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(5,330));};G.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};e.prototype=new GControl();e.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/camera.png";bF.ALT="Mostrar les fotos";bF.TITLE="Mostrar les fotos";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aP=0;Q();bJ.addControl(aB);bJ.removeControl(ap);});bJ.getContainer().appendChild(container);return container;};e.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(115,10));};e.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};v.prototype=new GControl();v.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/camera_no.png";bF.ALT="Ocultar el Fotos";bF.TITLE="Ocultar el Fotos";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aP=1;af();bJ.addControl(ap);bJ.removeControl(aB);});bJ.getContainer().appendChild(container);return container;};v.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(115,10));};v.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};d.prototype=new GControl();d.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/3dEarth.png";bF.ALT="Mostrar el track en 3D (Google Earth)";bF.TITLE="Mostrar el track en 3D (Google Earth)";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){Y();});bJ.getContainer().appendChild(container);return container;};d.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(150,10));};d.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};r.prototype=new GControl();r.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/track.png";bF.ALT="Mostrar el track";bF.TITLE="Mostrar el track";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aQ=0;R();bJ.addControl(aA);bJ.removeControl(ao);});bJ.getContainer().appendChild(container);return container;};r.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(75,5));};r.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};K.prototype=new GControl();K.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/track_no.png";bF.ALT="Ocultar el track";bF.TITLE="Ocultar el track";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){aQ=1;ag();bJ.addControl(ao);bJ.removeControl(aA);});bJ.getContainer().appendChild(container);return container;};K.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(75,5));};K.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};c.prototype=new GControl();c.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/ajuda.png";bF.ALT="Ajuda";bF.TITLE="Ajuda";bF.width="36";bF.height="48";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){Z();});bJ.getContainer().appendChild(container);return container;};c.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT,new GSize(3,20));};c.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="36px";button.style.height="48px";button.style.cursor="pointer";};O.prototype=new GControl();O.prototype.initialize=function(){var bF=document.createElement("img");bF.src="http://www.senderisme.tk/wp-content/icons_googlemaps/3dPlug.png";bF.ALT="Plugin Google Earth";bF.TITLE="Plugin Google Earth";bF.width="32";bF.height="32";var container=document.createElement("div");this.setButtonStyle_(container);container.appendChild(bF);GEvent.addDomListener(container,"click",function(){if(bb==0){var cl=bJ.getBounds();var cn=cl.toString().split("\,");for(var ee=0;ee<4;ee++){cn[ee]=cn[ee].toString().split("(").join("");cn[ee]=cn[ee].toString().split(")").join("");cn[ee]=cn[ee].toString().split(" ").join("");}var bP=(1*cn[3]+1*cn[1])/2;var bN=(1*cn[2]-1*cn[0])/8;var bO=cn[0]*1+bN;bX=new GLatLng(bO,bP);bK=new GMarker(bX,{'icon':bQ});bJ.addOverlay(bK);var html='<div id="globus" style="width:300px;">'+'<img align="left" src="http://www.senderisme.tk/wp-content/icons_googlemaps/missatge.png" width="32" height="32"/>'+'<span class="titol">Plugin de Google Earth</span>'+'<br /><span class="descripcio" style="text-align:justify">Google ha desenvolupat un plug-in que permet visualitzar escenaris geogr&agrave;fics 3D en el navegador. '+'Si no el t&eacute;, ara el pot instal&middot;lar gratu&iuml;tament. Nom&eacute;s cal seguir les indicacions. Aquests tipus d&#39;escenaris poden tardar uns segons en carregar-se...</span>'+'<div id="globus" style="width:300px;text-align:right;padding-right:5px;">';html+='<a href="javascript:ab()" style="text-decoration:none">continuar amb el proc&eacute;s</a></div>'+'</div>';bK.openInfoWindowHtml(html,{'onCloseFn':bJ.removeOverlay(bK)});}else{ab();}});bJ.getContainer().appendChild(container);return container;};O.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(185,10));};O.prototype.setButtonStyle_=function(button){button.style.textDecoration="none";button.style.width="32px";button.style.height="32px";button.style.cursor="pointer";};ao=new r();aA=new K();ap=new e();aB=new v();am=new d();ay=new O();av=new m();ax=new o();aw=new n();aH=new H();aJ=new J();aI=new I();az=new t();at=new k();aF=new F();aq=new f();aC=new w();ar=new g();aD=new B();as=new j();aE=new D();au=new l();aG=new G();bJ.removeMapType(G_HYBRID_MAP);bJ.removeMapType(G_SATELLITE_MAP);bJ.removeMapType(G_NORMAL_MAP);bJ.enableDoubleClickZoom();bJ.enableScrollWheelZoom();bc=new GLatLng(aT,aV);bJ.setCenter(bc,bl);bJ.setMapType(G_PHYSICAL_MAP);aM="PHYSICAL";bL=new GMarker(bc,{'icon':bQ});bJ.addOverlay(bL);var html='<div id="globus" style="width:300px;">'+'<img align="left" src="http://www.senderisme.tk/wp-content/icons_googlemaps/missatge.png" width="32" height="32"/>'+'<span class="titol">Esperi un moment</span>'+'<br /><span class="descripcio" style="text-align:justify">Si us plau esperi un moment. Estic carregant les dades de les rutes...</span>'+'</div>';bL.openInfoWindowHtml(html,{'onCloseFn':bJ.removeOverlay(bL)});var cb=new GSize(13,32);var ce=new GSize(32,32);var cd=new GSize(32,32);var cc=new GSize(32,32);var bQ=new GIcon(G_DEFAULT_ICON);bQ.image="http://www.senderisme.tk/wp-content/icons_googlemaps/missatge.png";bQ.shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/noombra.png";bQ.iconSize=cc;bQ.shadowSize=cc;if(zxs!=""){cj=new GGeoXml();bJ.addOverlay(cj);ae(zxs+'?'+Math.random());bL.closeInfoWindow();bJ.removeOverlay(bL);bJ.savePosition();an=new c();bJ.addControl(an);bJ.addControl(av);bJ.addControl(ax);bJ.addControl(aI);bJ.addControl(az);bJ.addControl(at);bJ.addControl(aq);bJ.addControl(ar);bJ.addControl(as);bJ.addControl(au);}else{var bn=new GIcon(G_DEFAULT_ICON);bn.image="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta.png";bn.shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_ombra.png";bn.iconSize=cb;bn.shadowSize=ce;var bo=new Array();bo[0]=new GIcon(G_DEFAULT_ICON);bo[0].image="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_1.png";bo[0].shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_x_ombra.png";bo[0].iconSize=cd;bo[0].shadowSize=cd;bo[1]=new GIcon(G_DEFAULT_ICON);bo[1].image="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_2.png";bo[1].shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_x_ombra.png";bo[1].iconSize=cd;bo[1].shadowSize=cd;bo[2]=new GIcon(G_DEFAULT_ICON);bo[2].image="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_3.png";bo[2].shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_x_ombra.png";bo[2].iconSize=cd;bo[2].shadowSize=cd;bo[3]=new GIcon(G_DEFAULT_ICON);bo[3].image="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_4.png";bo[3].shadow="http://www.senderisme.tk/wp-content/icons_googlemaps/bandereta_x_ombra.png";bo[3].iconSize=cd;bo[3].shadowSize=cd;var dades=GXmlHttp.create();var bB="";dades.open("GET","/wp-xml.php",true);dades.onreadystatechange=function(){if(dades.readyState==4){var cp=dades.responseXML;var ca=cp.documentElement.getElementsByTagName("ruta");for(var i=0;i<ca.length;i++){var bE=ca[i].getAttribute("id");var bH=parseFloat(ca[i].getAttribute("lat"));var bI=parseFloat(ca[i].getAttribute("lon"));var link=ca[i].getAttribute("link");var link_track=ca[i].getAttribute("link_track");var titol=ca[i].getElementsByTagName('titol')[0].firstChild.data;var descripcio=ca[i].getElementsByTagName('descripcio')[0].firstChild.data;var bW=new GLatLng(bH,bI);var imatge="/wp-content/fotos_googlemaps/"+bE+".jpg";if(i<4){if (i==0) {bB+='<div id="globus22envolvent">';} if (i==2) {bB+='</div><div id="globus22envolvent">'; }var co=ad(bW,{'icon':bo[i],'imatge':imatge,'titol':titol,'descripcio':descripcio,'link':link,'link_track':link_track});bB+='<div id="globus2envolvent">'+'<div id="globus2" style="margin-bottom:1px">'+'<div style="position:absolute;z-index:12;"><a href="'+link+'" style="text-decoration:none;"><img align="left" src="/wp-content/icons_googlemaps/ampliar.png" border=0 ALT="Consultar la ruta" TITLE="Consultar la ruta"></a></div>'+'<span class="titol">'+titol+'</span>'+'<a href="'+link+'" style="text-decoration:none"><img align="left" src="'+imatge+'" width="150" /></A>'+'<img align="right" style="margin:3px;"src="'+bo[i].image+'" />'+'<span class="descripcio" style="text-align:justify">'+descripcio+'</span>'+'</div></div>';}else{if (i==4){bB+='</div>'} var co=ad(bW,{'icon':bn,'imatge':imatge,'titol':titol,'descripcio':descripcio,'link':link,'link_track':link_track});}bJ.addOverlay(co);}document.getElementById("darreres_rutes").innerHTML=bB;bL.closeInfoWindow();bJ.removeOverlay(bL);an=new c();bJ.addControl(an);bJ.addControl(av);bJ.addControl(ax);bJ.addControl(aI);bJ.addControl(az);bJ.addControl(at);bJ.addControl(aq);bJ.addControl(ar);bJ.addControl(as);bJ.addControl(au);}};dades.send(null);cj=new GGeoXml();bJ.addOverlay(cj);GEvent.addListener(bJ,"zoomend",function(bT,bS){if(bS<=10){ai();}});}} 