// JavaScript Document

function popupcentree(page,largeur,hauteur,options) {     
	 var top=(screen.height-hauteur)/2;     var left=(screen.width-largeur)/2;     
	 window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options); 
 } 
 
 function check_email(lang)
  {
  var email = document.inputForm.email.value;
  var place = email.indexOf("@",1);
  var point = email.indexOf(".",place+1);
  if ((place > -1)&&(email.length >2)&&(point > 1))
    {
	popupcentree('inscription.php?email='+email,340,345,'menubar=no,scrollbars=no,statusbar=no');
    document.inputForm.submit();
    return(true);
    }
  else
    {
		if(lang == 'nl'){
	    	document.inputForm.email.value='Dit e-mailadres is niet juist.';			
		}else if(lang == 'fr'){
		    document.inputForm.email.value='Cet email est invalide.';
		}else{
		    document.inputForm.email.value='Invalid email.';			
		}
    return(false);
    }
  }

function AggrandirImage(conteneur, src){
		var div = document.getElementById('aggImg');
		var img = document.getElementById(conteneur);
		img.src = '';
		
		//alert(document.body.scrollTop);
		//alert(screen.height);
		//alert(screen.availHeight);
		//alert(document.body.offsetHeight)
		
		div.style.display = 'block';
		img.src = src;
	}
	
function OuvrirOption(id){
// Calcule taille max (attention, en display none, pas de taille accessible)
var tailleMax=document.getElementById('b_'+id).offsetHeight+5;
//alert(tailleMax);
var tailleMin = 1;
var speed = 2;
var timer = 0;
         
// si le div temp est à 1px, il ouvre
if(document.getElementById('t_'+id).style.height == '1px'){
   // aggrandissement du div temporaire à la taille du div qu'il contient
   for(i = tailleMin; i <= tailleMax; i++) {
   setTimeout("document.getElementById('t_"+id+"').style.height = '"+i+"px';",(timer * speed));
   timer++;
   }
}else{
   for(i = tailleMax; i >= tailleMin; i--) {
   setTimeout("document.getElementById('t_"+id+"').style.height = '"+i+"px';",(timer * speed));
   timer++;
   }
}
}
