function check_email(e) {

	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){ 
			return (false);
		}	
	} 

	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
		return (-1);		
		} 
	}

}


function validar_datos() {
	if (document.form1.nombre.value=="" || document.form1.email.value=="" ) {
		alert ("All fields are required");	 }
	else if(!check_email(document.form1.email.value)){
		alert("The email address is wrong");
		document.form1.email.focus(); 
		if(document.all || document.getElementByID){
			document.form1.email.style.background = "yellow";
		}
	}
	else if(document.form1.aceptacion.value == "NO"){
		alert("Need that you are 18 years or older and accept the terms and conditions of billing.");
		document.form1.aceptacion.focus(); 
	}
	else {
		document.form1.submit(); }
}

