//<!----------------------------- création des Zooms produit  ------------------------> 

// Decide browser version
var ns4 = (navigator.appName == 'Netscape' && parseInt(navigator.appVersion) == 4);
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
var ie5 = false;

superzoom_type = 'normal';

//popup en fonction de la resolution
if (screen.width <= 800)
{
	var top_zoom = 10;
	var left_zoom = 50;
}
else
{
	var top_zoom = 20;
	var left_zoom = 180;
}



// Microsoft Stupidity Check(tm).
if (ie4)
{
	if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0))
	{
		ie5 = true;
	}
	if (ns6)
	{
		ns6 = false;
	}
}


for(i=1;i<(nbrPROD+1);i++)
{
	var SuperZoom = false;
	var PROD_DESC = eval("PROD_"+i+"_DESC");
	var PROD_TITRE = eval("PROD_"+i+"_TITRE");
	var PROD_TEXT = eval("PROD_"+i+"_TEXT");
	var PROD_OPT = eval("PROD_"+i+"_OPT");
	var PROD_IMG = eval("PROD_"+i+"_IMG");
	var PROD_PRIX= eval("PROD_"+i+"_PRIX");
	var PROD_RESUME = eval("PROD_"+i+"_RESUME");
	var DIVIMG= "DIVIMG_"+i;

	var PROD_TMP=PROD_DESC.split(",");
	var IDPROD = PROD_TMP[0];

/***************************
		DIV Super Zoom
***************************/
	document.write("<div id='superzoom_"+i+"' style=\"border-style:solid; border-color:black; border-width:1px; position:absolute; left:"+left_zoom+"; top: "+top_zoom+"; background-color:#FFFFFF; z-index:21; visibility:hidden;\" name='superzoom_"+i+"'>");
	document.write("<TABLE width=550 style='border-collapse: collapse;'>");
	document.write("		<TR>");
	document.write("			<TD align=right width=550>");
	document.write("				<INPUT TYPE='BUTTON' class='button' VALUE=\"X\" onclick='javascript:hideSuper("+i+")'>");
	document.write("			</TD>");
	document.write("		</TR>");
	document.write("		<TR>");
	document.write("			<TD>	");
	document.write("				<A HREF='javascript:hideSuper("+i+");'>");
	document.write("					<DIV ID='image_szoom_"+i+"'><IMG BORDER=0 SRC='http://images.aquarelle.be/photos/transparent.gif' width=550 height=550></DIV>");
	document.write("				</A>");
	document.write("			</TD>	");
	document.write("		</TR>");
	document.write("		<TR>");
	document.write("			<TD align=right width=550>");
	document.write("				<INPUT TYPE='BUTTON' class='button' VALUE=\"fermer\" onclick='javascript:hideSuper("+i+")'>");
	document.write("			</TD>");
	document.write("		</TR>");
	document.write("</TABLE>");
	document.write("</div>");
// Fin du cadre superZoom 
////////////////////////////

	document.write("<DIV style=\"position:absolute; left:"+left_zoom+"; top: "+top_zoom+";background-color:#FFFFFF; z-index:21; border-color:#45525D\" id=zoomcmd_"+i+">");

	document.write("<TABLE width=600 border=2 style=\"border-collapse:collapse; \" id=Tab_"+i+">");
	document.write("		<TR>");
	document.write("			<TD>");
	document.write("					<TABLE width=600 border=0>");
	document.write("						<TR>");
	document.write("							<TD align=right width=590>");
	document.write("								<INPUT TYPE='BUTTON' class='button' NAME=\"X\" VALUE=\"X\" onclick=\"zoomcmd.style.visibility='hidden'\">");
	document.write("							</TD>");
	document.write("						</TR>");
	document.write("						<TR>");
	document.write("							<TD  align=center width=590>");
	document.write("								<span class='titrebouquet'>"+PROD_TITRE+"</span>");
	document.write("							</TD>");
	document.write("						</TR>");
	document.write("					</TABLE>");
	document.write("					<TABLE width=600 border=0>");
	document.write("						<TR>");
	document.write("							<TD WIDTH='260'>");
////////////////////////////
// MODIFYsuperZoom
// ajout de la loupe et du 
// "agrandir la photo"
// (attention à la langue)
////////////////////////////
	document.write("								<div id="+DIVIMG+"><A HREF=\"javascript:Commander("+PROD_DESC+");\"><IMG NAME=PRODIMG SRC=\"http://images.aquarelle.be/photos/blank.gif\" WIDTH=\"250\" HEIGHT=\"250\" BORDER=\"0\" ALT=\"\"></A></div>");
	document.write("							<span class='text'><CENTER><B>"+PROD_PRIX);
	document.write("							</B></CENTER></span>");
	document.write("								<IMG NAME=PRODIMG SRC='http://images.aquarelle.be/photos/blank.gif' WIDTH='30' BORDER='0'></A>");
	document.write("								<A HREF='javascript:superzoom("+i+")'><IMG NAME=PRODIMG SRC=\"http://images.aquarelle.be/photos/loupe.jpg\" WIDTH=\"26\" HEIGHT=\"24\" BORDER=\"0\" ALT=\"\" ></A>");
	document.write("								<INPUT TYPE='BUTTON' class='buttonImp' VALUE='Agrandir la photo' onclick='javascript:superzoom("+i+")'>");
	document.write("							</TD>");

	document.write("							<TD WIDTH='450'>");
////////////////////////////
// Fin des modifictations
////////////////////////////

	document.write("								<TABLE border=0 width=100%>");
	document.write("									<TR>");
	document.write("										<TD width=100% valign=top>");
	document.write("											<span class='text'>"+PROD_TEXT+"</span><br>");
	document.write("										</TD>");
	document.write("									</TR>");

	document.write("									<TR>");
	document.write("										<TD width=100% valign=top>");
	document.write("											<br><span class='txtImportantNoB'>"+PROD_RESUME+"</span>");
	document.write("										</TD>");
	document.write("									</TR>");
	
	document.write("									<TR>");
	document.write("										<TD width=100% valign=top>");
if(code_shop == "produits_bijoux") 
{
	document.write("											<br><B><span class='txtImportant'>Taille unique</span></B><br>"+PROD_OPT+"<br>");
}
else 
{
	document.write("											<br><B><span class='txtImportant'>Choisissez la dimension du bouquet</span></B><br><br>"+PROD_OPT+"<br>");
}
	document.write("										</TD>");
	document.write("									</TR>");
	
	document.write("									<TR>");
	document.write("										<TD width=100% valign=top>");
	document.write("											<br><IMG SRC='http://images.aquarelle.be/photos/menu/fleche_marron_fondtransparen.gif' WIDTH=10 HEIGHT=20 ALT='fleche' BORDER=0>&nbsp;");
	document.write("											<A class='validerBig' HREF=\"javascript:Commander("+PROD_DESC+");\" style=\"text-decoration:none\" title=\"Passer commande\"><B>Passer commande</B></A>");
	document.write("										</TD>");
	document.write("									</TR>");
	document.write("								</TABLE>");

	document.write("							</TD>");
	document.write("					   </TR>");
	document.write("						<TR>");
	document.write("						<TR>");
	document.write("							<TD align=center>&nbsp;</B>");

	var cadeau=recupCADEAU(i);

	if ( cadeau!="0" )
	{
		document.write("						<A HREF='/pg/shop/shop_options.cgi?"+cadeau+"&fr' target=blank>Votre cadeau</A>");
	}

	document.write("							</TD>");
	document.write("							<TD>");


	document.write("<TABLE border=0 width=100%>");
	document.write("<TR>");
	document.write("	<TD width=250>");

	document.write("								<INPUT TYPE='BUTTON' class='button' NAME=\"Fermer\" VALUE=\"Fermer\" onclick=\"zoomcmd.style.visibility='hidden'\">");
	
	document.write("</TABLE>");
	
	
	document.write("</TD>");
	document.write("						</TR>");

	document.write("					</TABLE>");
	document.write("				</TD>");
	document.write("			</TR>");
	document.write("</TABLE>");
	document.write("</DIV>");

	zoomcmd = document.getElementById("zoomcmd_"+i);

	if (ns4) zoomcmd.visibility = "hide";
	else zoomcmd.style.visibility = "hidden";
}


function zoom(numPROD,imgPROD)
{
	var PROD_DESC_ZOOM = eval("PROD_"+numPROD+"_DESC");
	var PROD_INDICE_PRIX = eval("PROD_"+numPROD+"_INDICE_PRIX");
	var PROD_IMG_SUPER_ZOOM = eval("PROD_"+numPROD+"_IMG_SUPER_ZOOM");
	var PROD_IMG_250 = eval("PROD_"+numPROD+"_IMG_250");


	document.formshop.prix.value = PROD_INDICE_PRIX;

	for ( i=1 ; i<nbrPROD+1 ; i++ )
	{
			zoomcmd = document.getElementById("zoomcmd_"+i);
			if (ns4) zoomcmd.visibility = "hide";
			else zoomcmd.style.visibility = "hidden";
	}

	zoomcmd = document.getElementById("zoomcmd_"+numPROD);
	makeStatic();

	if (ns4)
	{
		zoomcmd.visibility = "show";
	}
	else
	{
		zoomcmd.style.visibility = "visible";
	}

	document.getElementById("DIVIMG_"+numPROD).innerHTML = "<A HREF=javascript:Commander("+PROD_DESC_ZOOM+")><IMG NAME=PRODIMG SRC=\"http://images.aquarelle.be/bouquets/"+PROD_IMG_250+"\" WIDTH=\"250\" HEIGHT=\"250\" BORDER=\"0\" ALT=\"\"></A>";
	
	var image_szoom = document.getElementById("image_szoom_"+numPROD);

	if(PROD_IMG_SUPER_ZOOM) {
		image_szoom.style.backgroundImage = "url('http://images.aquarelle.be/bouquets/"+PROD_IMG_SUPER_ZOOM+"')";
	}
	else{

		image_szoom.style.backgroundImage = "url('http://images.aquarelle.be/bouquets/"+imgPROD+"_550.gif')";
	}
}

function superzoom(numPROD)
{
	var PROD_IMG_SUPER_ZOOM = eval("PROD_"+numPROD+"_IMG_SUPER_ZOOM");
	superzoomcmd = document.getElementById("superzoom_"+numPROD);
	zoomcmd = document.getElementById("zoomcmd_"+numPROD);
	makeSuperZommStatic();
	superzoom_type = 'normal';

	if (ns4)
	{
		zoomcmd.visibility = "hide";
		superzoomcmd.visibility = "show";
	}
	else
	{
		zoomcmd.style.visibility = "hidden";
		superzoomcmd.style.visibility = "visible";
	}

}

function superzoomdirect(numPROD)
{
	var PROD_IMG_SUPER_ZOOM = eval("PROD_"+numPROD+"_IMG_SUPER_ZOOM");
	var imgPROD = eval("PROD_"+numPROD+"_IMG");
	superzoomcmd = document.getElementById("superzoom_"+numPROD);
	zoomcmd = document.getElementById("zoomcmd_"+numPROD);
	makeSuperZommStatic();
	superzoom_type = 'zoomdirect';
	if (ns4)
	{
		zoomcmd.visibility = "hide";
		superzoomcmd.visibility = "show";
	}
	else
	{
		zoomcmd.style.visibility = "hidden";
		superzoomcmd.style.visibility = "visible";
	}
	document.getElementById("select_zoomdirect").style.visibility = 'hidden';
	var image_szoom = document.getElementById("image_szoom_"+numPROD);

	if(PROD_IMG_SUPER_ZOOM) {
		image_szoom.style.backgroundImage = "url('http://images.aquarelle.be/bouquets/"+PROD_IMG_SUPER_ZOOM+"')";
	}
	else{

		image_szoom.style.backgroundImage = "url('http://images.aquarelle.be/bouquets/"+imgPROD+"_550.gif')";
	}

}

function hideSuper(numPROD)
{

	superzoomcmd = document.getElementById("superzoom_"+numPROD);
	zoomcmd = document.getElementById("zoomcmd_"+numPROD);

	if (ns4)
	{
		superzoomcmd.visibility = "hide";
		if(superzoom_type == 'normal')
			zoomcmd.visibility = "show";
		else
			document.getElementById("select_zoomdirect").style.visibility = 'visible';
	}
	else
	{
		superzoomcmd.style.visibility = "hidden";
		if(superzoom_type == 'normal')
			zoomcmd.style.visibility = "visible";
		else
			document.getElementById("select_zoomdirect").style.visibility = 'visible';
	}

}


function hidezoom(numPROD)
{
	for ( i=1 ; i<nbrPROD+1  ; i++ )
	{
			zoomcmd = document.getElementById("zoomcmd_"+i);
			if (ns4) zoomcmd.visibility = "hide";
			else zoomcmd.style.visibility = "hidden";
	}
}

//<!----------------------------- fin Zoom produit  ------------------------>