<!----------------------------- 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=\"background-color:#FFFFFF; border-style:solid; border-color:#A48439; border-width:1px; position:absolute; left:"+left_zoom+"; top: "+top_zoom+"; 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.es/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=\"Cerrar\" onclick='javascript:hideSuper("+i+")'>");
	document.write("			</TD>");
	document.write("		</TR>");
	document.write("</TABLE>");
	document.write("</div>");

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

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

	document.write("<TABLE width=765 border=0 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.es/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.es/photos/loupe.jpg\" WIDTH=\"26\" HEIGHT=\"24\" BORDER=\"0\" ALT=\"Ampliar Imagen\" ></A>");
		document.write("								<INPUT TYPE='BUTTON' class='buttonImp' VALUE='Ampliar imagen' title='Ampliar imagen' onclick='javascript:superzoom("+i+")'><br><br>");
	}
	document.write("			</TD>");
	document.write("			<TD width=5 rowspan=7>&nbsp;</TD>");
	document.write("			<TD align='left' 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><span class='text'>"+PROD_TEXT+"</span>");
	document.write("			</TD>");
	document.write("		</TR>");

	document.write("<TR>");
	
	var info=recupInfo(i);

	document.write("</TR>");
	
	document.write("		<TR height=30 valign='top'>");
	document.write("			<TD align=justify valign=top>");
	document.write("				<br><span class='txtImportant'><b>Selecciona el tamaño y haz el pedido</b></span><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('window.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><span class='text'><B>Entrega : 9.50 €</B><br><br></span>");
	document.write("			<span class='validerBigZoom'><A class='validerBigZoom' HREF=\"javascript:Commander("+PROD_DESC+");\" style=\"text-decoration:none;\" title=\"Haz tu pedido ahora\"><IMG SRC=\"http://images.aquarelle-gourmand.es/photos/menu/fleche_14points_rouge.gif\" border=0 align=ABSMIDDLE>&nbsp;<B>Haz tu pedido ahora</B></a></span>");
	document.write("			</TD>");
	document.write("		</TR>");

	document.write("		<TR>");
	document.write("			<TD valign=top>");
	document.write("				<span class='textSmaller'><I>Para cualquier solicitud diferente como la entrega de varios productos a una misma dirección ponte en contacto con nuestro Servicio de Atención al Cliente : 902 282 276.<BR>Nuestro servicio al cliente se encuentra a tu disposición de lunes a viernes de 09:00 a 18:00.</I></span>");
	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+"&es' target='_blank'>Tu regalo</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=\"Cerrar\" VALUE=\"Cerrar\" title=\"Cerrar\" 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.es/photos/zoom/radio.gif'></a>";
	}
	document.getElementById("DIVRADIO"+R+"_"+P).innerHTML = "<a href='#' onClick=javascript:check("+R+","+P+")><img src='http://images.aquarelle-gourmand.es/photos/zoom/radiochecked.gif'></a>";
}

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