//<![CDATA[
function getWindowSize(){	var e = new Object(); 		if(window.self && self.innerWidth){ 				e.width = self.innerWidth; 				e.height = self.innerHeight; 		}else if(document.documentElement && document.documentElement.clientHeight){		e.width = document.documentElement.clientWidth; 				e.height = document.documentElement.clientHeight; 		}else{ 				e.width = document.body.clientWidth; 				e.height = document.body.clientHeight; 		} 		return e; }  var xmlHttp;function GetXmlHttpObject(handler){	var objXMLHttp=null;	if (window.XMLHttpRequest){		objXMLHttp=new XMLHttpRequest();	}	else if (window.ActiveXObject){		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");	}	return objXMLHttp;}function preloadImages() { 	var d=document;  	if(d.images){  				if(!d.p) d.p=new Array(); 				var i,j=d.p.length,a=preloadImages.arguments;  				for(i=0; i<a.length; i++)     						if (a[i].indexOf("#")!=0){				d.p[j]=new Image;  								d.p[j++].src=a[i]; 						} 		} }function showBoxFromIframe(id,b){	}function showBox(id,b){	if (b){		document.getElementById('boxContainerId').style.display="block";		document.getElementById(id).style.display="block";	}	else{		document.getElementById('boxContainerId').style.display="none";		document.getElementById(id).style.display="none";	}}var idArray=new Array(new Array("start","create","share","collaborate","explore"),new Array("review","picture","video"));function welcomeBoxOngletSwitch(index,id){		for (var i=0; i<idArray[index].length; i++)		if(idArray[index][i]==id){			document.getElementById(idArray[index][i]+"Id").style.display="block";					}		else{			document.getElementById(idArray[index][i]+"Id").style.display="none";								}}


      function ELabel(point, html, classname, pixelOffset, percentOpacity, overlap) {

        this.point = point;
        this.html = html;
        

        this.classname = classname||"";
        this.pixelOffset = pixelOffset||new GSize(0,0);
        if (percentOpacity) {
          if(percentOpacity<0){percentOpacity=0;}
          if(percentOpacity>100){percentOpacity=100;}
        }        
        this.percentOpacity = percentOpacity;
        this.overlap=overlap||false;
      } 
      
      ELabel.prototype = new GOverlay();

      ELabel.prototype.initialize = function(map) {
        var div = document.createElement("div");
        div.style.position = "absolute";
        div.innerHTML = '<div class="' + this.classname + '">' + this.html + '</div>' ;
        map.getPane(G_MAP_FLOAT_SHADOW_PANE).appendChild(div);
        this.map_ = map;
        this.div_ = div;
        if (this.percentOpacity) {        
          if(typeof(div.style.filter)=='string'){div.style.filter='alpha(opacity:'+this.percentOpacity+')';}
          if(typeof(div.style.KHTMLOpacity)=='string'){div.style.KHTMLOpacity=this.percentOpacity/100;}
          if(typeof(div.style.MozOpacity)=='string'){div.style.MozOpacity=this.percentOpacity/100;}
          if(typeof(div.style.opacity)=='string'){div.style.opacity=this.percentOpacity/100;}
        }
        if (this.overlap) {
          var z = GOverlay.getZIndex(this.point.lat());
          this.div_.style.zIndex = z;
        }
      }

      ELabel.prototype.remove = function() {
        this.div_.parentNode.removeChild(this.div_);
      }

      ELabel.prototype.copy = function() {
        return new ELabel(this.point, this.html, this.classname, this.pixelOffset, this.percentOpacity, this.overlap);
      }

      ELabel.prototype.redraw = function(force) {
        var p = this.map_.fromLatLngToDivPixel(this.point);
        var h = parseInt(this.div_.clientHeight);
        this.div_.style.left = (p.x + this.pixelOffset.width) + "px";
        this.div_.style.top = (p.y +this.pixelOffset.height - h) + "px";
      }

      ELabel.prototype.show = function() {
        this.div_.style.display="";
      }
      
      ELabel.prototype.hide = function() {
        this.div_.style.display="none";
      }
      
      ELabel.prototype.setContents = function(html) {
        this.html = html;
        this.div_.innerHTML = '<div class="' + this.classname + '">' + this.html + '</div>' ;
        this.redraw(true);
      }
      
      ELabel.prototype.setPoint = function(point) {
        this.point = point;
        if (this.overlap) {
          var z = GOverlay.getZIndex(this.point.lat());
          this.div_.style.zIndex = z;
        }
        this.redraw(true);
      }
      
      ELabel.prototype.setOpacity = function(percentOpacity) {
        if (percentOpacity) {
          if(percentOpacity<0){percentOpacity=0;}
          if(percentOpacity>100){percentOpacity=100;}
        }        
        this.percentOpacity = percentOpacity;
        if (this.percentOpacity) {        
          if(typeof(this.div_.style.filter)=='string'){this.div_.style.filter='alpha(opacity:'+this.percentOpacity+')';}
          if(typeof(this.div_.style.KHTMLOpacity)=='string'){this.div_.style.KHTMLOpacity=this.percentOpacity/100;}
          if(typeof(this.div_.style.MozOpacity)=='string'){this.div_.style.MozOpacity=this.percentOpacity/100;}
          if(typeof(this.div_.style.opacity)=='string'){this.div_.style.opacity=this.percentOpacity/100;}
        }
      }

      ELabel.prototype.getPoint = function() {
        return this.point;
      }
      ELabel.prototype.U = function() {
        return this.point;
      }
      ELabel.prototype.V = function() {
        return this.point;
      }
      ELabel.prototype.W = function() {
        return this.point;
      }
      ELabel.prototype.X = function() {
        return this.point;
      }
      ELabel.prototype.Y = function() {
        return this.point;
      }
      ELabel.prototype.Z = function() {
        return this.point;
      }

var wS;var mapOffSet=4;   	   var successSubmissionBoxWidth=300;var successSubmissionBoxHeight=170; function sizeMapDiv(offset){ 		wS = getWindowSize(); 	document.getElementById("mapId").style.height = (wS.height - offset) + 'px';	document.getElementById("mapId").style.width = (wS.width - 185) + 'px';	document.getElementById("leftBand").style.height = (wS.height - offset) + 'px';		document.getElementById("controlContainerId").style.height = (wS.height-260) + 'px';	document.getElementById("boxContainerId").style.height=wS.height+ 'px';	document.getElementById("boxContainerId").style.width=wS.width+ 'px';		document.getElementById("bigBoxId").style.left=((wS.width)/2-185)+'px';	document.getElementById("bigBoxId").style.height=wS.height-170+"px";		document.getElementById("successMapSubmissionBoxId").style.width=successSubmissionBoxWidth+'px';	document.getElementById("successMapSubmissionBoxId").style.height=successSubmissionBoxHeight+'px';	document.getElementById("successMapSubmissionBoxId").style.left=(wS.width-successSubmissionBoxWidth)/ 2+'px';	document.getElementById("successMapSubmissionBoxId").style.top=(wS.height-successSubmissionBoxHeight) / 2.5+'px';	}   var controlIdArray=new Array("map","add","don");function checkEmail(email){	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;	if (filter.test(email)) 		return true;	else return false;}var editMapListenerHandle;var mapPoint=0;var myMarker;var baseIcon = new GIcon();baseIcon.iconSize = new GSize(32, 32);  baseIcon.iconAnchor = new GPoint(6, 32);baseIcon.infoWindowAnchor = new GPoint(9, 2);baseIcon.infoShadowAnchor = new GPoint(18, 25);var myMarkerIcon = new GIcon(baseIcon);myMarkerIcon.image = "icones/40.png";function startAddingMap(){		document.getElementById("mapId").firstChild.firstChild.style.cursor = "crosshair";	editMapZoomListenerHandle=GEvent.addListener(myMap, "zoomend", function(oldzoom,zoom){		window.addMapIframe.document.addMapForm.zoomLevel.value=zoom;			});	window.addMapIframe.document.addMapForm.zoomLevel.value=myMap.getZoom();			editMapListenerHandle=GEvent.addListener(myMap, 'click', function(overlay, point) {		if (point) {			if(mapPoint==0){				mapPoint=point;								myMarker = new GMarker(mapPoint,myMarkerIcon);								myMap.addOverlay(myMarker);			}			else{				mapPoint=point;				myMarker.setPoint(mapPoint);			}			document.getElementById("mapId").firstChild.firstChild.style.cursor = "crosshair";						window.addMapIframe.document.addMapForm.mapPoint.value=point;				}	});		}function submitNewMap(){	var trouble=false;		if (document.addMapForm.mapPoint.value==""){		alert("You have not located your map\nYou may locate a new place by clicking on the map");		trouble=true;			}else if (document.addMapForm.name.value==""){		alert("No map name entered");		document.addMapForm.name.focus();		trouble=true;	}else if(checkEmail(document.addMapForm.email.value)==false){		alert("Entered email is invalid");		document.addMapForm.email.focus();		trouble=true;	}else if(document.addMapForm.password.value==""){		alert("No password entered");		document.addMapForm.password.focus();		trouble=true;	}else if(document.addMapForm.password.value!=document.addMapForm.verifPassword.value){		alert("Entered Passwords differ");		document.addMapForm.password.focus();		trouble=true;	}		if(!trouble && confirm("Submit map request?")==true)						return true;	else 			return false;}function stopAddingMap(){	mapPoint=0;	myMap.removeOverlay(myMarker);		GEvent.removeListener(editMapListenerHandle);	GEvent.removeListener(editMapZoomListenerHandle);	document.getElementById("mapId").firstChild.firstChild.style.cursor = "hand";			showBox('successMapSubmissionBoxId',true);}function ongletSwitch(controlId){	for (var i=0; i<controlIdArray.length; i++)		if(controlIdArray[i]==controlId){			document.getElementById(controlIdArray[i]+"ControlId").style.display="block";			document.getElementById(controlIdArray[i]+"OngletId").className="ongletHover";		}		else{			document.getElementById(controlIdArray[i]+"ControlId").style.display="none";			document.getElementById(controlIdArray[i]+"OngletId").className="onglet";		}	if(controlId=='add'){		window.addMapIframe.document.addMapForm.name.value="";				window.addMapIframe.document.addMapForm.email.value="";		window.addMapIframe.document.addMapForm.password.value="";		startAddingMap();			}else{		if (editMapListenerHandle)			GEvent.removeListener(editMapListenerHandle);		document.getElementById("mapId").firstChild.firstChild.style.cursor = "hand";			}}function setNewListeners(){	window.onresize = function(){ 				sizeMapDiv(mapOffSet);     	}; }  function load(){	sizeMapDiv(mapOffSet); 		setNewListeners(); 				if (GBrowserIsCompatible()){		 	 				myMap = new GMap2(document.getElementById("mapId"));					myMap.addControl(new GLargeMapControl());		myMap.addControl(new GScaleControl());		myMap.addControl(new GMapTypeControl());		myMap.setCenter(new GLatLng(16.636192,-6.328125), 2, G_SATELLITE_MAP); 		myMap.enableContinuousZoom();		myMap.enableScrollWheelZoom();			myMap.enableDoubleClickZoom();					}	loadMaps('city');	showMapList('city');} var cityIconModel=new GIcon();cityIconModel.iconSize = new GSize(16, 16);cityIconModel.iconAnchor = new GPoint(8, 8);cityIconModel.image="icones/city.png";var thematicIconModel=new GIcon();thematicIconModel.iconSize = new GSize(16, 16);thematicIconModel.iconAnchor = new GPoint(8, 8);thematicIconModel.image="icones/thematic.png";var countryIconModel=new GIcon();countryIconModel.iconSize = new GSize(16, 16);countryIconModel.iconAnchor = new GPoint(8, 8);countryIconModel.image="icones/country.png";	function createMapMarker(point,i,map,type){	var marker = new GMarker(point,eval(type+"IconModel"));      GEvent.addListener(marker,"mouseover", function() {		showMapBox(i,true);    });                		GEvent.addListener(marker,"mouseout", function() {		showMapBox(i,false);    }); 	GEvent.addListener(marker,"click", function() {		document.location.href=map;    });  		return marker;}function showMapBox(i,b){	if (b)		document.getElementById("mapBox"+i+"Id").style.display="block";	else		document.getElementById("mapBox"+i+"Id").style.display="none";}var mapBoxes=new Array();var mapMarkers=new Array();function hideMaps(type){	if(mapBoxes[type]!=undefined){		for(var i=0;i<mapBoxes[type].length;i++){			myMap.removeOverlay(mapBoxes[type][i]);			myMap.removeOverlay(mapMarkers[type][i]);		}	}}function loadMaps(type){	if (mapBoxes[type]==undefined){		mapBoxes[type]=new Array();		mapMarkers[type]=new Array();				GDownloadUrl("maps.php?type="+type, function(data, responseCode){			var xml=GXml.parse(data);			var maps=xml.documentElement.getElementsByTagName("map");			for (var i=0; i<maps.length; i++){				var mapContent="<div id=mapBox"+i+"Id class=mapBox>"+maps[i].getAttribute("label")+"</div>";						var newPoint=new GLatLng(parseFloat(maps[i].getAttribute("lat")),parseFloat(maps[i].getAttribute("lng")));										mapBoxes[type][i]=new ELabel(newPoint, mapContent);			mapMarkers[type][i]=createMapMarker(newPoint,												i,												maps[i].getAttribute("label").toLowerCase(), 												maps[i].getAttribute("type"));			myMap.addOverlay(mapBoxes[type][i]);			myMap.addOverlay(mapMarkers[type][i]);			}		});	}else{		for(var i=0;i<mapBoxes[type].length;i++){			myMap.addOverlay(mapBoxes[type][i]);			myMap.addOverlay(mapMarkers[type][i]);		}	}}function showMapList(type){	xmlHttp=GetXmlHttpObject();	if (xmlHttp==null){		alert ("Browser does not support HTTP Request");		return;	} 			var url="mapList.php?type="+type;	xmlHttp.onreadystatechange=displayMapList; 	xmlHttp.open("GET",url,true);	xmlHttp.send(null);}function displayMapList(){	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")		document.getElementById('mapListId').innerHTML=xmlHttp.responseText;}function getCookie(c_name){	if (document.cookie.length>0){		c_start=document.cookie.indexOf(c_name + "=");		if (c_start!=-1){			c_start=c_start + c_name.length+1;			c_end=document.cookie.indexOf(";",c_start);			if (c_end==-1) c_end=document.cookie.length;				return unescape(document.cookie.substring(c_start,c_end));		} 	}	return "";}function setCookie(c_name,value,expiredays){	var exdate=new Date();	exdate.setDate(exdate.getDate()+expiredays);	document.cookie=c_name+ "=" +escape(value)+	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());}function checkCookie(){	var firstVisit=getCookie('mkmap');	if (firstVisit==null || firstVisit=="" || firstVisit=="true"){		if (firstVisit!="true")			setCookie('mkmap','true',365);		showBox('bigBoxId',true);		getWelcomeBoxContent();	}}var welcomeXmlHttp;function getWelcomeBoxContent(){	welcomeXmlHttp=GetXmlHttpObject();	if (welcomeXmlHttp==null){		alert ("Browser does not support HTTP Request");		return;	} 			var url="welcomeBox.php";	welcomeXmlHttp.onreadystatechange=displayWelcomeBoxContent; 	welcomeXmlHttp.open("GET",url,true);	welcomeXmlHttp.send(null);}function displayWelcomeBoxContent(){		if (welcomeXmlHttp.readyState==4 || welcomeXmlHttp.readyState=="complete"){		document.getElementById('bigBoxId').innerHTML=welcomeXmlHttp.responseText;		welcomeBoxOngletSwitch(0,'start');	}}function checkReview(placeNum){	var alreadyReviewed=getCookie(placeNum);	if (alreadyReviewed==null || alreadyReviewed=="")		return false;	else		return true;	}
//]]>