// JavaScript Document
<!--

window.onload=montre;

<!-- Google Map -->
function carteGoogleMap() {
    function createInfoMarker(point, address) {
      var marker = new GMarker(point);
      GEvent.addListener( marker , 
                          "click" ,
                          function(){marker.openInfoWindowHtml(address);}
                        );
      return marker;
    }

    function Positionner(Long, Lat){
      map.setCenter(new GLatLng(Lat, Long), 17); 
    }

    var map = new GMap2(document.getElementById("map"));

    // Paramétrage de la carte
    map.setCenter(new GLatLng(44.953957, 1.703031), 14);  // Positionnement
    //map.addControl(new GLargeMapControl());       // Outils déplacement et zoom
	map.addControl(new GSmallMapControl()) ;         // Petit outils déplacement et zoom
	map.addControl(new GScaleControl()) ;         // Affichage échelle
    map.addControl(new GMapTypeControl());        // Choix type de carte
    //map.addControl(new GOverviewMapControl());    // Mini carte de navigation
    map.enableDoubleClickZoom();                  // Zoom par double-click
    
	
    // Le Comptoir d'Hortense
    var point = new GLatLng(44.953957,1.703031);
	//var point = map.getCenter();
    address = "<strong>Le Comptoir d'Hortense</strong> <br/>12 Rue Jean de Vayrac <br/>46110 VAYRAC";
    var marker = createInfoMarker(point, address);
    map.addOverlay(marker);
	
}

<!-- Verif condition de vente -->
function testValidCondVente (){
	if(document.forms["mon-panier"].nameValidCondVente.checked){
		$('.divValidCondVente').show();
	}else{
		$('.divValidCondVente').hide();
	}
}


function montre(id) {

	if (document.getElementById("map" )) {
   		carteGoogleMap();
   	}
	
	if (document.getElementById("idValidCondVente" )) {
		if(document.forms["mon-panier"].nameValidCondVente.checked){
			$('.divValidCondVente').show();
		}else{
			$('.divValidCondVente').hide();
		}
   	}
	
	var d = document.getElementById(id);
		for (var i = 1; i<=10; i++) {
			if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
		}
	if (d) {
		d.style.display='block';
		couleur_menu();
	}else{
		couleur_menu_default();
	}
}

function couleur_menu(){
	document.getElementById("menuProduits").style.backgroundColor = "#ff7a35";
	document.getElementById("menuProduits").style.color="#401300";
}
function couleur_menu_default(){
	document.getElementById("menuProduits").style.backgroundColor = "#401300";
	document.getElementById("menuProduits").style.color="#d3b185";
}


	var MinProd=new Array("#DFDFFF", "#FFFFBF", "#80FF80", "#EAEAFF", "#C9FFA8", "#F7F7F7", "#FFFFFF", "#DDDD00")
	var imgProd=new Array("#DFDFFF", "#FFFFBF", "#80FF80", "#EAEAFF", "#C9FFA8", "#F7F7F7", "#FFFFFF", "#DDDD00")
	
	function survolCouleur(i,j){
		cellule = document.getElementById(i+""+j);
		//var couleurAvant = document.getElementById("imageCentre").bgcolor; 
		document.getElementById('imageCentre').style.backgroundColor = document.getElementById(i+""+j).title;
		//alert(cellule.title);
	}
	function retourCouleur(){
		document.getElementById('imageCentre').style.backgroundColor = defaultCouleur;
	}
	function choixCouleur(i,j){
		cellule = document.getElementById(i+""+j);
		defaultCouleur=document.getElementById(i+""+j).title;
	}

var IB=new Object;
var posX=0;posY=0;
var xOffset=10;yOffset=10;
function AffBulle(texte) {
 contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;";
  var finalPosX=posX-xOffset;
  if (finalPosX<0) finalPosX=0;
  if (document.layers) {
    document.layers["bulle"].document.write(contenu);
    document.layers["bulle"].document.close();
    document.layers["bulle"].top=posY+yOffset-document.all.bulle.offsetHeight;
	

    document.layers["bulle"].left=finalPosX;
    document.layers["bulle"].visibility="show";}
  if (document.all) {
    //var f=window.event;
    //doc=document.body.scrollTop;
    bulle.innerHTML=contenu;
    document.all["bulle"].style.top=posY+yOffset-document.all.bulle.offsetHeight;
    document.all["bulle"].style.left=finalPosX;//f.x-xOffset;
    document.all["bulle"].style.visibility="visible";
  }
  //modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById
  else if (document.getElementById) {
    document.getElementById("bulle").innerHTML=contenu;
    document.getElementById("bulle").style.top=posY+yOffset-document.all.bulle.offsetHeight;
    document.getElementById("bulle").style.left=finalPosX;
    document.getElementById("bulle").style.visibility="visible";
  }
}
function getMousePos(e) {
  if (document.all) {
  posX=event.x+document.body.scrollLeft; //modifs CL 09/2001 - IE : regrouper l'évènement
  posY=event.y+document.body.scrollTop;
  }
  else {
  posX=e.pageX; //modifs CL 09/2001 - NS6 : celui-ci ne supporte pas e.x et e.y
  posY=e.pageY; 
  }
}
function HideBulle() {
	if (document.layers) {document.layers["bulle"].visibility="hide";}
	if (document.all) {document.all["bulle"].style.visibility="hidden";}
	else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}
}

function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {
	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;
	if (document.layers) {
		window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;
		document.write("<LAYER name='bulle' top=0 left=0 visibility='hide'></LAYER>");
	}
	if (document.all) {
		document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
		document.onmousemove=getMousePos;
	}
	//modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById
	else if (document.getElementById) {
		document.onmousemove=getMousePos;
		document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden'></DIV>");
	}

}

//-->


function limiteur(){
    maximum = 200;
    champ = document.formulaire_dedicace.dedicace_txt;
    indic = document.formulaire_dedicace.indicateur;

    if (champ.value.length > maximum)
      champ.value = champ.value.substring(0, maximum);
    else
      indic.value = maximum - champ.value.length;
}