<!-- POUR LES MENUS ------------------------------------------------------------------- //-->
function MM_findObj(n, d) { //v4.0
	  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 && document.getElementById) x=document.getElementById(n); return x;
	}
	
function rollover(couche, color) {
	layer = MM_findObj(couche);
	layer.style.background = color;
}

<!-- FONCTIONS DIVERSES ---------------------------------------------------------- //-->
function areyousure(expression,url){
	if(!confirm("Etes vous sūr de vouloir supprimer "+expression+" ?")){
		return false;
	} else {
		document.location.href = url;	
	}
}

function verifmail(elm){
	if ((elm.indexOf("@") != "-1") && (elm.indexOf(".") != "-1") && (elm != "")){
		return true;
	} else {
		return false;
	}
}
function nonvide(mot){
	if(mot == "") {
		return false;	
	}
}
<!-- LES IMAGES ------------------------------------------------------------------------ //-->
function ajouter_image(id_galerie,grand,vignette){
	window.open("/admin/scripts/image.php?id_galerie="+id_galerie+"&grand="+grand+"&vignette="+vignette, "galerie", "width=500, height=500");
}
function suppr_img(id_img){
	window.open("/admin/scripts/image.php?action=delete&id_img="+id_img, "galerie", "width=1, height=1");
}
function modif_legende(id_img){
	window.open("/admin/scripts/image.php?action=maj&id="+id_img, "galerie", "width=500, height=500");
}
function showme(gros,img,legende){
	changer = MM_findObj(gros);
	changer.setAttribute('src', img);
	changer.setAttribute('alt', legende);
}

<!-- LES ØPIECES JOINTES -------------------------------------------------------------- //-->
function ajouter_pj(id_contenu){
	window.open("/admin/scripts/piece_jointe.php?id_contenu="+id_contenu, "pj", "width=500, height=500");
}
function suppr_pj(id_contenu){
	if(confirm("Etes vous sur de vouloir supprimer cette pičce jointe ?")){
		window.open("/admin/scripts/piece_jointe.php?action=delete&id_contenu="+id_contenu, "pj", "width=1, height=1");
	}
}
function modif_pj(id_contenu){
	window.open("/admin/scripts/piece_jointe.php?action=maj&id_contenu="+id_contenu, "pj", "width=500, height=500");
}

function changerlangue(lalangue){
	var url = document.location.href;
	if(url.indexOf("?") != -1){
		// On a des parametres, mais y'a t'il celui de langue ?
		var ln1 = "lang=fr";
		var ln2 = "lang=en";
		if(url.indexOf(ln1) != -1 ) url = url.replace(ln1, ln2);
		else if(url.indexOf(ln2) != -1 ) url = url.replace(ln2, ln1);
		else url += "&lang="+lalangue;
	} else {
		url += "?lang="+lalangue;
	}
	document.location.href = url;
}
function panier(id){
	window.open("/scripts/cart.php?id="+id+"&quant="+document.forms.cart.quant.value, "cart", "");
}
function shop_item(id){
	window.open("/scripts/cart.php?id="+id+"&quant=1", "cart", "");
}
function remove_item(id){
	if(confirm("Etes vous sūr de vouloir supprimer cet article ? \nAre you shure you want to remove this item ?")){
		window.open("/scripts/cart.php?action=remove&id="+id, "cart", "width=100 height=100");
	}
}
function update_cart(id,gift,couleur){
	window.open("/scripts/cart.php?action=update&id="+id+"&quant="+eval("document.forms.cart.quant_"+id+".value")+"&gift="+gift+"&couleur="+couleur, "cart", "width=100 height=100");
}

