//optin options

function openIT () {
	printWindow=window.open('pop_mailinglist.html',"_","height=250,width=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,history=no")
}
<!--printWindow=window.open("test_popup.html","_","height=250,width=600,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,history=no")-->

//function to validate by length
function validlength(item, len) {
   return (item.length >= len);
}
//function to validate an email address
function validemail(item) {
   if (!validlength(item, 5)) return false;
   if (item.indexOf ('@', 0) == -1) return false;
   return true;
}
// display an error alert
function error(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   elem.select();
   elem.focus();
   errfound = true;
}

function error2(elem, text) {
// abort if we already found an error
   if (errfound) return;
   window.alert(text);
   errfound = true;
}
// main validation function
//function validate() {
//   errfound = false;
//			if (!validemail(document.optin2.email.value))
//    			error(document.optin2.email,"pas le bon mail!");
//
//   return !errfound; /* true if there are no errors */
//}

function validate_email(email) {
	if(email.length <= 5) return false;
	if(email.indexOf('@', 0) == -1) return false;
	return true;
}

// tellafriend validation
function validate_mailinglist(f) {
	var e = new Errors();
	if(!f.firstname.value) e.adderror("Désolé, Prénom Invalide.");
	if(!f.lastname.value) e.adderror("Désolé, Nom Invalide.");
	if(!validate_email(f.email.value)) e.adderror("Désolé, Adresse Email Invalide!");
	if(f.state.selectedIndex <= 0) e.adderror("Merci de sélectionner votre Pays");

	return e.alert() ? false : true;
}


function doOnLoad2() {
	if (window.opener) {
		//alert('ouverte');
		//alert(window.opener.document.optin.email.value);
		document.optin2.email.value = window.opener.document.optin.email.value;
		document.optin2.email.focus();
	
	} else {
		document.optin2.email.value = "Votre adresse Email";
		effaced=effaced+1;
	}
}

// error class
function Errors() {
	this.errors = new Array();

	this.adderror = function(msg) {
		this.errors[this.errors.length] = msg;
	}
	this.alert = function() {
		if(!this.errors.length) return false;

		var msg = '';

		for(var i=0; i<this.errors.length; ++i) {
			msg += '*  ' + this.errors[i];
			if(i < this.errors.length - 1) msg += '\n\n';
		}

		alert(msg);
		return true;
	}
}


function validate_email(email) {
	if(email.length <= 5) return false;
	if(email.indexOf('@', 0) == -1) return false;
	return true;
}

//erase imput box content
	var effaced=0;
	function efface (elem) {
	
	if (effaced == 1 && elem.value=='Votre adresse Email'){
	
		elem.value='';
	
	}
	effaced=effaced+1;
	//alert(effaced);
}

//-->