//fonction de demande de suppression
 function supp(nom,url)
{
	if (confirm("Etes vous sur de vouloir supprimer " +nom+" ?"))
		{
			window.location.href=url;
															
		}
}


function majQte(num){
	var q = document.getElementsByName("quantite" + num)[0].value;
	window.location.href = 'index.php?p=panier&num=' + num + '&quantite=' + q;
}

function Verif_saisie_projet(){

	if (document.forms['projet'].nom){
		if (document.forms['projet'].nom.value == ''){
			alert("Le nom doit être mentionné !");
			return false;
		}
	}

/*	if (document.forms['produit'].nom){
		if (document.forms['produit'].nom.value == ''){
			alert("Le nom doit être mentionné!");
			return false;
		}
	}

	if (document.forms['produit'].prix){
		if (document.forms['produit'].prix.value == ''){
			alert("Le prix doit être mentionné!");
			return false;
		}
	}
*/

	document.projet.submit();
}

	function affiche(source)
	{
		var tabDiv = document.getElementsByTagName("div");
		for(var i=0; i<tabDiv.length; i++)
		{
			//on remplit un tab avec seulement les div qui nous interesse
			if( typeof(tabDiv[i].id)!='undefined' && tabDiv[i].id.indexOf("gPhoto")==0)
			{
				if(source==tabDiv[i].id.substr(6, tabDiv[i].id.length))
				{
					tabDiv[i].style.visibility="visible";
					tabDiv[i].style.display="block";
				}
				else
				{
					tabDiv[i].style.visibility="hidden";
					tabDiv[i].style.display="none";
				}
			}
		}
	}

	function affichelogo(action, id)
	{
		if(action == 1)
		{
			document.getElementById("logodiv").style.visibility="visible";
			document.getElementById("logodiv").style.display="block";

		}
		else
		{
			document.getElementById("logodiv").style.visibility="hidden";
			document.getElementById("logodiv").style.display="none";
		}
	}

		function affichecarre(action, id)
	{
		if(action == 1)
		{
			document.getElementById("carrerouge"+id).style.visibility="visible";
			document.getElementById("carrerouge"+id).style.display="block";
			document.getElementById("carre"+id).style.visibility="hidden";
			document.getElementById("carre"+id).style.display="none";

		}
		else
		{
			document.getElementById("carre"+id).style.visibility="visible";
			document.getElementById("carre"+id).style.display="block";
			document.getElementById("carrerouge"+id).style.visibility="hidden";
			document.getElementById("carrerouge"+id).style.display="none";
		}
	}



var Timer;
var Pas = 5;
var sens = -1;	
var largeur= -320;
	
function scroll_vers(sens, largeur){
	Sens = sens;
	largeur = - parseInt(largeur) ;
	left = parseInt(Objet.style.left);
	if (Sens!=1){
		if (left<0)
			left += Pas;
	}else{
		if (left>largeur)
			left -= Pas;		
	}
	Objet.style.left = left+"px";
	Timer = setTimeout("scroll_vers(" + Sens + ", "+ largeur +" );", 50);
}

