<!----------------------------- 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;

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


// 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 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_NIVEAU_PRIX = eval("PROD_"+i+"_NIVEAU_PRIX");
	var PROD_PRIX= eval("PROD_"+i+"_PRIX");
	var PROD_IMG_SUPER_ZOOM = eval("PROD_"+i+"_IMG_SUPER_ZOOM");
	var DIVIMG= "DIVIMG_"+i;

	var SuperZoom = false;
	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("				<DIV ID='image_szoom_"+i+"' ");
	document.write("					><A HREF='javascript:hideSuper("+i+");'><IMG BORDER=0 SRC='http://images.aquarelle-gourmand.com/photos/transparent.gif' width=550 height=550></A>");
	document.write("				</DIV>");
	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>");

/***************************
		DIV Zoom
***************************/

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

	document.write("<TABLE width=765 border=1 cellspacing=0 cellpadding=0 borderColor=\"#45525D\" id=Tab_"+i+">");

	document.write("		<TR>");
	document.write("			<TD>");
	document.write("		<TABLE border=0 width=100%  height=320>");
	document.write("		<TR>");
	document.write("			<TD width=15 rowspan=7>&nbsp;</TD>");
	document.write("			<TD rowspan=4 align=center valign=top>");
	document.write("				<div id="+DIVIMG+"><IMG NAME=PRODIMG SRC='http://images.aquarelle-gourmand.com/photos/transparent.gif' WIDTH=\"350\" HEIGHT=\"350\" BORDER=\"0\" ALT=\"\"></div>");
	if (PROD_IMG_SUPER_ZOOM){
		document.write("								<A HREF='javascript:superzoom("+i+")'><IMG NAME=PRODIMG SRC=\"http://images.aquarelle-gourmand.com/photos/loupe.jpg\" WIDTH=\"26\" HEIGHT=\"24\" BORDER=\"0\" ALT=\"\" ></A>");
		document.write("								<INPUT TYPE='BUTTON' class='buttonImp' VALUE=\"Agrandir l'image\" onclick='javascript:superzoom("+i+")'><br><br>");
	}
	document.write("			</TD>");
	document.write("			<TD width=5 rowspan=7>&nbsp;</TD>");
	document.write("			<TD align='center' valign='bottom'>");
	document.write("				<span class='titleBouquet'><B>"+PROD_TITRE+"</B></span>");
	document.write("			</TD>");
	document.write("			<TD width=10 valign='top' rowspan=6><INPUT TYPE='BUTTON' class='button' NAME=\"X\" VALUE=\"X\" onclick=\"zoomcmd.style.visibility='hidden'\"></TD>");
	document.write("		</TR>");

	document.write("		<TR height=150>");
	document.write("			<TD valign=top>");
	document.write("				<BR><P class=stdjustify>"+PROD_TEXT+"</P>");
	document.write("			</TD>");
	document.write("		</TR>");

	document.write("<TR>");
	var info=recupInfo(i);
	if ( info=="178" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Régalez-vous ! Envoyez 120g de délicieuses amandes cacaotées pour 7 € !</B><BR>Des amandes délicatement torréfiées et enrobées d'une fine poudre de cacao...<BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	else if ( info=="187" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Régalez-vous ! Envoyez 2 succulents abricots de Damas pour 7 € !</B><BR>Délicieusement candisés, ils sont fourrés de merveilleuses pistaches entières...<BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	else if ( info=="189" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Envoyez 140 g de délicieux nougats, pâtes d'amandes et de pistaches pour 7 € seulement !</B><BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	else if ( info=="190" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Accompagnez votre commande de 120g de savoureuses pâtes de fruits pour 7 € seulement !</B><BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	else if ( info=="203" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Accompagnez votre cadeau de 170g de délicieux galets au chocolat fondant pour 7 € seulement !</B><BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	else if ( info=="170" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Une boîte de 150g d'orangettes avec votre commande pour seulement 7 € !</B><BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	else if ( info=="205" )
	{
		document.write("	<TD>");
		document.write("	<BR><FONT style='color:#663300'><B>Accompagnez votre cadeau de délicieuses huîtres au praliné fondant pour 7 € seulement !</B><BR>Précisez cette option dans le bon de commande.</FONT>");
		document.write("	</TD>");
	}

	document.write("</TR>");
	
	document.write("		<TR height=30 valign='top'> ");
	document.write("			<TD align=justify valign=top>");
	document.write("				<br><b>Sélectionnez la taille de votre boîte et passez commande</b><br><br>");
	var niveau_prix = PROD_NIVEAU_PRIX.split(',');
	desc_array = PROD_DESC.split(',');
	prod_number= desc_array[0].substring(1,desc_array[0].length - 1);
	tab_prix = PROD_NIVEAU_PRIX.split(',');
	info_prix(prod_number);
	for (var compteur=1;niveau_prix[compteur-1];compteur++){
		if(undefined===eval('texte_prix'+compteur)){
			texte_prix = "";
		}
		else
			texte_prix = eval('texte_prix'+compteur);

		document.write("			<INPUT TYPE='radio' NAME='prix_tmp' ID='prix_radio_"+prod_number+"_"+compteur+"' Value='"+compteur+"' onClick='change_prix(this.value,"+DIVIMG+")'>&nbsp;&nbsp;<b>"+tab_prix[compteur-1]+"</b> "+texte_prix+"<br>");
	}
	document.write("				<BR><B><FONT class='bouton'>Livraison : 10 €<br><br></font></B></font>");
	document.write("			<span class='validerBigZoom'><A class='validerBigZoom' HREF=\"javascript:Commander("+PROD_DESC+");\" style=\"text-decoration:none\"><IMG SRC=\"http://images.aquarelle-gourmand.com/photos/menu/fleche_14points_rouge.gif\" border=0 align=ABSMIDDLE>&nbsp;<B>Passer commande</B></a></span>");
	document.write("			</TD>");
	document.write("		</TR>");

	document.write("		<TR>");
	document.write("			<TD valign=top><font class='stdjustify'>");
	document.write("				<I><FONT class=stdthin>Pour toute demande spécifique comme la livraison de plusieurs boites à la même adresse, merci de contacter notre service client  par téléphone : 0 820 820 450 (0,12 € /mn)<BR>Notre service clients est à votre écoute du lundi au samedi de 10h à 18h.</FONT></I>");
	document.write("							</TD>");


	
	document.write("			<TD valign=bottom>");
	document.write("			</TD>");
	document.write("		</TR>");

	document.write("		<TR>");
	var cadeau=recupCADEAU(i);

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

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

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

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

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

function check(R, P)
{
	for(jj=1 ; jj<4 ; jj++)
	{
		document.getElementById("DIVRADIO"+jj+"_"+P).innerHTML = "<a href='#' onClick=javascript:check("+jj+","+P+")><img src='http://images.aquarelle-gourmand.com/photos/zoom/radio.gif'></a>";
	}
	document.getElementById("DIVRADIO"+R+"_"+P).innerHTML = "<a href='#' onClick=javascript:check("+R+","+P+")><img src='http://images.aquarelle-gourmand.com/photos/zoom/radiochecked.gif'></a>";
}
/*
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");
	document.formshop.prix.value = PROD_INDICE_PRIX;
//décochage des boutons radio
	var desc_array = PROD_DESC_ZOOM.split(',');
	var prod_number= desc_array[0].substring(1,desc_array[0].length - 1);
	var compt = 1;
	while (document.getElementById('prix_radio_'+prod_number+'_'+compt)) {
		document.getElementById('prix_radio_'+prod_number+'_'+compt).checked=false;
		compt++;
	}
	if (compt == 2){ //Cas où il n'y 'un seul niveau de pris: on coche le bouton
		document.getElementById('prix_radio_'+prod_number+'_1').checked=true;
	}

//cacher un superZoom ou un Zoom déjà ouvert
	for ( i=1 ; i<nbrPROD+1 ; i++ )
	{
			zoomcmd = document.getElementById("zoomcmd_"+i);
			superzoomcmd = document.getElementById("superzoom_"+i);
			if (ns4) {
				zoomcmd.visibility = "hide";
				superzoomcmd.visibility = "hide";
			}
			else {
				zoomcmd.style.visibility = "hidden";
				superzoomcmd.style.visibility = "hidden";
			}
	}

	zoomcmd = document.getElementById("zoomcmd_"+numPROD);
	if (ns4)
	{
		zoomcmd.visibility = "show";
	}
	else
	{
		zoomcmd.style.visibility = "visible";
	}
	var image_zoom = document.getElementById("DIVIMG_"+numPROD);
	image_zoom.innerHTML = "<A HREF=\"javascript:Commander("+PROD_DESC_ZOOM+");\"><IMG NAME=PRODIMG SRC='http://images.aquarelle-gourmand.com/photos/transparent.gif' WIDTH=\"350\" HEIGHT=\"350\" BORDER=\"0\" ALT=\"\"></A>";
	image_zoom.style.width = "350px";
	image_zoom.style.height = "350px";
	image_zoom.style.backgroundPosition = "top";
	image_zoom.style.backgroundImage = "url('http://images.aquarelle-gourmand.com/bouquets/"+imgPROD+"')";

	var image_szoom = document.getElementById("image_szoom_"+numPROD);
	image_szoom.style.width = "550px";
	image_szoom.style.height = "550px";
	image_szoom.style.backgroundPosition = "top";
	image_szoom.style.backgroundImage = "url('http://images.aquarelle-gourmand.com/bouquets/"+PROD_IMG_SUPER_ZOOM+"')";

}

function superzoom(numPROD)
{
	var PROD_DESC_ZOOM = eval("PROD_"+numPROD+"_DESC");

	var desc_array = PROD_DESC_ZOOM.split(',');
	var prod_number= desc_array[0].substring(1,desc_array[0].length - 1);
	var niveau_prix=0;
	var compt = 1;
	while (document.getElementById('prix_radio_'+prod_number+'_'+compt)) {
		if(document.getElementById('prix_radio_'+prod_number+'_'+compt).checked)
			niveau_prix=compt;
		compt++;
	}
	
	superzoomcmd = document.getElementById("superzoom_"+numPROD);
	zoomcmd = document.getElementById("zoomcmd_"+numPROD);

	image_szoom = document.getElementById("image_szoom_"+numPROD);

	var y_position = 550*niveau_prix;
	image_szoom.style.backgroundPosition="0px -"+y_position+"px";

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

}

function superzoomdirect(numPROD)
{
	var PROD_DESC_ZOOM = eval("PROD_"+numPROD+"_DESC");

	var PROD_IMG_SUPER_ZOOM = eval("PROD_"+numPROD+"_IMG_SUPER_ZOOM");
	var imgPROD = eval("PROD_"+numPROD+"_IMG");
	var desc_array = PROD_DESC_ZOOM.split(',');
	var prod_number= desc_array[0].substring(1,desc_array[0].length - 1);
	var niveau_prix=0;
	var compt = 1;

	while (document.getElementById('prix_radio_'+prod_number+'_'+compt)) {
		alert('prix_radio_'+compt+'_'+prod_number);
		alert(document.getElementById('prix_radio_'+compt+'_'+prod_number).checked);
		if(document.getElementById('prix_radio_'+prod_number+'_'+compt).checked)
			niveau_prix=compt;
		compt++;
	}
//alert(niveau_prix);
	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";
	}
	var image_szoom = document.getElementById("image_szoom_"+numPROD);

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

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

	var y_position = 550*niveau_prix;
	image_szoom.style.backgroundPosition="0px -"+y_position+"px";
}

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";
	}

}

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";
	}
}
*/
function ComparerDates(LeParam1,LeParam2){

// Compare 2 dates au format jj/mm/aaaa
// Renvoye 0 si égalité, 1 si la première est supérieure, sinon 2

var LeParam1 = DateAnglaise(LeParam1,"/");// Ne pas oublier d'utiliser cette fonction
// pour convertir en date anglaise, sinon le 05/07/2003 sera compris "7 mai 2003" par JavaScript

var LeParam2 = DateAnglaise(LeParam2,"/");
LeParam1 = Date.parse(LeParam1);
LeParam2 = Date.parse(LeParam2);

if (LeParam1 == LeParam2) { 
return 0;
}

if (LeParam1 > LeParam2){
return 1;
}else{
return 2;
}
}
