
function ScanCookie(variable)
{
	cook=document.cookie;
	variable+="=";
	place=cook.indexOf(variable,0);
	
	if(place<=-1)
		return("0");
	else{
		end=cook.indexOf(";",place)
		if(end<=-1) return(unescape(cook.substring(place+variable.length,cook.length)));
		else return(unescape(cook.substring(place+variable.length,end)));
	}
}


function VerifForm(email)
	{
	adresse = email;
	var place = adresse.indexOf("@",1);
	var point = adresse.indexOf(".",place+1);
	if ((place > -1)&&(adresse.length >2)&&(point > 1)){
		return(true);
	}
	else{
		return(false);
	}
}

function Entrer()
{
	var aujourdhui = new Date();
	var expdate = new Date();
	expdate.setTime( aujourdhui.getTime() + ( 10*1000) );
	document.cookie="disclaimerok=oui;path=/;expires=" + expdate.toGMTString();
	if(document.getElementById) document.getElementById("disclaimer").style.display='none'
	/*top.location.href=location.href;*/
	jQuery.post(this.action, jQuery("input[sp=email]").parents("form").serialize(), null, "script");
}

function extension()
{	
	var aujourdhui = new Date();
	var expdate = new Date();
	expdate.setTime( aujourdhui.getTime() + ( 10*1000) );
	document.cookie="disclaimerok=oui;path=/;expires=" + expdate.toGMTString();
}

jQuery(document).ready(function(){
jQuery("#disclaimer-cadre form").submit(function(){
	var email = $("#email").val();
	mail_ok = VerifForm(email);
	if(!mail_ok){
		alert('Votre Email est invalide ou comporte des erreurs. Veuillez entrer un Email valide SVP');
		return false;
	}
	else{
		Entrer();
	}
	
});
});


if(ScanCookie("disclaimerok")==0)
{
document.write("<div id=disclaimer>");
	document.write("<div id=disclaimer-fond></div>");
	document.write("<div id=disclaimer-conteneur>");
		document.write("<div id=disclaimer-cadre>");
			document.write('<fieldset>');
			document.write('<form action="'+document.URL+'" method="post" id="form-catcher">');
				document.write('<p>');
					document.write('<label for="email">Pour acc&eacute;der &agrave; cette page, <br/>tapez simplement votre email :</label>');
					document.write('<input id="email" type="text" value="Votre Email ici" name="email" sp="email"/>');
				document.write('</p>');
				document.write('<p class="optin">');
					document.write('<input id="optin" type="checkbox" name="optin" sp="optin"/>');
					document.write('<label for="optin">Je souhaite &ecirc;tre inform&eacute; des nouveaut&eacute;s de<br/>www.numerologie-web.com</label>');
				document.write('</p>');
				
				document.write('<p class="submit">');
					document.write('<input type="submit" name=""></input>');
				document.write('</p>');

			document.write('</form>');
			document.write('<fieldset>');

		document.write("</div>");
	document.write("</div>");
document.write("</div>");
/*document.write('<style>embed,object,select,iframe { display:none; visibility:hidden }</style>');*/


	$('input[type="text"]').addClass("idleField");
	$('input[type="text"]').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('input[type="text"]').blur(function() {
		$(this).removeClass("focusField").addClass("idleField");
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
}