function onValid(){
	document.forms["formInscription"].action.value = "inscription";
	document.forms["formInscription"].submit();	
}

function getWindowHeight() {
    var h = 0;
    if (typeof(window.innerHeight) == 'number') { // Netscape
        h = window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        h = document.documentElement.clientHeight;
    } else if (document.body && document.body.offsetHeight) { //client
        h = document.body.offsetHeight;
    }
    return h;
}

function getWindowWidth() {
    var w = 0;
    if (typeof(window.innerWidth) == 'number') { // Netscape
        w = window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) {
        w = document.documentElement.clientWidth;
    } else if (document.body && document.body.offsetWidth) { //client
        w = document.body.offsetWidth;
    }
    return w;
}


if(navigator.appVersion.indexOf("MSIE 6", 0) > 0)
		bIE6 = true;
	
if (nErreur > 0 || 0 > nErreurInscription || 0 > nParrain){
	//document.getElementById("div-erreur").style.display = "block";
	
	//si IE6 , on pose une iframe pour cacher les select box.
	if(bIE6){
		document.write("<iframe style='z-index:4;position:absolute;height:400px;width:600px;filter:alpha(opacity=0);' id='iframeinscription' frameborder='0' scrolling='no' src='about:blank'></iframe>");
		document.getElementById("iframeinscription").style.left = ( ( getWindowWidth()/2 ) - 300)   + 'px';
		document.getElementById("iframeinscription").style.top = ( ( getWindowHeight()/2 ) - 200)   + 'px';
		document.getElementById("iframeinscription").style.display = "block";			
	}	
			
	//affichons les erreurs dans une boite Photoweb
	afficheCache();
	document.getElementById("erreur_contenu").innerHTML = "<br/>" + sListeErreur + '<br/>';		
	
	//positionnons le controle au centre du site(ou de l'ecran)
	document.getElementById("controle_form").style.left = ( ( getWindowWidth()/2 ) - 200)   + 'px';
	document.getElementById("controle_form").style.top = ( ( getWindowHeight()/2 ) - 100)   + 'px';
	document.getElementById("controle_form").style.display = "block";

	//document.getElementById("contenu-erreur").innerHTML = "L'inscription a &eacute;chou&eacute; : <br/>" + sListeErreur;
	//document.getElementById("div-erreur").style.display = "block";	
}

if(nParrain==1 || nParrain==-1){
	//augmentons la hauteur pour IE
	document.getElementById("corps").style.height = "750px";
}
	
	
	
	function isEmail(email){
		var patternEmail = new RegExp("[A-Za-z0-9_\.\-][A-Za-z0-9_\.\-]*@[A-Za-z0-9_\.\-][A-Za-z0-9_\.\-]*.[A-Za-z0-9_\.\-][A-Za-z0-9_\.\-]*");
		
		if(patternEmail.test(email))
			return true;	
		else{
			return false;
		}
	}
	
	function afficheCache(){
		// fonction d'affichage du calque "cache" qui se superpose a la page.
		var elt;
		
		elt = document.getElementById("cache");
		
		elt.style.width = getWindowWidth() + 'px';
		elt.style.height = (getWindowHeight() + 500) + 'px';  //prevoyons l'eventuel scroll
		elt.style.top = "0px";
		elt.style.left = "0px";
		elt.style.background = "#CCCCCC";
		
		elt.style.display = "block";	
	}
	
	function closeCache(){
		//fermeture du calque qui cache la page
		document.getElementById("cache").style.display = "none";
	}
	
	function doHideControlForm(){
		document.getElementById("controle_form").style.display = "none";
		if(bIE6)
			document.getElementById("iframeinscription").style.display = "none";
		closeCache()
	}

// fonction d'affichage du calque des conditions générales de vente

function GetConditions()
	{
		AfficheCache();
		document.getElementById('div-condition-generale').style.display = 'block';
		
		var nLeft = document.getElementById("site").offsetLeft + $("#site").innerWidth() - $("#div-condition-generale").innerWidth();
		$("#div-condition-generale").css("left", nLeft + "px");
	}
	
	function HideConditions()
	{
		CloseCache();
		document.getElementById('div-condition-generale').style.display = 'none';
	}
