/* Validate.js, version 1.0.2
*  (c) 2006 achraf bouyakhsass <mutation[at]mutationevent.com>
* 
*  This software is licensed under the CC-GNU GPL
*  http://creativecommons.org/licenses/GPL/2.0/
*
*  For more details
*  http://www.mutationevent.com/project/validate.js
*
*  Package to validate various data :
*  isEqual
*  hasValidChars
*  isSimpleIP
*  isAlphaLatin
*  isNotEmpty
*  isIntegerInRange
*  isNum
*  isEMailAddr
*  isZipCode
*  isDate
*  isMD5
*  isURL
*  isGuid
*  isISBN
*  isSSN
*  isDecimal
*  isplatform
*  addRules
*  Apply
/*--------------------------------------------------------------------------*/
var Class = {
	create: function() {
		return function() {
			this.initialize.apply(this, arguments);
		}
	}
}

function getValue(s){return document.getElementById(s).value}

var Validate = Class.create();
Validate.prototype = {
	/*--------------------------------------------------------------------------*/
	initialize:function(){
		this.error_array = []
		this.rules_array = [];
		this.e = true;
	},
	/*--------------------------------------------------------------------------*/
	isEqual:function(string1, string2){
		if(string1 == string2) return true;
		else return false;
	},
	/*--------------------------------------------------------------------------*/
	hasValidChars:function(s, characters, caseSensitive){
		function escapeSpecials(s){
			return s.replace(new RegExp("([\\\\-])", "g"), "\\$1");
		}
		return new RegExp("^[" + escapeSpecials(characters) + "]+$",(!caseSensitive ? "i" : "")).test(s);
	},
	/*--------------------------------------------------------------------------*/
	isSimpleIP:function(ip){
		ipRegExp = /^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$/
		return ipRegExp.test(ip);
	},
	/*--------------------------------------------------------------------------*/
	isAlphaLatin:function(string){
		alphaRegExp = /^[0-9a-z]+$/i
		return alphaRegExp.test(string);
	},
	/*--------------------------------------------------------------------------*/
	isNotEmpty:function (string){
		return /\S/.test(string);
	},
	/*--------------------------------------------------------------------------*/
	isEmpty:function(s){
		return !/\S/.test(s);
	},
	/*--------------------------------------------------------------------------*/
	isIntegerInRange:function(n,Nmin,Nmax){
		var num = Number(n);
		if(isNaN(num)){
			return false;
		}
		if(num != Math.round(num)){
			return false;
		}
		return (num >= Nmin && num <= Nmax);
	},
	/*--------------------------------------------------------------------------*/
	isNum:function(number){
		numRegExp = /^[0-9]+$/
		return numRegExp.test(number);
	},
	/*--------------------------------------------------------------------------*/
	isEMailAddr:function(string){
		emailRegExp = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/
		return emailRegExp.test(string);
	},
	/*--------------------------------------------------------------------------*/
	isZipCode:function(zipcode,country){
		if(!zipcode) return false;
		if(!country) format = 'US';
		switch(country){
			case'US': zpcRegExp = /^\d{5}$|^\d{5}-\d{4}$/; break;
			case'MA': zpcRegExp = /^\d{5}$/; break;
			case'CA': zpcRegExp = /^[A-Z]\d[A-Z] \d[A-Z]\d$/; break;
			case'DU': zpcRegExp = /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/; break;
			case'FR': zpcRegExp = /^\d{5}$/; break;
			case'Monaco':zpcRegExp = /^(MC-)\d{5}$/; break;
		}
		return zpcRegExp.test(zipcode);
	},
	/*--------------------------------------------------------------------------*/
	isDate:function(date,format){
		if(!date) return false;
		if(!format) format = 'FR';
		
		switch(format){
			case'FR': RegExpformat = /^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/([2][0]|[1][9])\d{2})$/; break;
			case'US': RegExpformat = /^([2][0]|[1][9])\d{2}\-([0]\d|[1][0-2])\-([0-2]\d|[3][0-1])$/; break;
			case'SHORTFR': RegExpformat = /^([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/\d{2}$/; break;
			case'SHORTUS': RegExpformat = /^\d{2}\-([0]\d|[1][0-2])\-([0-2]\d|[3][0-1])$/; break;
			case'dd MMM yyyy':RegExpformat = /^([0-2]\d|[3][0-1])\s(Jan(vier)?|FâˆšÂ©v(rier)?|Mars|Avr(il)?|Mai|Juin|Juil(let)?|Aout|Sep(tembre)?|Oct(obre)?|Nov(ember)?|Dec(embre)?)\s([2][0]|[1][19])\d{2}$/; break;
			case'MMM dd, yyyy':RegExpformat = /^(J(anuary|u(ne|ly))|February|Ma(rch|y)|A(pril|ugust)|(((Sept|Nov|Dec)em)|Octo)ber)\s([0-2]\d|[3][0-1])\,\s([2][0]|[1][9])\d{2}$/; break;
		}
		
		return RegExpformat.test(date);
	},
	/*--------------------------------------------------------------------------*/
	isMD5:function(string){
		if(!string) return false;
		md5RegExp = /^[a-f0-9]{32}$/;
		return md5RegExp.test(string);
	},
	/*--------------------------------------------------------------------------*/
	isURL:function(string){
		if(!string) return false;
		string = string.toLowerCase();
		urlRegExp = /^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/
		return urlRegExp.test(string);
	},
	/*--------------------------------------------------------------------------*/
	isGuid:function(guid){//guid format : xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx or xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
		if(!guid) return false;
		GuidRegExp = /^[{|\(]?[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}[\)|}]?$/
		return GuidRegExp.test(guid);
	},
	/*--------------------------------------------------------------------------*/
	isISBN:function(number){
		if(!number) return false;
		ISBNRegExp = /ISBN\x20(?=.{13}$)\d{1,5}([- ])\d{1,7}\1\d{1,6}\1(\d|X)$/
		return ISBNRegExp.test(number);
	},
	/*--------------------------------------------------------------------------*/
	isSSN:function(number){//Social Security Number format : NNN-NN-NNNN
		if(!number) return false;
		ssnRegExp = /^\d{3}-\d{2}-\d{4}$/
		return ssnRegExp.test(number);
	},
	/*--------------------------------------------------------------------------*/
	isDecimal:function(number){// positive or negative decimal
		if(!number) return false;
		decimalRegExp = /^-?(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/
		return decimalRegExp.test(number);
	},
	/*--------------------------------------------------------------------------*/
	isplatform:function(platform){
		//win, mac, nix
		if(!platform) return false;
		var os;
		winRegExp = /\win/i
		if(winRegExp.test(window.navigator.platform)) os = 'win';
		
		macRegExp = /\mac/i
		if(macRegExp.test(window.navigator.platform)) os = 'mac';
		
		nixRegExp = /\unix|\linux|\sun/i
		if(nixRegExp.test(window.navigator.platform)) os = 'nix';
		
		if(platform == os) return true;
		else return false;
	},
	/*--------------------------------------------------------------------------*/
	getValue:function(id){
		document.getElementById(id).value;
	},
	/*--------------------------------------------------------------------------*/
	addRules:function(rules){
		this.rules_array.push(rules);
	},
	/*--------------------------------------------------------------------------*/
	check:function(){
		this.error_array = [];
		this.e = true;
		for(var i=0;i<this.rules_array.length;i++){
			switch(this.rules_array[i].option){
				/*--------------------------------------------------------------------------*/
				case'ValidChars':
					if(!this.hasValidChars(getValue(this.rules_array[i].id),this.rules_array[i].chars,false)){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'AlphaLatin':
					if (this.isAlphaLatin(getValue(this.rules_array[i].id))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'required':
					if (this.isEmpty(getValue(this.rules_array[i].id))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'integerRange':
					if (!this.isIntegerInRange(getValue(this.rules_array[i].id),this.rules_array[i].Min,this.rules_array[i].Max)){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'Number':
					if (!this.isNum(getValue(this.rules_array[i].id))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'email':
					if (!this.isEMailAddr(getValue(this.rules_array[i].id))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'zipCode':
					if (!this.isZipCode(getValue(this.rules_array[i].id),this.rules_array[i].country)){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'date':
					if(!this.isDate(getValue(this.rules_array[i].id),this.rules_array[i].format)){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'url':
					if(!this.isURL(getValue(this.rules_array[i].id))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'Decimal':
					if(!this.isDecimal(getValue(this.rules_array[i].id))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
				case'isEqual':
					if(!this.isEqual(getValue(this.rules_array[i].id),getValue(this.rules_array[i].to))){
						this.error_array.push(this.rules_array[i].error);
						this.e = false;
					}
				break;
				/*--------------------------------------------------------------------------*/
			}
		}
	},
	/*--------------------------------------------------------------------------*/
	Apply:function(el){
		this.check();
		if(this.e){
			return true;
		}else{
			var endMsg = this.error_array;
			if(!el){
				alert(this.error_array.toString().replace(/\,/gi,"\n"));
			}else{
				document.getElementById(el).innerHTML = this.error_array.toString().replace(/\,/gi,"<br/>");
			}
			return false;
		}
	}
	/*--------------------------------------------------------------------------*/
}






/*-------PROPONENTES----------------------------------------------------*/


function validar_prop2( form ){
//	activar_VentanaEspera();
	var err = 0;
	if (form._razon.value.length < 1){
		mostrarError('valRazon','');
		err++;
	}
	else{
		mostrarError('valRazon','none');
	}
		
	if(form._nit.value.length < 1){
		mostrarError('valNit','');
		err++;
		}
	else{
		mostrarError('valNit','none');
	}

	if(err == 0){
		return true;
	}
	else{
		return false;		
	}

	}

/**
 * valida los datos del forumlario de escaneo documentos
 * @param form recibe el objeto formulario
 * @param radicacion recibe el numero de radicacion a tramitar
 * @return boolean true si esta correcto, false caso contrario
 */
function valFormImagen( form, radicacion ){
//	activar_VentanaEspera();
	//verFormulario(form);
	var err = 0;
	var myForm = new Validate();
	myForm.addRules({id:'_identificacion',option:'required',error:'El campo identifición es obligatorio.'});	
	//myForm.addRules({id:'_identificacion',option:'integerRange',Min:'1',Max:'9999999999999999999999',error:'El campo debe ser maximo de 22 caracteres.'});
	myForm.addRules({id:'_idtipodoc',option:'required',error:'Este campo es obligatorio.'});
	myForm.addRules({id:'_fechadoc',option:'required',error:'La fecha de documentación es obligatoria.'});
	
	myForm.addRules({id:'_txtorigendoc',option:'required',error:'El texto origen del documento es obligatorio.'});
	
	//myForm.Apply('error_div');
	myForm.Apply();
	
	if (form._fechadoc.value.length < 1){
		mostrarError('Empty_fechadoc','');
		err++;
	}
	else{
		mostrarError('Empty_fechadoc','none');
	}

	if (form._txtorigendoc.value.length < 1){
		mostrarError('Empty_txtorigendoc','');
		err++;
	}
	else{
		mostrarError('Empty_txtorigendoc','none');
	}

	if(err == 0){
		// valida que exista una imagen y dependiendo la bandera actualiza el regsitro
		if ( emptyImage() == true ){
			if(flag == "update"){
				sendRequestGet(true,radicacion, "update");
			}else{
				sendRequestGet(true,radicacion,  "insert");
				}															
			return true;
		}else{ 
			return false;
		}		
		//UploadClick();
		return true;
	}
	else{
		return false;		
	}

	}
	
function validaFormPlaceToPay(form){
	var err = 0;
	var myForm = new Validate();	
	myForm.addRules({id:'_identificacion',option:'required',error:"-El número de identificación del pagador es requerido."});
	myForm.addRules({id:'_nombrepagador',option:'required',error:"-El nombre del pagador es requerido."});
	myForm.addRules({id:'_municipio',option:'required',error:"-La ciudad de origen del pagador es requerida."});
	myForm.addRules({id:'_direccion',option:'required',error:"-La dirección de residencia del pagador es requerida."});
	myForm.addRules({id:'_telefono',option:'required',error:"-El teléfono del pagador es requerido."});
	myForm.addRules({id:'_email',option:'required',error:"-El mail del pagador es requerido."});
	myForm.addRules({id:'_email',option:'email',error:"-Debe Ingresar una dirección de correo valida."});
	myForm.Apply();
	//IDENTIFICACION
	if (!myForm.isNotEmpty(form._identificacion.value)) {
		mostrarError('Empty_identificacion', '');
		err++;
	}
	else mostrarError('Empty_identificacion', 'none');
	
	//NOMBRE
	if (!myForm.isNotEmpty(form._nombrepagador.value)) {
		mostrarError('Empty_nombrepagador', '');
		err++;
	}else mostrarError('Empty_nombrepagador', 'none');
	// CIUDAD
	if (!myForm.isNotEmpty(form._municipio.value)) {
		mostrarError('Empty_municipio', '');
		document.getElementById('Empty_municipio').focus();
		err++;
	}else mostrarError('Empty_municipio', 'none');
	// DIRECCCION
	if (!myForm.isNotEmpty(form._direccion.value)) {
		mostrarError('Empty_direccion', '');
		err++;
	}else mostrarError('Empty_direccion', 'none');
	// TELEFONO
	if (!myForm.isNotEmpty(form._telefono.value)) {
		mostrarError('Empty_telefono', '');
		err++;
	}else mostrarError('Empty_telefono', 'none');
	// EMAIL
	if (!myForm.isNotEmpty(form._email.value)) {
		mostrarError('Empty_email', '');
		err++;
	}
	else {
		mostrarError('Empty_email', 'none');
		// TELEFONO
		if (!myForm.isEMailAddr(form._email.value)) {
			mostrarError('isEMailAddr_email', '');
			err++;
		}else mostrarError('isEMailAddr_email', 'none');
	}
	
	
	
	if(err > 0){
		return false;
	}else{
		form.submit();
		return true;
	}
	
	
	
}	

function validaFormPlaceToPay2(form){
	var err = 0;
	var myForm = new Validate();	
	myForm.addRules({id:'_identificacioncliente',option:'required',error:"-El número de identificación del pagador es requerido."});
	myForm.addRules({id:'_nombrecliente',option:'required',error:"-El nombre del pagador es requerido."});
	myForm.addRules({id:'_idmunicipio',option:'required',error:"-La ciudad de origen del pagador es requerida."});
	myForm.addRules({id:'_direccion',option:'required',error:"-La dirección de residencia del pagador es requerida."});
	myForm.addRules({id:'_telefono',option:'required',error:"-El teléfono del pagador es requerido."});
	myForm.addRules({id:'_email',option:'required',error:"-El mail del pagador es requerido."});
	myForm.addRules({id:'_email',option:'email',error:"-Debe Ingresar una dirección de correo valida."});
	myForm.Apply();
	
	var municipio = document.getElementById('_idmunicipio').value;
	//IDENTIFICACION
	if (!myForm.isNotEmpty(form._identificacioncliente.value)) {
		mostrarError('Empty_identificacion', '');
		err++;
	}
	else mostrarError('Empty_identificacion', 'none');
	
	//NOMBRE
	if (!myForm.isNotEmpty(form._nombrecliente.value)) {
		mostrarError('Empty_nombrepagador', '');
		err++;
	}else mostrarError('Empty_nombrepagador', 'none');
	// CIUDAD
	if (!myForm.isNotEmpty(form._idmunicipio.value)) {
		mostrarError('Empty_municipio', '');
		document.getElementById('_idmunicipio').value = "Escriba las 3 primeras letras y espere el resultado";
		document.getElementById('Empty_municipio').focus();		
		err++;
	}else if(municipio.search("Escriba") != -1){
		mostrarError('Empty_municipio', '');
		document.getElementById('_idmunicipio').value = "Escriba las 3 primeras letras y espere el resultado";
		document.getElementById('Empty_municipio').focus();
		err++;
	}else{		
		mostrarError('Empty_municipio', 'none');
	}
	// DIRECCCION
	if (!myForm.isNotEmpty(form._direccion.value)) {
		mostrarError('Empty_direccion', '');
		err++;
	}else mostrarError('Empty_direccion', 'none');
	// TELEFONO
	if (!myForm.isNotEmpty(form._telefono.value)) {
		mostrarError('Empty_telefono', '');
		err++;
	}else mostrarError('Empty_telefono', 'none');
	// EMAIL
	if (!myForm.isNotEmpty(form._email.value)) {
		mostrarError('Empty_email', '');
		err++;
	}
	else {
		mostrarError('Empty_email', 'none');
		// TELEFONO
		if (!myForm.isEMailAddr(form._email.value)) {
			mostrarError('isEMailAddr_email', '');
			err++;
		}else mostrarError('isEMailAddr_email', 'none');
	}
	if(err > 0){
		return false;
	}else{
		form.submit();
		return true;
	}
}	


function validaFormBusquedaPlaceToPay(form){
	
	var err = 0;
	
	var myForm = new Validate();
	
	myForm.addRules({id:'_identificacion',option:'required',error:"-El número de identificación del pagador es requerido."});
	myForm.addRules({id:'_email',option:'required',error:"-El mail del pagador es requerido."});
	myForm.addRules({id:'_email',option:'email',error:"-Debe Ingresar una dirección de correo valida."});
	myForm.Apply();
	
	
	//IDENTIFICACION
	if (!myForm.isNotEmpty(form._identificacion.value)) {
		mostrarError('Empty_identificacion', '');
		err++;
	}
	else mostrarError('Empty_identificacion', 'none');
	
	// EMAIL
	if (!myForm.isNotEmpty(form._email.value)) {
		mostrarError('Empty_email', '');
		err++;
	}
	else {
		mostrarError('Empty_email', 'none');
		// EMAIL
		if (!myForm.isEMailAddr(form._email.value)) {
			mostrarError('isEMailAddr_email', '');
			err++;
		}else mostrarError('isEMailAddr_email', 'none');
	}
	if(err > 0){
		return false;
	}else{
		form.submit();
		return true;
	}
	

}



function mostrarError(control, propiedad){
	document.getElementById(control).style.display =  propiedad;
	return(true);
	}  
	
	
function validaFormTipoTramite(){
	frm = document.formtt;
	winEnd.close();
	for(i = 0; i < frm.elements.length; i++ ){
		if(frm.elements[i].checked){
			alert(  frm.elements[i].value  );
			winEnd.close();
		}
	}

	//alert(document.getElementById('_tipotramite').value);
}


function validarFormDevolutivosREE(){
	//alert("entro");
	var myForm = new Validate();
	myForm.addRules({id:'_devolutivo',option:'required',error:"Debe ingresar el texto por el cual va a devolver el reporte."});
	myForm.addRules({id:'_email',option:'required',error:"la dirección de correo es requerida." });
	myForm.addRules({id:'_email',option:'email',error:"La dirección de correo no tiene un formato valido." });
	
	var rta =  myForm.Apply();
	
	if(rta == true){
		if(confirm("¿Esta seguro que desea devolver este reporte?")){
			activar_VentanaEspera();
			return true;
		}else{ 
			return false;
		}
	}else{
		return false;
	}
	

}



function validaFormSincronizaRenovacionTarifas(form){
	
	var err = 0;
	
	var myForm = new Validate();
	
	myForm.addRules({id:'_fechainicio',option:'required',error:"-La fecha inicial es un dato requerido."});
	myForm.addRules({id:'_fechafin',option:'required',error:"-La fecha final es un dato requerido."});
	myForm.Apply();
	
	
	//FECHA DE INICIO
	if (!myForm.isNotEmpty(form._fechainicio.value)) {
		mostrarError('Empty_fechainicio', '');
		err++;
	}
	else mostrarError('Empty_fechainicio', 'none');
	
	// FECHA FINAL
	if (!myForm.isNotEmpty(form._fechafin.value)) {
		mostrarError('Empty_fechafin', '');
		err++;
	}
	else {
		mostrarError('Empty_fechafin', 'none');
	}
	if(err > 0){
		return false;
	}else{
		form.submit();
		return true;
	}
	

}

function validaFormPagosOnline(form){
	
	var err = 0;
	var myForm = new Validate();	
	var municipio = document.getElementById('_idmunicipio').value;
	
	myForm.addRules({id:'_identificacioncliente',option:'required',error:"-El número de identificación del pagador es requerido."});
	myForm.addRules({id:'_nombrecliente',option:'required',error:"-El nombre del pagador es requerido."});
	myForm.addRules({id:'_idmunicipio',option:'required',error:"-La ciudad de origen del pagador es requerida."});
	myForm.addRules({id:'_direccion',option:'required',error:"-La dirección de residencia del pagador es requerida."});
	myForm.addRules({id:'_telefono',option:'required',error:"-El teléfono del pagador es requerido."});
	myForm.addRules({id:'_email',option:'required',error:"-El mail del pagador es requerido."});
	myForm.addRules({id:'_email',option:'email',error:"-Debe Ingresar una dirección de correo valida."});
	myForm.Apply();
	
	var municipio = document.getElementById('_idmunicipio').value;
	//IDENTIFICACION
	if (!myForm.isNotEmpty(form._identificacioncliente.value)) {
		mostrarError('Empty_identificacion', '');
		err++;
	}
	else mostrarError('Empty_identificacion', 'none');
	
	//NOMBRE
	if (!myForm.isNotEmpty(form._nombrecliente.value)) {
		mostrarError('Empty_nombrepagador', '');
		err++;
	}else mostrarError('Empty_nombrepagador', 'none');
	// CIUDAD
	if (!myForm.isNotEmpty(form._idmunicipio.value)) {
		mostrarError('Empty_municipio', '');
		document.getElementById('_idmunicipio').value = "Escriba las 3 primeras letras y espere el resultado";
		document.getElementById('Empty_municipio').focus();		
		err++;
	}else if(municipio.search("Escriba") != -1){
		mostrarError('Empty_municipio', '');
		document.getElementById('_idmunicipio').value = "Escriba las 3 primeras letras y espere el resultado";
		document.getElementById('Empty_municipio').focus();
		err++;
	}else{		
		mostrarError('Empty_municipio', 'none');
	}
	// DIRECCCION
	if (!myForm.isNotEmpty(form._direccion.value)) {
		mostrarError('Empty_direccion', '');
		err++;
	}else mostrarError('Empty_direccion', 'none');
	// TELEFONO
	if (!myForm.isNotEmpty(form._telefono.value)) {
		mostrarError('Empty_telefono', '');
		err++;
	}else mostrarError('Empty_telefono', 'none');
	// EMAIL
	if (!myForm.isNotEmpty(form._email.value)) {
		mostrarError('Empty_email', '');
		err++;
	}
	else {
		mostrarError('Empty_email', 'none');
		// TELEFONO
		if (!myForm.isEMailAddr(form._email.value)) {
			mostrarError('isEMailAddr_email', '');
			err++;
		}else mostrarError('isEMailAddr_email', 'none');
	}
	
	
	if(err > 0){
		return false;
	}else{
		document.getElementById('btn1').style.display = "";
		//document.getElementById("btn1").visible = disabled;;
		form.submit();
		return true;
	}
	
}



