function onLoadScript() {
	if(document.getElementById('masque'))
		document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';	
		
	if(document.getElementById('preVideoMasque'))
		document.getElementById('preVideoMasque').style.height=document.documentElement.scrollHeight + 'px';
		
	if(document.getElementById('dissuasion'))
		setTimeout("ShowDissuasion()",2000);
			
	
}

document.getElementsByClassName = function(cl) {
	var retnode = [];
	var myclass = new RegExp('\\b'+cl+'\\b');
	var elem = this.getElementsByTagName('*');
	for (var i = 0; i < elem.length; i++) {
		var classes = elem[i].className;
		if (myclass.test(classes)) retnode.push(elem[i]);
	}
	return retnode;
}

function ShowFormIdent(){
	document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';
	document.getElementById('masque').style.display='block';
	
	document.getElementById('identification').style.display='block';
	if(document.getElementById('popFormLogin'))
		document.getElementById('popFormLogin').login.focus();
		
	document.getElementById('promo2').style.display='block';//document.getElementById('promo').style.display='block';
	document.getElementById('promo2').style.top ='35%';
	
	window.scroll(0,0);
	
}

function HideFormIdent(){
	document.getElementById('masque').style.display='none';
	document.getElementById('identification').style.display='none';
	document.getElementById('promo2').style.display='none';//document.getElementById('promo').style.display='none';
	
}

function ShowSimpleFormIdent(){
	document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';
	document.getElementById('masque').style.display='block';
	
	document.getElementById('identification').style.display='block';
	if(document.getElementById('popFormLogin'))
		document.getElementById('popFormLogin').login.focus();
	
	window.scroll(0,0);
}

function HideSimpleFormIdent(){
	document.getElementById('masque').style.display='none';
	document.getElementById('identification').style.display='none';
	document.getElementById('promo2').style.display='none';//document.getElementById('promo').style.display='none';
	
}



function ShowMsgExp(){
	document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';
	document.getElementById('masque').style.display='block';
	document.getElementById('expiration').style.display='block';
	
	window.scroll(0,0);
}

function HideMsgExp(){
	document.getElementById('masque').style.display='none';
	document.getElementById('expiration').style.display='none';
}

function ShowFormIns(){
	document.getElementById('masque').style.display='block';
	document.getElementById('identification').style.display='none';
	document.getElementById('promo').style.display='none';
	document.getElementById('inscription').style.display='block';
	
	
	window.scroll(0,0);
}

function HideFormIns(){
	document.getElementById('masque').style.display='none';
	document.getElementById('inscription').style.display='none';
}

function HideMsgConf(){
	document.getElementById('masque').style.display='none';
	document.getElementById('confirmation').style.display='none';
}

function ShowRecup(){
	document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';
	document.getElementById('masque').style.display='block';
	document.getElementById('recuperation').style.display='block';
	
	window.scroll(0,0);
}

function HideRecup(){
	document.getElementById('masque').style.display='none';
	
	if(document.getElementById('recuperation'))
		document.getElementById('recuperation').style.display='none';
	if(document.getElementById('confirmationRecuperation'))
		document.getElementById('confirmationRecuperation').style.display='none';
	
}

/* Affiche le formulaire de choix d'inscription */
function ShowPromo2(){
	document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';
	document.getElementById('masque').style.display='block';
	document.getElementById('promo2').style.display='block';
	document.getElementById('promo2').style.top ='5%';
	//alert(document.getElementById('promo2').style.top);
}

/* Masque le formulaire de choix d'inscription */
function HidePromo2(){
	document.getElementById('masque').style.display='none';
	document.getElementById('promo2').style.display='none';
}

function ShowDissuasion(){
	document.getElementById('masque').style.height=document.documentElement.scrollHeight + 'px';
	document.getElementById('masque').style.display='block';
	document.getElementById('dissuasion').style.display='block';
	document.getElementById('dissuasion').style.top ='5%';
	
}

function Valide_popFormLogin() {
	var myForm = document.getElementById('popFormLogin');
	if(myForm.login.value == '' || myForm.mdp.value == ''){
		alert('Données incomplètes !');
		return false;
	}
	else
		return true;
}

function Valide_popFormInscription(){
	var myForm = document.getElementById('popFormInscription');
	
	if(myForm.email.value==''){
		alert('Email invalide');
		myForm.email.focus();
		return false;
	}
	else if(myForm.mdp.value=='' || myForm.mdp.value.lenght<6){
		alert('mot de passe invalide');
		myForm.mdp.focus();
		return false;
	}
	else if(myForm.mdp.value != '' && myForm.mdp2.value != myForm.mdp.value){
		alert('Vous avez saisi 2 mots de passes différents');
		myForm.mdp2.value='';
		myForm.mdp.select();
		myForm.mdp.focus();
		return false;
	}
	else
		return true;
	
}
