<!--
function info(texte) {
if ((texte=="")||(texte==null)) {
window.status="Ste Penn'Ty Bio";
} else {
window.status=texte;
}
}
        // buyItem -ajoute un produit dans le panier
        function buyItem(newItem, newPrice, newTva, newRef, newQuantity) {
a=0;
z=0;
fcont=42;
var rref= new Array(40);
var dref= new Array(40);
rref[0]="COB0026";
dref[0]=0;
rref[1]="POSCBC";
dref[1]=0;
rref[2]="spherychien";
dref[2]="15/02/2012";
rref[3]="VECO";
dref[3]=0;
rref[4]="VELIT";
dref[4]=0;
rref[5]="CO5040";
dref[5]=0;
rref[6]="LE1439";
dref[6]=0;
rref[7]="CA0060";
dref[7]=0;
rref[8]="CA0061";
dref[8]=0;
rref[9]="CA00PH0";
dref[9]=0;
rref[10]="CO5011";
dref[10]=0;
rref[11]="CO5045";
dref[11]=0;
rref[12]="SHENF";
dref[12]=0;
rref[13]="HY04";
dref[13]=0;
rref[14]="SHENF2";
dref[14]=0;
rref[15]="MY7925";
dref[15]=0;
rref[16]="COB0187";
dref[16]=0;
rref[17]="VEPO";
dref[17]=0;
rref[18]="CGS15C";
dref[18]=0;
rref[19]="CA00PH3";
dref[19]=0;
rref[20]="LE1400";
dref[20]=0;
rref[21]="LE1449";
dref[21]=0;
rref[22]="CA0098";
dref[22]=0;
rref[23]="Collierchat";
dref[23]=0;
rref[24]="BAUSOL";
dref[24]=0;
rref[25]="SANTEKID20";
dref[25]=0;
rref[26]="DIFRUB";
dref[26]=0;
rref[27]="VEON";
dref[27]=0;
rref[28]="GS15C";
dref[28]=0;
rref[29]="DIFE681";
dref[29]=0;
rref[30]="SIPO";
dref[30]=0;
rref[31]="AFTERSUNN";
dref[31]=0;
rref[32]="LONBEBE";
dref[32]=0;
rref[33]="SANTESP20";
dref[33]=0;
rref[34]="SIPV";
dref[34]=0;
rref[35]="CGS15F";
dref[35]=0;
rref[36]="CA00PH2";
dref[36]=0;
rref[37]="HE1002";
dref[37]="10/02/2012";
rref[38]="GS15";
dref[38]=0;
rref[39]="BIODB22";
dref[39]="10/02/2012";
rref[40]="DCDENT";
dref[40]="17/02/2012";
rref[41]="LE1404";
dref[41]="17/02/2012";





 while (a<fcont)
 {
 if  (newRef==rref[a])
 {
   if (dref[a]==0)  
   {
   rc = alert('Produit non disponible');
   return false;
   }
   else  { window.alert('ATTENTION: '+newItem+ ' est indisponible jusqu\'au = ' +dref[a]+ '\n Vous pouvez le commander, mais votre commande ne sera pas expédiée avant'); } 
  //if (newRef==rref[a]) { window.alert('ATTENTION: '+newItem+ ' est indisponible jusqu\'au = ' +dref[a]+ '\n Vous pouvez le commander, mais vous ne serez pas livé avant'); }
  z=1;
    } 
   a++;
  }
		// date
	   var expdate = new Date();
        expdate.setTime(expdate.getTime() +  (24*  60 * 1000 * 1));
 if (newPrice == 0) { rc = alert('Produit non disponible'); } 
else{
                if (newQuantity <= 0) { rc = alert('Quantité incorrecte'); } 
                else {
                if (z==0)
                {
                        if (confirm('Ajouter '+newQuantity+'  '+newItem+' dans le panier qui sera sauvegardé dans un cookie.\n Produit normalement disponible expedition demain ouvrable . \n Pour finaliser votre commande cliquer sur bon de commande en haut de page'))
                         {
                                index = document.cookie.indexOf("TheBasket");
                                countbegin = (document.cookie.indexOf("=", index) + 1);
                                countend = document.cookie.indexOf(";", index);
                                if (countend == -1)
                                 {
                                  countend = document.cookie.length;
                                 }
                         //      document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]";
    document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]"; path="/";
        //                          document.cookie="TheBasket="+document.cookie.substring(countbegin,countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]"+"; path=/";
     //document.cookie="TheBasket="+escape(document.cookie.substring(countbegin,countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]")+"; path=/";
                          }
                  }
                  else { 
                        if (confirm('Produit momentanément en rupture de stock. \n Ajouter '+newQuantity+'  '+newItem+' dans le panier.\n  Pour finaliser votre commande cliquer sur bon de commande en haut de page'))
                         {
                                index = document.cookie.indexOf("TheBasket");
                                countbegin = (document.cookie.indexOf("=", index) + 1);
                                countend = document.cookie.indexOf(";", index);
                                if (countend == -1)
                                 {
                                  countend = document.cookie.length;
                                 }
                              //  document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]";
                             document.cookie="TheBasket="+document.cookie.substring(countbegin, countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]"; path="/";
       //                            document.cookie="TheBasket="+document.cookie.substring(countbegin,countend)+"["+newItem+"|"+newPrice+"|"+newTva+"|"+newRef+"|"+newQuantity+"]"+"; path=/";

                          }
                  
                     } 
                    }
      }
  }
  
        // Corrige les virgules
        function virgule(value) {
               if (value<=0.99) {
                        newEuros = '0';
                } else {
                        newEuros = parseInt(value);
                }
                newCent = parseInt((value+.0008 - newEuros)* 100);
                if (eval(newCent) <= 9) newCent='0'+newCent;
                newString = newEuros + '.' + newCent;
                return (newString);
        }


	// showItems() - Affiche le panier

	function showPan() {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
       	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
          		countend = document.cookie.length;
       	}
		fulllist = document.cookie.substring(countbegin, countend);
		
//	index = unescape(document.cookie).indexOf("TheBasket");
//countbegin = (unescape(document.cookie).indexOf("=", index) + 1);
//         countend = unescape(document.cookie).indexOf(";", index);
//         if (countend == -1) {
//             countend = unescape(document.cookie).length;
 //        }
//fulllist =unescape(document.cookie).substring(countbegin, countend);		
		

		totprice = 0;
		itemlist = 0;
    tottva = 0;
    totcom=0;
    totttc = 0;
    poid=0;

for (var i = 0; i <= fulllist.length; i++) {
  if (fulllist.substring(i,i+1) == '[') {
    itemstart = i+1;
    thisitem = 1;
	} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
latva = 0;
itemtotal = (theprice*thequantity);
itemtotal = itemtotal *(Math.pow(10,2));
itemtotal = Math.round(itemtotal);
itemtotal = itemtotal /(Math.pow(10,2));
temptotal = itemtotal * 100;
totttc = totttc + latva + itemtotal ;
thetva=(eval(thetva*thequantity));
poid=(eval(poid+ thetva));
totprice = totprice + itemtotal;
itemlist=itemlist+1;


//document.writeln('<TR><TD bgcolor="#CAFFCE" ><font face="verdana" size="2" color="#000000">Montant :'+virgule(totprice)+' € </font></TD></TR>');
//document.writeln('<TR><TD bgcolor="#CAFFCE" ><font face="verdana" size="2" color="#000000">Poids :'+virgule(poid)+' Kg </font></TD></TR>');

				

			} else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
        if (thisitem==3) thetva = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}
			if ((poid >0)&&(poid <=2)) {poid=poid+0.1;}
			if ((poid >2)&&(poid <=5)) {poid=poid+0.2;}
      if ((poid >5)&&(poid <=10)) {poid=poid+0.4;}
      if ((poid >10)&&(poid <=20)) {poid=poid+0.6;}
      if ((poid >20)&&(poid <=30)) {poid=poid+1;}
      if (poid >30) {poid=poid+1.5;}	
      	
document.writeln('<TR><TD bgcolor="#CAFFCE" ><font face="verdana" size="2" color="#000000">Montant :'+virgule(totprice)+' € </font></TD></TR>');
document.writeln('<TR><TD bgcolor="#CAFFCE" ><font face="verdana" size="2" color="#000000">Poids :'+virgule(poid)+' Kg </font></TD></TR>');
	}
	
	function showPanhe() {
		index = document.cookie.indexOf("TheBasket");
		countbegin = (document.cookie.indexOf("=", index) + 1);
       	countend = document.cookie.indexOf(";", index);
        	if (countend == -1) {
          		countend = document.cookie.length;
       	}
		fulllist = document.cookie.substring(countbegin, countend);
		
//	index = unescape(document.cookie).indexOf("TheBasket");
//countbegin = (unescape(document.cookie).indexOf("=", index) + 1);
//         countend = unescape(document.cookie).indexOf(";", index);
//         if (countend == -1) {
//             countend = unescape(document.cookie).length;
 //        }
//fulllist =unescape(document.cookie).substring(countbegin, countend);		
		

		totprice = 0;
		itemlist = 0;
    tottva = 0;
    totcom=0;
    totttc = 0;
    poid=0;

for (var i = 0; i <= fulllist.length; i++) {
  if (fulllist.substring(i,i+1) == '[') {
    itemstart = i+1;
    thisitem = 1;
	} else if (fulllist.substring(i,i+1) == ']') {
itemend = i;
thequantity = fulllist.substring(itemstart, itemend);
itemtotal = 0;
latva = 0;
itemtotal = (theprice*thequantity);
itemtotal = itemtotal *(Math.pow(10,2));
itemtotal = Math.round(itemtotal);
itemtotal = itemtotal /(Math.pow(10,2));
temptotal = itemtotal * 100;
totttc = totttc + latva + itemtotal ;
thetva=(eval(thetva*thequantity));
poid=(eval(poid+ thetva));
totprice = totprice + itemtotal;
itemlist=itemlist+1;


//document.writeln('<TR><TD bgcolor="#CAFFCE" ><font face="verdana" size="2" color="#000000">Montant :'+virgule(totprice)+' € </font></TD></TR>');
//document.writeln('<TR><TD bgcolor="#CAFFCE" ><font face="verdana" size="2" color="#000000">Poids :'+virgule(poid)+' Kg </font></TD></TR>');

				

			} else if (fulllist.substring(i,i+1) == '|') {
				if (thisitem==1) theitem = fulllist.substring(itemstart, i);
				if (thisitem==2) theprice = fulllist.substring(itemstart, i);
        if (thisitem==3) thetva = fulllist.substring(itemstart, i);
				thisitem++;
				itemstart=i+1;
			}
		}
			if ((poid >0)&&(poid <=2)) {poid=poid+0.1;}
			if ((poid >2)&&(poid <=5)) {poid=poid+0.2;}
      if ((poid >5)&&(poid <=10)) {poid=poid+0.4;}
      if ((poid >10)&&(poid <=20)) {poid=poid+0.6;}
      if ((poid >20)&&(poid <=30)) {poid=poid+1;}
      if (poid >30) {poid=poid+1.5;}
      	
document.writeln('<TR><TD bgcolor="#DBBDFF" ><font face="verdana" size="2" color="#000000">Montant :'+virgule(totprice)+' € </font></TD></TR>');
document.writeln('<TR><TD bgcolor="#DBBDFF" ><font face="verdana" size="2" color="#000000">Poids :'+virgule(poid)+' Kg </font></TD></TR>');
	}  
  
function voirpan()
{
FenPop=window.open('bon.html','popup','width=500,height=350,toolbar=no,scrollbars=yes,statusbar=no,titlebar=no,menubar=yes,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
}
function ouvrir(url) {
var NvFn=null;
NvFn=window.open(url,NvFn,"width=590,height=450,left=15,top=15");
NvFn.focus();
}
function voirtab()
{
FenPop=window.open('tableau.htm','popup','width=650,height=500,toolbar=no,scrollbars=yes,statusbar=no,titlebar=no,menubar=yes,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
}
function voiroffre()
{
FenPop=window.open('offre.html','popup1','width=500,height=300,toolbar=no,scrollbars=no,statusbar=no,titlebar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
}
function popup(url) {
var NvFn=null;
NvFn=window.open(url,NvFn,"width=480,height=300,toolbar=no,scrollbars=yes,statusbar=no,menubar=no,left=15,top=15,resizable=yes,personalbar=yes,locationbar=yes");
NvFn.focus();
}
function mess()
{
FenPop=window.open('mess.html','popup1','width=400,height=100,toolbar=no,scrollbars=no,statusbar=no,titlebar=no,menubar=no,left=300,top=150,resizable=no,personalbar=no,locationbar=no');
}
function PopImg(nom,x,y) {
str='<';
var PopImg=null;
var fic='gima/'+nom;
xf= x*1.04;
yf=y*1.04;
PopImg=window.open('','oeuvre','width='+xf+',height='+yf+',toolbar=no,scrollbars=no,statusbar=no,titlebar=no,menubar=no,left=15,top=15,resizable=no,personalbar=no,locationbar=no');
PopImg.document.write('<html><head><title>photo diffuseur</title></head><body background="white" onBlur="javascript:self.close();" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0"><script language="javascript"></script><table width="100%" height="100%" align="center" valign="middle"><tr><td><a href="javascript:self.close();"><img src="'+fic+'" border="0" width="'+x+'" height="'+y+'" align="center" class="nue"  title="Cliquez pour fermer la fenêtre"></a></td></tr></table></body><script language="javascript">self.focus();</script></html>');
PopImg.focus();
}
// -->

