function AfficherImage3(ImageGrande, LargeurFenetre, HauteurFenetre){
	FenetreVoir = window.open("","FenetreVoir","scrollbars=0,width="+LargeurFenetre+",height="+HauteurFenetre+",resizable=yes");
	FenetreVoir.document.write("<html>\n");
	FenetreVoir.document.write("<head>\n");
	FenetreVoir.document.write("	<title>Galerie</title>\n");
	FenetreVoir.document.write("<style type=\"text/css\" media=\"screen\">");
	FenetreVoir.document.write("	body {");
	FenetreVoir.document.write("	margin: 0;");
	FenetreVoir.document.write("	padding: 0;");
	FenetreVoir.document.write("	}");
	FenetreVoir.document.write("</style>");
	FenetreVoir.document.write("</head>\n");
	FenetreVoir.document.write("<body>\n");
	FenetreVoir.document.write("<img src=\""+ImageGrande+"\" alt=\"\" />\n");
	FenetreVoir.document.write("</body>\n");
	FenetreVoir.document.write("</html>\n");
	FenetreVoir.document.close();
}


function modif_image()
{
   document.modif_gal.method = "POST";
   document.modif_gal.action = "modif_image.php";
   document.modif_gal.submit(); 
}
function supp_image()
{
   document.modif_gal.method = "POST";
   document.modif_gal.action = "supprime_image.php";
   document.modif_gal.submit(); 
}


function AfficherImage_back(img,chemin_root){
  Image1= new Image();
  Image1.src=(img);
  Control(img,chemin_root);
}
function Control(img,chemin_root){
  if((Image1.width!=0)&&(Image1.height!=0)){
    VoirImage(img,chemin_root);
  }
  else{
    fonction="Control('"+img+"','"+chemin_root+"')";
    intervalle=setTimeout(fonction,20);
  }
}
function VoirImage(img,chemin_root){
  var largeur=Image1.width;
  var hauteur=Image1.height;
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  proprietes="scrollbars=no,width="+ largeur +",height="+ hauteur+",top="+top+",left="+left;
  win=window.open(img,"",proprietes);
  
  	win.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n');
  	win.document.write("<html>\n");
	win.document.write("<head>\n");
	win.document.write("<title>Galerie</title>\n");
	win.document.write("<script type='text/javascript' src='"+ chemin_root + "/lib/js/overlib.js'></script>\n");
	win.document.write("<link rel='stylesheet' type='text/css' media='screen' href='"+ chemin_root + "/noir/css.css'>\n");
	win.document.write("<style type=\"text/css\" media=\"screen\">body {margin: 0;padding: 0;}</style>");
	win.document.write("<\/head>\n");
	win.document.write("<body oncontextmenu='return false'>\n");
	win.document.write("<div id='overDiv' style='position:absolute; visibility:hidden; z-index:1000;'></div>\n");
	win.document.write("<a onmouseover=\"return overlib('<center>FERMER</center>', NOCLOSE, 'Zoom', CENTER);\" onclick=\"window.close();\" onmouseout=\"return nd();\"  href=\"javascript:void(0);\">\n");
	win.document.write("<img src=\""+img+"\" alt=\"\" border=\"\" ><\/a>\n");
	win.document.write("<\/body>\n");
	win.document.write("<\/html>\n");
	win.document.close();
}



function AfficherImage(img,chemin_root)
{	
	var agt=navigator.userAgent.toLowerCase();
	var is_opera = (agt.indexOf("opera") != -1);

 	Image1= new Image();
  	Image1.src=(img);
	var largeur=Image1.width;
  	var hauteur=Image1.height;

	if(is_opera)
		{
		larg = document.body.clientWidth;
		haut = document.body.clientHeight;
		}
	else if(document.all)
		{
		larg = document.body.clientWidth;
		haut = document.body.clientHeight;
		}
	else
		{
		larg = innerWidth;
		haut = innerHeight;
		}

	
	if(document.getElementById)
	{		
		document.getElementById("div_show_img").style.width = '99%';
		document.getElementById("div_show_img").style.height = '99%';
		
		html_mil = "<table style='width:100%;height:100%'><TR><TD VALIGN=middle ALIGN=center >";
				
		html_mil += "<TABLE WIDTH="+largeur+" CELLPADDING=10 CELLSPACING=0 BORDER=0 class='cadre' >";
		html_mil += "<TR><TD align='right'><a href='#' onClick=\"closeSup_img('div_show_img');return(false)\" title='Fermer' style='border:1px solid #999999;color:#ffffff;background-color:cc3300;'><b>X<\/b><\/a><\/TD><\/TR>";
		html_mil += "<TR><TD align='center' class='normal'>";
		html_mil += "<a href='#' onClick=\"closeSup_img('div_show_img');return(false)\" title='Fermer'><img src='"+img+"' border='0' alt='' class='div_log cadre_noir' /></a><\/TD><\/TR>";
		html_mil += "<\/TABLE>";
		
		html_mil += "<\/TD><\/TR><\/TABLE>";
		
		document.getElementById("div_show_img").innerHTML = html_mil;
	}
}


function AfficherImage_parent(img,chemin_root)
{	
	var agt=navigator.userAgent.toLowerCase();
	var is_opera = (agt.indexOf("opera") != -1);

 	Image1= new Image();
  	Image1.src=(img);
	var largeur=Image1.width;
  	var hauteur=Image1.height;

	if(is_opera)
		{
		larg = document.body.clientWidth;
		haut = document.body.clientHeight;
		}
	else if(document.all)
		{
		larg = document.body.clientWidth;
		haut = document.body.clientHeight;
		}
	else
		{
		larg = innerWidth;
		haut = innerHeight;
		}

	
	if(document.getElementById)
	{		
		parent.document.getElementById("div_show_img").style.width = '99%';
		parent.document.getElementById("div_show_img").style.height = '99%';
		
		html_mil = "<table style='width:100%;height:100%'><TR><TD VALIGN=middle ALIGN=center >";
				
		html_mil += "<TABLE WIDTH="+largeur+" CELLPADDING=10 CELLSPACING=0 BORDER=0 class='cadre' >";
		html_mil += "<TR><TD align='right'><a href='#' onClick=\"closeSup_img('div_show_img');return(false)\" title='Fermer' style='border:1px solid #999999;color:#ffffff;background-color:cc3300;'><b>X<\/b><\/a><\/TD><\/TR>";
		html_mil += "<TR><TD align='center' class='normal'>";
		html_mil += "<a href='#' onClick=\"closeSup_img('div_show_img');return(false)\" title='Fermer'><img src='"+img+"' border='0' alt='' class='div_log cadre_noir' /></a><\/TD><\/TR>";
		html_mil += "<\/TABLE>";
		
		html_mil += "<\/TD><\/TR><\/TABLE>";
		
		parent.document.getElementById("div_show_img").innerHTML = html_mil;
	}
}


function closeSup_img(div)
{
	if(document.getElementById)
	{
		document.getElementById(div).style.width = 1;
		document.getElementById(div).style.height = 1;
		document.getElementById(div).innerHTML = '';
	}
}


function show_ajout_caddie(img,titre,chemin_root,qte,taille,couleur)
{
	setTimeout('affichage_ajout_caddie("'+img+'","'+titre+'", "'+chemin_root+'", "'+qte+'","'+taille+'", "'+couleur+'")', 2000);
}

function affichage_ajout_caddie(img,titre,chemin_root,qte,taille,couleur)
{	
	var pluriel = '';
	var ajoute = 'a été ajouté';
	if(qte > 1) {pluriel ='s';ajoute='ont été ajoutés';}
	var agt=navigator.userAgent.toLowerCase();
	var is_opera = (agt.indexOf("opera") != -1);

 	Image1= new Image();
  	Image1.src=(img);
	var largeur=Image1.width;
  	var hauteur=Image1.height;

	if(is_opera)
		{
		larg = document.body.clientWidth;
		haut = document.body.clientHeight;
		}
	else if(document.all)
		{
		larg = document.body.clientWidth;
		haut = document.body.clientHeight;
		}
	else
		{
		larg = innerWidth;
		haut = innerHeight;
		}

	
	if(document.getElementById)
	{		
		document.getElementById("div_show_ajout_caddie").style.width = '99%';
		document.getElementById("div_show_ajout_caddie").style.height = '99%';
		
		html_mil = "<table style='width:100%;height:100%'><TR><TD VALIGN=middle ALIGN=center >";
				
		html_mil += "<TABLE WIDTH='400' CELLPADDING=10 CELLSPACING=0 BORDER=0 class='cadre' >";
		html_mil += "<TR><TD align='right'><a href='#' onClick=\"closeSup_img('div_show_ajout_caddie');return(false)\" title='Fermer' style='border:1px solid #999999;color:#ffffff;background-color:cc3300;'><b>X<\/b><\/a><\/TD><\/TR>";
		html_mil += "<TR><TD align='center' class='normal'>";
		html_mil += qte+ " article"+pluriel+"  '"+titre+"'<br />de couleur "+couleur+" et de taille "+taille+" "+ajoute+"<br /><br /><center>";
		html_mil += "<img src='"+img+"' border='0' alt='' class='div_log cadre_noir' width='100' /></center><\/TD><\/TR>";
		html_mil += "<\/TABLE>";
		
		html_mil += "<\/TD><\/TR><\/TABLE>";
		
		document.getElementById("div_show_ajout_caddie").innerHTML = html_mil;
		setTimeout("closeSup_img('div_show_ajout_caddie')",5000);

	}
}


function valid(val, la_qte, la_taille, la_couleur)
{
 	lien_ajax = 'act=ajout&id='+val+'&qte='+la_qte+'&taille='+la_taille+'&couleur='+la_couleur;	
	alert(lien_ajax);
}