// JavaScript Document
<!--
// ouverture pop-up envoyer la page a un ami
function popup_centre(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/4;
  var left=(screen.width-largeur)/2;
  window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

// ajouter aux favoris(IE > 4)
function addfav() {
	if (document.all){
		window.external.AddFavorite(location.href, document.title);
	}
	else{
		alert('Vous devez faire [CTRL + D] \npour ajouter siloe-librairies.com dans vos signets, ou favoris.')
	}
}


// 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 == '');
}

// redirection
function redirect(url) {
	window.location.href=url;
}


// menus de redirection
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


/* #################### effet zoom sur les images des libraires
#############################################################*/
// image 1
var coeff1=3;//Coefficient de reduction
var larg1=300;//largeur maxi de l'image
var haut1=440;//hauteur maxi de l'image
function changer1() {
if (document.getElementById('image1').width < larg1) {
coeff1 = coeff1-0.2;
document.getElementById('image1').width = Math.round(larg1/coeff1);
document.getElementById('image1').height = Math.round(haut1/coeff1);
chang1=window.setTimeout('changer1();',30);//vitesse de l'effet en centiemes de secondes
}
else {window.clearTimeout(chang1);}
}
function initial1() {
if (document.getElementById('image1').width > larg1/3) { //Coefficient de reduction 
window.clearTimeout(chang1);
coeff1 = coeff1+0.2;
document.getElementById('image1').width = Math.round(larg1/coeff1);
document.getElementById('image1').height = Math.round(haut1/coeff1);

initi1=window.setTimeout('initial1();',30);//vitesse de l'effet
}
else {window.clearTimeout(initi1);}
}

// image 2
var coeff2=3;//Coefficient de reduction
var larg2=300;//largeur maxi de l'image
var haut2=440;//hauteur maxi de l'image
function changer2() {
if (document.getElementById('image2').width < larg2) {
coeff2 = coeff2-0.2;
document.getElementById('image2').width = Math.round(larg2/coeff2);
document.getElementById('image2').height = Math.round(haut2/coeff2);
chang2=window.setTimeout('changer2();',30);//vitesse de l'effet en centiemes de secondes
}
else {window.clearTimeout(chang2);}
}
function initial2() {
if (document.getElementById('image2').width > larg2/3) { //Coefficient de reduction 
window.clearTimeout(chang2);
coeff2 = coeff2+0.2;
document.getElementById('image2').width = Math.round(larg2/coeff2);
document.getElementById('image2').height = Math.round(haut2/coeff2);

initi2=window.setTimeout('initial2();',30);//vitesse de l'effet
}
else {window.clearTimeout(initi2);}
}

// image 3
var coeff3=3;//Coefficient de reduction
var larg3=300;//largeur maxi de l'image
var haut3=440;//hauteur maxi de l'image
function changer3() {
if (document.getElementById('image3').width < larg3) {
coeff3 = coeff3-0.2;
document.getElementById('image3').width = Math.round(larg3/coeff3);
document.getElementById('image3').height = Math.round(haut3/coeff3);
chang3=window.setTimeout('changer3();',30);//vitesse de l'effet en centiemes de secondes
}
else {window.clearTimeout(chang3);}
}
function initial3() {
if (document.getElementById('image3').width > larg3/3) { //Coefficient de reduction 
window.clearTimeout(chang3);
coeff3 = coeff3+0.2;
document.getElementById('image3').width = Math.round(larg3/coeff3);
document.getElementById('image3').height = Math.round(haut3/coeff3);

initi3=window.setTimeout('initial3();',30);//vitesse de l'effet
}
else {window.clearTimeout(initi3);}
}
-->

