<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

// ajouter aux favoris(IE > 4)
function addfav()
{
if (document.all)
{
window.external.AddFavorite(location.href, document.title);
}
else
{
alert('Vous pouvez faire CTRL + D \npour ajouter livrereligieux.com dans vos signets, ou favoris.')
}
}

// ouverture pop-up envoyer la page a un ami
function popup_centre(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/3;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

// valider un formulaire
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- Votre adresse e-mail semble invalide.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- Le champ '+nm+' est requis.\n'; }
  } if (errors) alert('! Erreur :\n'+errors);
  document.MM_returnValue = (errors == '');
}

function checkCheckBox(form,zone) { 
       if (!form.cgv.checked) { 
            alert(' Vous devez accepter les conditions générales de vente avant de continuer'); 
            return false; 
        }
		if(zone=='#') {
			alert('Veuillez sélectionner votre zone d\'expédition');
            return false; 
		}
        return true; 
}

// vérification qu'il n'y a pas de cdouble-clic sur le submit final
var unique=0;
function envoi(){
	if (unique == 0){
		unique++;
		return true;
	}
	else {
		alert("Merci de patienter : envoi de votre commande en cours...");
		return false;
	}
}

function afficheMaxi(chemin)
 	{
 	//Déclaration des variables 
 	var largeur = 0;
 	var hauteur = 0;
 	var Left = 0;
 	var Top = 0;
 
 	//Main
 	i1 = new Image();
 	i1.src = chemin;
 	largeur = i1.width + 50;
 	hauteur = i1.height + 100;
 	Left=(screen.width-largeur)/2;
 	Top=(screen.height-hauteur)/4;
 
 	html = '<html><head><title>Couverture Livre</title></head><body leftmargin=0 marginwidth=0 topmargin=5 marginheight=20 bgcolor="#FFFFFF"><center><img src="'+chemin+'" border=0 name=image onLoad="window.resizeTo(document.imageTest.width+50,document.imageTest.height+200)"></center></body></html>';
 	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0, width=500, height=650, left='+Left+', top='+Top+'');
 	popupImage.document.open();
 	popupImage.document.write(html);
 	popupImage.document.close()
 	}
	
x=0
function droite()
{
x=x+7

if(document.all)
        {
        document.all("couloir").style.left= x
        }
else if (document.layers)
        {
        document.layers("couloir").left= x
        }
else if(document.getElementById)
        {
        document.getElementById("couloir").style.left = x
        }

d=setTimeout('droite()',25)
}

function stopD()
{
clearTimeout(d)
}

function gauche()
{
x=x-7

if(document.all)
        {
        document.all("couloir").style.left= x
        }
else if (document.layers)
        {
        document.layers("couloir").left= x
        }
else if(document.getElementById)
        {
        document.getElementById("couloir").style.left = x
        }

g=setTimeout('gauche()',25)

}
function stopG()
{
clearTimeout(g)
}
//-->
