 
function tick(){}var G_INCOMPAT=false;function GScript(src){document.write('<'+'script src="'+src+'"'+' type="text/javascript"><'+'/script>')}function GBrowserIsCompatible(){if(G_INCOMPAT)return false;return!!document.getElementById}function GApiInit(){if(GApiInit.called)return;GApiInit.called=true;window.GAddMessages&&GAddMessages({160:'\x3cH1\x3eServer Error\x3c/H1\x3eThe server encountered a temporary error and could not complete your request.\x3cp\x3ePlease try again in a minute or so.\x3c/p\x3e',1415:'.',1416:',',1547:'mi',1616:'km',4100:'m',4101:'ft',10018:'Loading...',10021:'Zoom In',10022:'Zoom Out',10024:'Drag to zoom',10029:'Return to the last result',10049:'Map',10050:'Satellite',10093:'Terms of Use',10111:'Map',10112:'Sat',10116:'Hybrid',10117:'Hyb',10120:'We are sorry, but we don\x27t have maps at this zoom level for this region.\x3cp\x3eTry zooming out for a broader look.\x3c/p\x3e',10121:'We are sorry, but we don\x27t have imagery at this zoom level for this region.\x3cp\x3eTry zooming out for a broader look.\x3c/p\x3e',10507:'Pan left',10508:'Pan right',10509:'Pan up',10510:'Pan down',10511:'Show street map',10512:'Show satellite imagery',10513:'Show imagery with street names',10806:'Click to see this area on Google Maps',10807:'Traffic',10808:'Show Traffic',10809:'Hide Traffic',12150:'%1$s on %2$s',12151:'%1$s on %2$s at %3$s',12152:'%1$s on %2$s between %3$s and %4$s',10985:'Zoom in',10986:'Zoom out',11047:'Center map here',11089:'\x3ca href\x3d\x22javascript:void(0);\x22\x3eZoom In\x3c/a\x3e to see traffic for this region',11259:'Full-screen',11751:'Show street map with terrain',11752:'Style:',11757:'Change map style',11758:'Terrain',11759:'Ter',11794:'Show labels',11303:'Street View Help',11274:'To use street view, you need Adobe Flash Player version %1$d or newer.',11382:'Get the latest Flash Player.',11314:'We\x27re sorry, street view is currently unavailable due to high demand.\x3cbr\x3ePlease try again later!',1559:'N',1560:'S',1561:'W',1562:'E',1608:'NW',1591:'NE',1605:'SW',1606:'SE',11907:'This image is no longer available',10041:'Help',12471:'Current Location',12492:'Earth',12823:'Google has disabled usage of the Maps API for this application. See the Terms of Service for more information: %1$s.',12822:'http://code.google.com/apis/maps/terms.html',12915:'Improve the map',12916:'Google, Europa Technologies',13171:'Hybrid 3D',0:''})}var GLoad;(function(){var jslinker={version:"182",jsbinary:[{id:"maps2",url:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/maps2/main.js"},{id:"maps2.api",url:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/maps2.api/main.js"},{id:"gc",url:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/gc.js"},{id:"suggest",url:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/suggest/main.js"},{id:"pphov",url:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/pphov.js"}]};GLoad=function(callback){var callee=arguments.callee;var apiCallback=callback;GApiInit();var opts={public_api:true,export_legacy_names:true,tile_override:[{maptype:0,min_zoom:7,max_zoom:7,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:366500000,lng_e7:1297000000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26"]},{maptype:0,min_zoom:8,max_zoom:9,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1279600000}},{lo:{lat_e7:345000000,lng_e7:1279600000},hi:{lat_e7:386200000,lng_e7:1286700000}},{lo:{lat_e7:348900000,lng_e7:1286700000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:354690000,lng_e7:1293600000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26"]},{maptype:0,min_zoom:10,max_zoom:19,rect:[{lo:{lat_e7:329890840,lng_e7:1246055600},hi:{lat_e7:386930130,lng_e7:1284960940}},{lo:{lat_e7:344646740,lng_e7:1284960940},hi:{lat_e7:386930130,lng_e7:1288476560}},{lo:{lat_e7:350277470,lng_e7:1288476560},hi:{lat_e7:386930130,lng_e7:1310531620}},{lo:{lat_e7:370277730,lng_e7:1310531620},hi:{lat_e7:386930130,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1.12\x26hl=en\x26src=api\x26"]},{maptype:3,min_zoom:7,max_zoom:7,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:366500000,lng_e7:1297000000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26"]},{maptype:3,min_zoom:8,max_zoom:9,rect:[{lo:{lat_e7:330000000,lng_e7:1246050000},hi:{lat_e7:386200000,lng_e7:1279600000}},{lo:{lat_e7:345000000,lng_e7:1279600000},hi:{lat_e7:386200000,lng_e7:1286700000}},{lo:{lat_e7:348900000,lng_e7:1286700000},hi:{lat_e7:386200000,lng_e7:1293600000}},{lo:{lat_e7:354690000,lng_e7:1293600000},hi:{lat_e7:386200000,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26"]},{maptype:3,min_zoom:10,rect:[{lo:{lat_e7:329890840,lng_e7:1246055600},hi:{lat_e7:386930130,lng_e7:1284960940}},{lo:{lat_e7:344646740,lng_e7:1284960940},hi:{lat_e7:386930130,lng_e7:1288476560}},{lo:{lat_e7:350277470,lng_e7:1288476560},hi:{lat_e7:386930130,lng_e7:1310531620}},{lo:{lat_e7:370277730,lng_e7:1310531620},hi:{lat_e7:386930130,lng_e7:1320034790}}],uris:["http://mt0.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt1.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt2.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26","http://mt3.gmaptiles.co.kr/mt/v=kr1p.12\x26hl=en\x26src=api\x26"]}],jsmain:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/maps2.api/main.js",obliques_urls:["http://khmdb0.google.com/kh?v=31\x26","http://khmdb1.google.com/kh?v=31\x26"],token:3019657888,jsmodule_base_url:"http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/maps2.api",generic_tile_urls:["http://mt0.google.com/vt?hl=en\x26src=api\x26","http://mt1.google.com/vt?hl=en\x26src=api\x26"]};var pageArgs={};apiCallback(["http://mt0.google.com/vt/lyrs\x3dm@132\x26hl\x3den\x26src\x3dapi\x26","http://mt1.google.com/vt/lyrs\x3dm@132\x26hl\x3den\x26src\x3dapi\x26"],["http://khm0.google.com/kh/v\x3d68\x26","http://khm1.google.com/kh/v\x3d68\x26"],["http://mt0.google.com/vt/lyrs\x3dh@132\x26hl\x3den\x26src\x3dapi\x26","http://mt1.google.com/vt/lyrs\x3dh@132\x26hl\x3den\x26src\x3dapi\x26"],"ABQIAAAAX1fmTO4v53OnAEbFs5d1lxRBDYefzF3RRl_1Z-NZAxDbS6LqBRQ4oHtoloChNllmBbdTaxCAnEUNCQ","","",true,"google.maps.",opts,["http://mt0.google.com/vt/lyrs\x3dt@125,r@132\x26hl\x3den\x26src\x3dapi\x26","http://mt1.google.com/vt/lyrs\x3dt@125,r@132\x26hl\x3den\x26src\x3dapi\x26"],jslinker,pageArgs);if(!callee.called){callee.called=true}}})();function GUnload(){if(window.GUnloadApi){GUnloadApi()}}var _mIsRtl=false;var _mF=[,,,,,20,4096,"bounds_cippppt.txt","cities_cippppt.txt","local/add/flagStreetView",true,,400,,,,,,,"/maps/c/ui/HovercardLauncher/dommanifest.js",,,,false,,,,,,,true,,,,,,,,"http://maps.google.com/maps/stk/fetch",0,,true,,,,true,,,,"http://maps.google.com/maps/stk/style",,"107485602240773805043.00043dadc95ca3874f1fa",,,false,1000,,"http://cbk0.google.com",false,,"ar,iw",,,,,,,,,"http://pagead2.googlesyndication.com/pagead/imgad?id\x3dCMKp3NaV5_mE1AEQEBgQMgieroCd6vHEKA",,,,,,false,,,,,"SS","en,fr,ja",,,,,,,true,,,,,,true,,,,,"","1",,false,false,,true,,,,"AU,BE,FR,NZ,US",,,,true,500,"http://chart.apis.google.com/chart?cht\x3dqr\x26chs\x3d80x80\x26chld\x3d|0\x26chl\x3d",,,,true,,,,,false,,,false,,true,,,true,,,,,,,,10,,true,true,,,,30,"infowindow_v1","",false,true,22,'http://khm.google.com/vt/lbw/lyrs\x3dm\x26hl\x3den\x26','http://khm.google.com/vt/lbw/lyrs\x3ds\x26hl\x3den\x26','http://khm.google.com/vt/lbw/lyrs\x3dy\x26hl\x3den\x26','http://khm.google.com/vt/lbw/lyrs\x3dp\x26hl\x3den\x26',,,false,"US,AU,NZ,FR,DK,MX,BE,CA,DE,GB,IE,PR,PT,RU,SG,JM,HK,TW,MY,TH,AT,CZ,CN,IN,KR",,,"windows-ie,windows-firefox,windows-chrome,macos-safari,macos-firefox,macos-chrome",true,false,20000,600,30,,,,,,false,false,,,"maps.google.com",,,,,"",true,,,,true,"4:http://gt%1$d.google.com/mt?v\x3dgwm.fresh\x26","4:http://gt%1$d.google.com/mt?v\x3dgwh.fresh\x26",true,false,,,0.25,,"107485602240773805043.0004561b22ebdc3750300",,,,,false,,,true,,8,,,,,false,"https://cbks0.google.com",,true,,,,,,false,,,,,,,,false,,,true,true,false,,,,true,"http://mt0.google.com/vt/ft",false,,"http://chart.apis.google.com/chart",,,,,,,'0.25',false,,,,,false,,2,160,,,,true,false,,,,,,,45,true,,false,true,true,,,,true,false,false,,false,false,,false,,false,false,,,,,false,,,,,true,,"DE,CH,LI,AT,BE,PL,NL,HU,GR,HR,CZ,SK,TR,BR,EE,ES,AD,SE,NO,DK,FI,IT,VA,SM,IL,CL,MX,AR,BG,PT",false,,"25",true,25,"Home for sale",,false,,true,false,,false,"4:https://gt%1$d.google.com/mt?v\x3dgwm.fresh\x26","4:https://gt%1$d.google.com/mt?v\x3dgwh.fresh\x26",,,,,"",,,false,true,,,,false,"1.x",,false,false,,,,,true,,,,,false,,true,,,24,6,2,,,0,,,,true,true,true,true,,,,false,,,false,,"/maps/c",true,100,1000,100,,2,,,true,true,,false,,false,false,,5,5,,"windows-firefox,windows-ie,windows-chrome,macos-firefox,macos-safari,macos-chrome",true,true,false,false,false,true,,true,false,false,false,true,false,,true,false,false,false,true,false,false,true,false,false,false,false,false,"1",false,'',true,false,18,false,,600,false,true,false,"http://www.google.com/maps/photos",false];var _mHost="http://maps.google.com";var _mUri="/maps";var _mDomain="google.com";var _mStaticPath="http://maps.gstatic.com/intl/en_ALL/mapfiles/";var _mJavascriptVersion=G_API_VERSION="270a";var _mTermsUrl="http://www.google.com/intl/en_ALL/help/terms_maps.html";var _mLocalSearchUrl="http://www.google.com/uds/solutions/localsearch/gmlocalsearch.js";var _mHL="en";var _mGL="";var _mTrafficEnableApi=true;var _mTrafficTileServerUrls=["http://mt0.google.com/mapstt","http://mt1.google.com/mapstt","http://mt2.google.com/mapstt","http://mt3.google.com/mapstt"];var _mCityblockLatestFlashUrl="http://maps.google.com/local_url?q=http://www.adobe.com/shockwave/download/download.cgi%3FP1_Prod_Version%3DShockwaveFlash&amp;dq=&amp;file=api&amp;v=2&amp;key=ABQIAAAAX1fmTO4v53OnAEbFs5d1lxRBDYefzF3RRl_1Z-NZAxDbS6LqBRQ4oHtoloChNllmBbdTaxCAnEUNCQ&amp;s=ANYYN7manSNIV_th6k0SFvGB4jz36is1Gg";var _mCityblockFrogLogUsage=false;var _mCityblockInfowindowLogUsage=false;var _mCityblockUseSsl=false;var _mSatelliteToken="fzwq1MzJsbAY1wxoLArQrTZ1VEQqlzcK-qE1XQ";var _mMapCopy="Map data \x26#169;2010 ";var _mSatelliteCopy="Imagery \x26#169;2010 ";var _mGoogleCopy="\x26#169;2010 Google";var _mPreferMetric=false;var _mDirectionsEnableApi=true;var _mLayersTileBaseUrls=['http://mt0.google.com/mapslt','http://mt1.google.com/mapslt','http://mt2.google.com/mapslt','http://mt3.google.com/mapslt'];var _mLayersFeaturesBaseUrl="http://mt0.google.com/mapslt/ft";function GLoadMapsScript(){if(!GLoadMapsScript.called&&GBrowserIsCompatible()){GLoadMapsScript.called=true;GScript("http://maps.gstatic.com/intl/en_ALL/mapfiles/270a/maps2.api/main.js")}}(function(){if(!window.google)window.google={};if(!window.google.maps)window.google.maps={};var ns=window.google.maps;ns.BrowserIsCompatible=GBrowserIsCompatible;ns.Unload=GUnload})();GLoadMapsScript();

//array para gadar os marcadores
var marcadores = [];
//array para gardar o html contido das xanelas de cada marcador
var contidosHTML = [];
//array para gardar as URL dos sonidos que se reproduciran en cada xanela
var URLsons = [];

var id = 0;


function getNodeText(node){
	return node.text || node.firstChild ? node.firstChild.nodeValue : "";
}

//GL recoller a id da URL do artigo
//ENG get id from the article'URL
//FR récupérer l'id de l'article dans l'URL
function extraerID(url){
	var posicion = url.indexOf("article");
	if (posicion != -1) {
		url = url.substring(posicion + 7);
		posicion = url.indexOf ("&");
		if (posicion != -1) {
			url = url.substring(0,posicion);
		}
	//se non e un artigo de spip que lle dean
	} else {
		url = url.substring(url.length - 4);
	}
	return url;
}

function creaMarcador(point, html, icon,survol) {
	//creamos un obxecto GMarker e o gradamos nunha variable
	//alert("coucou");
	var marcador = new GMarker(point, icon);
	var tooltip = new Tooltip(marcador,survol,4); 
	marcador.tooltip = tooltip;
	map1.addOverlay(tooltip);
	GEvent.addListener(marcador,'mouseover',function(){ this.tooltip.show(); });
	GEvent.addListener(marcador,'mouseout',function(){ this.tooltip.hide(); });

	//engadimos un evento para que ao pulsar no marcador se abra a ventana co html indicado
	GEvent.addListener(marcador, "click", function(){
		marcador.openInfoWindowHtml(html);
		//cando se abre a ventana do marcador executamos as seguintes intsruccions
		/*GEvent.addListener(map,"infowindowopen", function() {
			if(son){
				//esta parte del codigo enbebe un obxecto flah na ventana creado con flashobject.js
				var fo = new FlashObject(URLbase + "plugins/mymap/img_pack/musicplayer.swf?autoplay=true&song_url="+son, "player_x", "17", "17", "6", "#FFFFFF");
				fo.write("player");
			}
		});*/
	});		
	return marcador;
}
function var_dump(obj) {
   if(typeof obj == "object") {
      return "Type: "+typeof(obj)+((obj.constructor) ? "\nConstructor: "+obj.constructor : "")+"\nValue: " + obj;
   } else {
      return "Type: "+typeof(obj)+"\nValue: "+obj;
   }
}//end function var_dump

function agregarMarcador (xmlItem, minZoom,  maxZoom, idmanager) {

	$(xmlItem).find("geo_points").each(function() { 
	    $(this).find("geo_point").each(function() {

				var xmlLng = $("geo_long",this).text();
				var html = $("geo_desc",this).text();
				var survol = $("geo_descrapide",this).text();
				//alert($("geo_desc",this).text().innerHTML);
				var xmlLat = $("geo_lat",this).text();
				var micon =  $("geo_mmark",this).text();
				//var xmlSon = $("enclosure",xmlItem);
				//alert(xmlLng+xmlLat+html);
				if ((xmlLat.length == 0) || (xmlLng.length == 0)) return;
				else {
				
					var lat = parseFloat(xmlLat);
					var lng = parseFloat(xmlLng);
					
					
					//var id = extraerID($("link",xmlItem).text());
					//var html = $("description",xmlItem).text();
					//////////ICONE PERSO//////////////////////
					if(micon!=''){
						//alert(URLbase + URLabsolute + "/img_pack/perso/"+micon);
						var icon = URLbase + URLabsolute + "/img_pack/perso/"+micon;
					}
					else{
						var icon = $("geo_icon",xmlItem).text();						
					}
					//alert(icon != "" ? icon : URLbase + URLabsolute + "/img_pack/icone-noire.png");
					//creamos un Gpoint para situar nel o marcador
					var point = new GPoint(lng,lat);
					//alert("bbbbbbbb"+icon);
					//creamos un icono para o marcador
					var icono_categoria = new GIcon();
					icono_categoria.image = (icon != "" ? icon : URLbase + URLabsolute + "/img_pack/icone-noire.png");	
					//alert(icono_categoria.image);
					icono_categoria.shadow = URLbase + URLabsolute + "/img_pack/shadow.png";
					icono_categoria.iconSize = new GSize(24, 38);
					icono_categoria.shadowSize = new GSize(22, 20);	
					icono_categoria.iconAnchor = new GPoint(10, 34);
					icono_categoria.infoWindowAnchor = new GPoint(5, 1);
					//alert("a");
					// creamos el marcador con los datos almacenados en las variables
					var marcador = creaMarcador(point, html, icono_categoria,survol);

					id = id+1;
					// recollemos a informacion que sexa necesaria en distintos arrays, usando como identificador a id do artigo
					marcadores[id] = marcador;
	
					contidosHTML[id] = html;
				
					//URLsons[id] = son;
					//engadimos o marcador ao markerManager antes "map.addOverlay(marker);"
					if (maxZoom) {
						if(idmanager){
							idmanager.addMarker(marcador, minZoom,  maxZoom);
						}
						else{
							markerManager.addMarker(marcador, minZoom,  maxZoom);
						}
					} else if (idmanager){
						idmanager.addMarker(marcador, minZoom);
					}
				}
			
			
		});
	});

}

function abrirVentana(identificador) {
	map.closeInfoWindow();
	marcadores[identificador].openInfoWindowHtml(contidosHTML[identificador]);
	//enbebemos o flash player do son
	var fo = new FlashObject( URLbase + URLabsolute +"/img_pack/musicplayer.swf?autoplay=true&song_url=" + URLsons[identificador], "player_x", "17", "17", "6", "#FFFFFF");
	fo.write("player");
}











function coordenadas (articulo){
	$.ajax({
		type: "POST",
		url: "'.generer_url_public('cambiar_coordenadas').'",
		data: "id_article="+articulo+"&lat="+document.forms.formulaire_coordenadas.lat.value+"&lonx="+document.forms.formulaire_coordenadas.lonx.value,
		success: function() {
		}
	});
}