function menu_roll( num, type, chemin )
{
	
	puce = window.document.getElementById( 'puce' + '' + num + 'Menu'  );
	bt = window.document.getElementById( 'bt' + '' + num + 'Menu'  );

	if ( type == "out" ){
		
		bt.style.backgroundImage = 'url(' +chemin+ 'images/menu/bt' + num + '.jpg)';
		puce.style.backgroundImage = 'url(' +chemin+ 'images/menu/puce.jpg)';
		
	}else if ( type == "over" ){
		
		bt.style.backgroundImage = 'url(' +chemin+ 'images/menu/bt' + num + '_over.jpg)';
		puce.style.backgroundImage = 'url(' +chemin+ 'images/menu/puce_over.jpg)';
		
	}	

}

function masqueBol()
{
	
	bol = window.document.getElementById( 'page2'  );
	bol.style.backgroundImage = 'none';

}

function popup(){

	  window.open("../../popup_exemple.php","utiliser_les_pyramides","menubar=no, status=no, scrollbars=no, menubar=no, width=693, height=573");
}




function popupML(page){
	  window.open(page,"Mentions_legales","menubar=no, status=no, scrollbars=no, menubar=no, width=388, height=386");
}


function popupKassius(page){

	  window.open(page,"Credits","menubar=no, status=no, scrollbars=no, menubar=no, width=388, height=386");
}



function popupReglement(){

	  window.open("../popup_reglement.php","Reglement","menubar=no, status=no, scrollbars=no, menubar=no, width=388, height=386");
}

function popupReglementOp(){

	  window.open("../popup_reglementOp.php","Reglement","menubar=no, status=no, scrollbars=no, menubar=no, width=388, height=386");
}


function popupBabytreeReco(){

	  window.open("../evenements/babytree_amis.php","Babytree","menubar=no, status=no, scrollbars=no, menubar=no, width=493, height=437");
}

function popupBabytree( page, width, height){

	  window.open("../evenements/" +page+ ".php","Babytree","menubar=no, status=no, scrollbars=no, menubar=no, width="+ width +", height="+ height +"");
}

function popupReglementBabytree(){

	  window.open("../evenements/babytree_reglement.php","Reglement","menubar=no, status=no, scrollbars=no, menubar=no, width=388, height=386");
}


function popupAlert(page){

	  window.open(page,"Avertissement","menubar=no, status=no, scrollbars=no, menubar=no, width=388, height=238");
}

var inter;

function redirect() {
	inter=setInterval(redirect2, 4000);
}

function redirect2() {
	clearInterval(inter);
	window.location.href="http://www.elusanes.com";
}

function closed() {
	clearInterval(inter2);
	window.close();
}


function checkMail(adresse)
{
	
	
    var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1))
		{
				return(true);
		}
	else
		{
		setError( 'Merci de renseigner un e-mail valide' ); 
		return(false);
		}
}

function checkCP(ch)
{
	if ( ch == '' ) {
		return false;
	}
	else
	{
		if ( ch.length != 5 ) {
			return false;
		}
		
		ch = ch;
		
		for ( i = 0; i < 5; i++ )
		{  
			if ( isNaN( parseInt( ch.charAt(i) ) ) ) { 
				return false;
			}
		}
	}
	
	return true;
}


function checkBirthday(ch){
	
	   
	   if(ch ==''){
		   
			return true;
		}
	   
		else if(ch.length != 10){
			
		 	return false;
		 
		}
		else if(ch.indexOf('/') != 2 && ch.lastIndexOf('/') != 5){
			
			return false;	
		}
	    
		var jour = parseInt(ch.substr(0, 2));
		var mois = parseInt(ch.substr(3, 2));
		
		//alert(jour + mois);
		
		return true;

}


function checkPhone(ch)
{
		
	
	if ( ch == '' ) {
		return false;
	}
	/*
	else
	{
		
		var ch = ch;
		
		if ( ch.length == 10 )
		{
			if ( ch.charAt(0) == '0' )
			{
				var _2 = parseInt( ch.charAt(1) );
				
				if ( !((_2 > 0) && (_2 < 9) && (_2 != 7)) ) {
					return false;
				}
				else
				{
					for ( i = 2; i < 10; i++ )
					{ 
						if ( isNaN( parseInt( ch.charAt(i) ) ) ) { 
							return false;
						}
					}
				}
			}
			else {
				return false;
			}
		} 
		else { 
			return false;
		}
		
	}
	*/
	
	
	return true;
	
}


function writeFlash(fichier,_width,_height) {
	document.write('<object type="application/x-shockwave-flash" data="'+fichier+'" width="' +_width+ '" height="' +_height+ '">');
	document.write('	<param name="movie" value="'+fichier+'" />');
	document.write('	<param name="quality" value="high" />');
	document.write('	<param name="menu" value="false" />');
	document.write('	<param name="wmode" value="transparent" />');	
	document.write('    <param name="allowScriptAccess" value="always"/>'); //  acces aux scripts depuis un autre domaine
	document.write(' 	<embed src="'+fichier+'" quality="high" width="' +_width+ '" height="' +_height+ '" menu="false" allowScriptAccess="always" wmode="transparent"></embed>');
	document.write('</object>');	
}

//texte normal
function restrict(tel){
  	tel.value=tel.value.replace(/([^0-9 A-Za-z])/,"");
}

//date de naissance
function restrict2(tel){
  	tel.value=tel.value.replace(/([^0-9\/])/,"");
}

//email
function restrict3(tel){
  	tel.value=tel.value.replace(/([^-A-Za-z0-9!#$%&\'*+\\\/=?^_`{|}~@.])/,"");
}

//telephone
function restrict4(tel){
  	tel.value=tel.value.replace(/([^0-9+])/,"");
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

