function MM_findObj(n, d)
	{ //v4.01
	var p,i,x;
	if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) 
		{
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
		}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
		for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

function MM_showHideLayers() 
	{ //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) 
	if ((obj=MM_findObj(args[i]))!=null) 
		{
		v=args[i+2];
		if (obj.style) 
			{
			obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
			}
		obj.visibility=v;
		}
	}

/*		CARTE DES VINS		*/

function carte(apellation, vitivulteur, vin)
	{
	document.getElementById("vin").innerHTML="<a href=\"#vins\" title=\"\" onclick=\"carte_initiale();\"><img src=\"gallerie/vins/" + apellation + ".gif\" alt=\"" + apellation + "\" /></a>";

	/*	AJAX	*/

	if(apellation=="")
		{
		argument="vide";
		}
	var xhr_object = null;

	if(window.XMLHttpRequest) // Firefox
	   xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) // Internet Explorer
	   xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else { // XMLHttpRequest non supporté par le navigateur
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
	   return;
	}

	xhr_object.open("POST", "ajax/aff_carte.php", true);

	xhr_object.onreadystatechange = function() {
	if(xhr_object.readyState == 4)
		{
		eval(xhr_object.responseText);
		}
		}

	xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); 
	var data = "apellation="+apellation+"&vitivulteur="+vitivulteur+"&vin="+vin;
	xhr_object.send(data); 
	}

function carte_initiale()
	{
	document.getElementById("vin").innerHTML="<a href=\"#vins\" class=\"image\" title=\"\" onclick=\"carte('champagnes', '', '')\"><img src=\"gallerie/vins/champagnes.gif\" alt=\"CHAMPAGNES\" /></a>";
	document.getElementById("apellation").innerHTML="<a href=\"#vins\" class=\"image\" title=\"\" onclick=\"carte('blancs', '', '')\"><img src=\"gallerie/vins/blancs.gif\" alt=\"BLANCS\" /></a>";
	document.getElementById("viticulteur").innerHTML="<a href=\"#vins\" class=\"image\" title=\"\" onclick=\"carte('roses', '', '')\"><img src=\"gallerie/vins/roses.gif\" alt=\"ROSES\" /></a>";
	document.getElementById("nom_vins").innerHTML="<a href=\"#vins\" class=\"image\" title=\"\" onclick=\"carte('rouges', '', '')\"><img src=\"gallerie/vins/rouges.gif\" alt=\"ROUGES\" /></a>";
	}