var errorColor="#fbc311";var normalColor="#FFFFFF";function ValidationException(codigo,mensaje,campo){this.codigo=(codigo==undefined)?0:codigo;this.mensaje=(mensaje==undefined)?null:mensaje;this.campo=(campo==undefined)?null:campo}function validateElements(elementos){for(var idx=0;idx<elementos.length;idx++){var vacio=elementos[idx].getAttribute("lang");if(((vacio=="false")&&(elementos[idx].value==""))||elementos[idx].style.backgroundColor=="rgb(251, 195, 17)"){throw new ValidationException(1,"Needed: ",elementos[idx])}}}function checkForm(form){var ok;try{validateElements(form.elements);ok=true}catch(ex){ex.campo.style.backgroundColor=errorColor;ex.campo.focus();ok=false}return ok}function validateEmail(email){if(!isEmail(email.value)){email.style.backgroundColor=errorColor}else{email.style.backgroundColor=normalColor}}function validateText(e){if(e.value.length<3){e.style.backgroundColor=errorColor}else{e.style.backgroundColor=normalColor}}function validateNumber(e){if(e.value.length<1){e.style.backgroundColor=errorColor}else{e.style.backgroundColor=normalColor}}function isNumberKey(evt){var charCode=(evt.which)?evt.which:event.keyCode;if((charCode==46||charCode==8||charCode==45||charCode==47)||(charCode>=48&&charCode<=57)){return true}else{return false}}function isAlphaKey(evt){var charCode=(evt.which)?evt.which:event.keyCode;if((charCode==231||charCode==199)||(charCode==241||charCode==209)||(charCode==8||charCode==32)||((charCode>=65&&charCode<=90)||(charCode>=97&&charCode<=122))){return true}else{return false}}function isEmail(valor){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){return(true)}else{return false}}

