
/**   
 * Validar Formulario Accesible sin onSubmit   
 * (c) 2009 Alejandro Arco   
 * Por Alejandro Arco - http://www.alejandroarco.es   
 */   
validateForm=function() {   
   
   
    var email = new Array(document.getElementById('email'), document.frm['email'].value); 
	var acepto = new Array(document.getElementById('acepto').checked, document.frm['acepto'].checked);
    var submit = document.getElementById('submit');    
  
    /* Eventos */   
  
       
    email[0].onfocus = onFocus; email[0].onblur = onBlur;
	submit.onclick = validateFields;   
  
    /* Funciones */   	
	function onFocus() { if(document.frm[this.name].value==eval(this.name)[1]) document.frm[this.name].value='' }      
  
    function onBlur() {   
        var value = document.frm[this.name].value;   
        valuevalue = value.replace(/^\s*/, ''); valuevalue = value.replace(/\s*$/, '');   
        if(!value) document.frm[this.name].value = eval(this.name)[1]   
    }  	
	
  
    function validateFields() {   
        if(document.frm['email'].value == email[1]) { document.frm['email'].focus(); alert('Debe ingresar su Mail.'); } 
		else if(document.frm['acepto'].checked == acepto[1]) { document.frm['acepto'].focus(); alert('Debe aceptar Terminos y Condiciones.'); }    
      
        else { return true; }   
        return false;   
    }   
}   
  
if(document.all&&window.attachEvent) { window.attachEvent("onload",validateForm); } // IE-Win   
else if(window.addEventListener) { window.addEventListener("load",validateForm,false); } // Otros   