    
    //http://maps.google.com/maps?f=q&hl=fr&geocode=&q=Neufch%C3%A2tel-en-Bray&sll=48.925178,2.407722&sspn=0.012209,0.037594&ie=UTF8&ll=49.735936,1.444659&spn=0.006005,0.018797&z=1
    
function initialize() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(49.738936, 1.444659), 15);
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());

    // Create a base icon for all of our markers that specifies the
    // shadow, icon dimensions, etc.
    var baseIcon = new GIcon();
    baseIcon.shadow = "/images/imgCellier.png";
    baseIcon.iconSize = new GSize(53, 42);
    baseIcon.shadowSize = new GSize(53, 42);
    baseIcon.iconAnchor = new GPoint(53, 42);
    baseIcon.infoWindowAnchor = new GPoint(53, 42);
    baseIcon.infoShadowAnchor = new GPoint(53, 42);

    // Creates a marker whose info window displays the letter corresponding
    // to the given index.
    function createMarker(point, index) {
      // Create a lettered icon for this point using our icon class
      var letter = String.fromCharCode("O".charCodeAt(0) + index);
      var letteredIcon = new GIcon(baseIcon);


      // Set up our GMarkerOptions object
      markerOptions = { icon:letteredIcon };
      var marker = new GMarker(point, markerOptions);



      GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml("<p>Le Cellier du Val Boury</p><img src='/images/imgAccueil.png' alt=''>");
      });
      return marker;
    }

    // Add 10 markers to the map at random locations

    for (var i = 0; i < 1; i++) {
      var latlng = new GLatLng(49.73637, 1.446679);
      map.addOverlay(createMarker(latlng, 1));
    }
  }
}


function contactManager(){
	var presta = document.getElementById('id_presta').value;
	
	switch(presta){
		case 'Chambre':
			ajaxDiv('presta_choice', 'include/contact/chbre.php', '');
			break;	
			
		case 'Salle':
			ajaxDiv('presta_choice', 'include/contact/salle.php', '');
			break;
			
		case 'Gite':
			ajaxDiv('presta_choice', 'include/contact/gite.php', '');
			break;
			
		case 'Autre':
			ajaxDiv('presta_choice', 'include/contact/autre.php', '');
			break;
	}
}

function ajaxDiv(zone, href, data){

	// /!\attention ne pas mettre de virgules ni des 2 points dans vos post/get/valeurs!!!! /!\

	var zone;
	var data;
	var href;
	
	// Firefox
	if( window.XMLHttpRequest )
	{
		xhr_object = new XMLHttpRequest();
		if (xhr_object.overrideMimeType)
		{
		   xhr_object.overrideMimeType('text/xml');
		}
	}
	// IE
	else if( window.ActiveXObject ) { xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); }
	
	var tabTwo = new Array();
	var tabOne = new Array();
	

	tabOne = data.split(',');
	data = "";

	var n = tabOne.length;

	for (i=0; i<n; i++) {		
		tabTwo = tabOne[i].split(':');
		data += tabTwo[0] + "=" + tabTwo[1] + "&";		
	}
	
	data = data.substring(0, data.length-1);
	//alert(data);	


	xhr_object.open('POST', href, false);
	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	xhr_object.send(data);
	

	if(xhr_object.readyState == 4){			
		var div = document.getElementById(zone);
		div.innerHTML = xhr_object.responseText;
	}
	
} 

function checkForm(){
	
	var bool = false;
	var bool_name = false;
	var bool_mail = false;
	var bool_nb = false;
	
	if(document.getElementById('id_email')){
		a = document.getElementById('id_email').value;
		
		for(var j=1;j<(a.length);j++){
			if(a.charAt(j)=='@'){
				if(j<(a.length-4)){
					for(var k=j;k<(a.length-2);k++){
						if(a.charAt(k)=='.'){
							bool_mail = true;
						}
					}
				}
			}
		}
	}
	
	if(bool_mail == false){
		alert("Entrez un email valide / Enter a valid email");		
	}
	
	if(document.getElementById('id_name').value == ''){
		alert("Entrez votre nom / Enter your name");	
	}else{
		bool_name = true;	
	}
	
	if(document.getElementById('id_nbpersonne')){
		if(document.getElementById('id_nbpersonne').value == ''){
			alert("Indiquez le nombre de personnes / Indicate the number of persons");
		}else{
			bool_nb = true;				
		}
	}else{
		bool_nb = true;	
	}
	
	if(bool_name == true && bool_mail == true && bool_nb == true){
		bool = true;
	}
	
	return bool;
}






