	var nCont_s = 1;
	var b = /"/g
	var s = new Array();
	var d = new Array();
	var g = new Array();
	var lFlag = false;
	var _browser = new TBrowser();
	
   fnumeros="0123456789";
   var separadorfecha="/";
   ferror= new creaferror();  
   ferrores= new Array();
  
   ferrores[1]="El  campo fecha  no contiene ningún valor ";
   ferrores[2]="Carácter ilegal en el campo fecha";
   ferrores[3]="Faltan separadores en el campo fecha";
   ferrores[4]="Año incorrecto en el campo fecha";
   ferrores[5]="Mes incorrecto en el campo fecha";
   ferrores[6]="Día incorrecto en el campo fecha";
   ferrores[7]="Carácter ilegal en una hora";
   ferrores[8]="Faltan separadores en una hora";
   ferrores[9]="Hora incorrecta en una hora";
   ferrores[10]="Minutos incorrectos en una hora";
   ferrores[11]="Segundos incorrectos en una hora";
	
	
	function clearallobjss(){
		// Reinicializa todos los objetos s
		for (var i = 0; i <= nCont_s; i++){
			s[i].nombre = "";
			s[i].appaterno = "";
			s[i].apmaterno = "";
			s[i].alias1 = "";
			s[i].alias2 = "";
			s[i].calle = "";
			s[i].noext = "";
			s[i].noint = "";
			s[i].col = "";
			s[i].delega = "";
			s[i].cpostal = "";
			s[i].entfed = "";
			s[i].edad = "";
			s[i].telefono = "";
			s[i].email = "";
			
			s[i].sexo = "";
			s[i].estatura = "";
			s[i].tipocara = "";
			s[i].complexion = "";
			s[i].tez = "";
			s[i].tipocabello = "";
			s[i].colorcabello = "";
			s[i].tipofrente	= "";
			s[i].cejas = "";
			s[i].colorojos = "";
			s[i].tiponariz = "";
			s[i].tipoboca = "";
			s[i].tipolabios = "";
			s[i].senas = "";
		}
	}


	function datformtoobjs(){
		// pasa los datos que se capturan en el formulario y se los
		// asigna a los objetos s.
		this.nombre = document.forms.nombre.value;
		this.appaterno = document.forms.appaterno.value;
		this.apmaterno = document.forms.apmaterno.value;
		this.alias1 = document.forms.alias1.value;
		this.alias2 = document.forms.alias2.value;
		this.calle = document.forms.calle.value;
		this.noext = document.forms.noext.value;
		this.noint = document.forms.noint.value;
		this.col = document.forms.col.value;
		this.delega = document.forms.delega.value;
		this.cpostal = document.forms.cpostal.value;
		this.entfed = document.forms.entfed.options[document.forms.entfed.selectedIndex].value;
		this.edad = document.forms.edad.value;
		this.telefono = document.forms.telefono.value;
		this.email = document.forms.email.value;
		
		
		this.sexo = document.forms.sexo.options[document.forms.sexo.selectedIndex].value;
		this.estatura = document.forms.estatura.options[document.forms.estatura.selectedIndex].value;
		this.tipocara = document.forms.tipocara.options[document.forms.tipocara.selectedIndex].value;
		this.complexion = document.forms.complexion.options[document.forms.complexion.selectedIndex].value;
		this.tez = document.forms.tez.options[document.forms.tez.selectedIndex].value;
		this.tipocabello = document.forms.tipocabello.options[document.forms.tipocabello.selectedIndex].value;
		this.colorcabello = document.forms.colorcabello.options[document.forms.colorcabello.selectedIndex].value;
		this.tipofrente	= document.forms.tipofrente.options[document.forms.tipofrente.selectedIndex].value;
		this.cejas = document.forms.cejas.options[document.forms.cejas.selectedIndex].value;
		this.colorojos = document.forms.colorojos.options[document.forms.colorojos.selectedIndex].value;
		this.tiponariz = document.forms.tiponariz.options[document.forms.tiponariz.selectedIndex].value;
		this.tipoboca = document.forms.tipoboca.options[document.forms.tipoboca.selectedIndex].value;
		this.tipolabios = document.forms.tipolabios.options[document.forms.tipolabios.selectedIndex].value;
		this.senas = document.forms.senas.value;
	}
	
	
	function datformtoobjq(){
		if (document.formq.tdenuncia[0].checked == true){
			g[0] = 0;
		} else {
			g[0] = 1;
		}
		g[1] = document.formq.nombre.value;
		g[2] = document.formq.appaterno.value;
		g[3] = document.formq.apmaterno.value;
		if (document.formq.nacionalidad[0].checked == true){
			g[4] = "nacional";
		} else {
			g[4] = "extranjero";
		}
		g[5] = document.formq.calle.value;
		g[6] = document.formq.noext.value;
		g[7] = document.formq.noint.value;
		g[8] = document.formq.col.value;
		g[9] = document.formq.delega2.options[document.formq.delega2.selectedIndex].value;
		g[10] = document.formq.cpostal.value;
		g[11] = document.formq.entfed2.options[document.formq.entfed2.selectedIndex].value;
		g[12] = document.formq.telpart.value;
		g[13] = document.formq.teloff.value;
		g[14] = document.formq.ext.value;
		g[15] = document.formq.telcel.value;
		
		if (document.formq.tdenuncia[0].checked == true){
			g[16] = document.formq.email2.value;
		} else {
			g[16] = document.formq.email1.value;
		}
	
		d[0] = document.formq.fecha.value;
		d[1] = document.formq.hora.value;
		d[2] = document.formq.delega1.options[document.formq.delega1.selectedIndex].value;
		d[3] = document.formq.entfed1.options[document.formq.entfed1.selectedIndex].value;
		d[4] = document.formq.lugar.value.replace(b,"''");
		d[5] = document.formq.hechos.value.replace(b,"''");
		d[6] = nCont_s;
		
	}
	
	function display(){
		var resp;
		alert("nombre:"+s[nCont_s].nombre.toString()+" indice:"+nCont_s);
		alert(document.formq.nombre.value);
	}
	
	
	function genobjss(){
                // Genera Objetos para los datos de los responsables denunciados
		s[nCont_s] = new datformtoobjs();
		
	}	
	
	function seldatformtoobjs( lFlag ){
		// Selecciona el Objeto de los probables responsables al cual se le van a asignar los
		// datos capturados en el formulario en base al contador.
		this.datformtoobjs();
	}
	

	function assigndatstoobj() {
		// asigna datos del formulario a los objetos cada que se da foco de entrada
		// a cada elemento del formulario, para que no se pierdan los datos capturados
		// si es que no seleccionan los botones para agregar mas datos. El parametro de 
		// 2 es para que no se incrementen los contadores que seleccionan el numero de objeto.
		//seldatformtoobjq( 2 );
		seldatformtoobjs( 2 );
		
	}
	
	function clearallForm() {
		// Reinicializa Todos los objetos y los formularios cuando se pulsa 
		// el boton de Limpiar Formulario.
		document.formq.reset();
		document.forms.reset();
		document.formx.reset();
		clearallobjss();
		nCont_s = 1;
		lFlag = false;
		document.formq.nombre.focus();
	}
	
	function gennewForm() {
		// Genera el codigo html de un nuevo formulario para posteriormente asignarles 
		// los datos que se asignaron a los objetos y de esta forma poderselos pasar
		// al programa cgi que los direccionara a traves del correo electronico.
		
		document.writeln('<form name="formz" action="save_predef.asp" method="post">')
		document.writeln('<input type="hidden" value="'+g[0]+'" name="tdenuncia">');
		document.writeln('<input type="hidden" value="'+g[1]+'" name="nombre">');
		document.writeln('<input type="hidden" value="'+g[2]+'" name="appaterno">');
		document.writeln('<input type="hidden" value="'+g[3]+'" name="apmaterno">');
		document.writeln('<input type="hidden" value="'+g[4]+'" name="nacionalidad">');
		document.writeln('<input type="hidden" value="'+g[5]+'" name="Calle">');
		document.writeln('<input type="hidden" value="'+g[6]+'" name="noext">');
		document.writeln('<input type="hidden" value="'+g[7]+'" name="noint">');
		document.writeln('<input type="hidden" value="'+g[8]+'" name="Col">');
		document.writeln('<input type="hidden" value="'+g[9]+'" name="Delega">');
		document.writeln('<input type="hidden" value="'+g[10]+'" name="cpostal">');
		document.writeln('<input type="hidden" value="'+g[11]+'" name="entfed">');
		document.writeln('<input type="hidden" value="'+g[12]+'" name="telpart">');
		document.writeln('<input type="hidden" value="'+g[13]+'" name="teloff">');
		document.writeln('<input type="hidden" value="'+g[14]+'" name="ext">');
		document.writeln('<input type="hidden" value="'+g[15]+'" name="telcel">');
		
		document.writeln('<input type="hidden" value="'+g[16]+'" name="email">');
	
		document.writeln('<input type="hidden" value="'+d[0]+'" name="fecha">');
		document.writeln('<input type="hidden" value="'+d[1]+'" name="hora">');
		document.writeln('<input type="hidden" value="'+d[3]+'" name="entfed1">');
		document.writeln('<input type="hidden" value="'+d[2]+'" name="delega1">');
		document.writeln('<input type="hidden" value="'+d[4]+'" name="lugar">');
		document.writeln('<input type="hidden" value="'+d[5]+'" name="hechos">');
		document.writeln('<input type="hidden" value="'+nCont_s+'" name="indice">');
		document.writeln('<input type="hidden" value="'+lFlag+'" name="lFlag">');

		for ( var j = 1; j <= nCont_s; j++ ) {
			document.write('<input type="hidden" value="'+s[j].nombre.toString()+'" name="nombre');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].appaterno.toString()+'" name="appaterno');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].apmaterno.toString()+'" name="apmaterno');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].alias1.toString()+'" name="Alias1_');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].alias2.toString()+'" name="Alias2_');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].calle.toString()+'" name="Calle');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].noext.toString()+'" name="Noext');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].noint.toString()+'" name="Noint');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].col.toString()+'" name="Col');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].delega.toString()+'" name="Delega');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].cpostal.toString()+'" name="Cpostal');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].entfed.toString()+'" name="Entfed');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].edad.toString()+'" name="Edad');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].telefono.toString()+'" name="Telefono');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].email.toString()+'" name="email');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].sexo.toString()+'" name="Sexo');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].estatura.toString()+'" name="Estatura');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tipocara.toString()+'" name="tipocara');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].complexion.toString()+'" name="Complexion');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tez.toString()+'" name="Tez');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tipocabello.toString()+'" name="Tipocabello');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].colorcabello.toString()+'" name="Colorcabello');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tipofrente.toString()+'" name="Tipofrente');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].cejas.toString()+'" name="Cejas');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].colorojos.toString()+'" name="Colorojos');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tiponariz.toString()+'" name="Tiponariz');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tipoboca.toString()+'" name="Tipoboca');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].tipolabios.toString()+'" name="Tipolabios');
			document.write(j);
			document.writeln('">');
			document.write('<input type="hidden" value="'+s[j].senas.toString()+'" name="senas');
			document.write(j);
			document.writeln('">');
		}
		document.writeln('</form>')
		document.formz.submit();
	}

	function checkformq(){
		// Verifica que se capturen los datos mínimos necesarios de los quejosos
		// para poderse enviar el correo
		
		if (document.formq.tdenuncia[0].checked == true){
			if (document.formq.nombre.value == ""){
						alert("Por favor proporcione su nombre o nombres");
						document.formq.nombre.focus();
						return false;
			} if (document.formq.appaterno.value == ""){
						alert("Por favor proporcione su primer apellido");
						document.formq.appaterno.focus();
						return false;
			} if (document.formq.apmaterno.value == ""){
						alert("Por favor proporcione su segundo apellido");
						document.formq.apmaterno.focus();
						return false;
			} if (document.formq.nacionalidad[0].checked == false && document.formq.nacionalidad[1].checked == false){
						alert("Por favor proporcione su nacionalidad");
						document.formq.nacionalidad[0].focus();
						return false;
			} 
			
			if (document.formq.cpostal.value!=null && document.formq.cpostal.value!= ""){
				if (isNaN(document.formq.cpostal.value)){
							alert("Por favor ingrese su código postal correctamente");
							document.formq.cpostal.focus();
							return false;
				}
			}
			
			if (document.formq.ext.value!=null && document.formq.ext.value!= ""){
				if (isNaN(document.formq.ext.value)){
							alert("Por favor ingrese su código postal correctamente");
							document.formq.ext.focus();
							return false;
				}
			}
			
			if (document.formq.email2.value!=null && document.formq.email2.value!= ""){
				emailStr = document.formq.email2.value;
				var checkTLD=1;
				var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
				var emailPat=/^(.+)@(.+)$/;
				var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
				var validChars="\[^\\s" + specialChars + "\]";
				var quotedUser="(\"[^\"]*\")";
				var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
				var atom=validChars + '+';
				var word="(" + atom + "|" + quotedUser + ")";
				var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
				var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
				var matchArray=emailStr.match(emailPat);
				
				if (matchArray==null) {
				
					alert("La dirección de Email es incorrecta (cheque su @ y .)");
					document.formq.email2.focus();
					return false;
				}
				
				
				
				var user=matchArray[1];
				var domain=matchArray[2];
				
				for (i=0; i<user.length; i++) {
					if (user.charCodeAt(i)>127) {
						alert("Este Nombre de usuario(username) contiene caracteres inválidos.");
						document.formq.email2.focus();
						return false;
				   }
				}
				for (i=0; i<domain.length; i++) {
				if (domain.charCodeAt(i)>127) {
				alert("Este nombre de dominio(domain name) contiene caracteres inválidos.");
				document.formq.email2.focus();
				return false;
				   }
				}
				
				if (user.match(userPat)==null) {
				
				alert("El nombre de usuario parece no ser válido.");
				document.formq.email2.focus();
				return false;
				}
				
				var IPArray=domain.match(ipDomainPat);
				if (IPArray!=null) {
				
				for (var i=1;i<=4;i++) {
				if (IPArray[i]>255) {
				alert("La dirección IP destino es inválida!");
				document.formq.email2.focus();
				return false;
				   }
				}
				//document.formq.submit();
				return false;
				}
				 
				var atomPat=new RegExp("^" + atom + "$");
				var domArr=domain.split(".");
				var len=domArr.length;
				for (i=0;i<len;i++) {
				if (domArr[i].search(atomPat)==-1) {
				alert("El nombre de dominio parece no ser válido.");
				document.formq.email2.focus();
				return false;
				   }
				}
				
				if (checkTLD && domArr[domArr.length-1].length!=2 && 
				domArr[domArr.length-1].search(knownDomsPat)==-1) {
				alert("La dirección debe terminar con un dominio conocido o dos letras " + "ciudad.");
				document.formq.email2.focus();
				return false;
				}
				
				if (len<2) {
				alert("La dirección no tiene nombre de host");
				document.formq.email2.focus();
				return false;
				}
			}
		} else {
			if (document.formq.email1.value!=null && document.formq.email1.value!= ""){
				emailStr = document.formq.email1.value;
				var checkTLD=1;
				var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
				var emailPat=/^(.+)@(.+)$/;
				var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
				var validChars="\[^\\s" + specialChars + "\]";
				var quotedUser="(\"[^\"]*\")";
				var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
				var atom=validChars + '+';
				var word="(" + atom + "|" + quotedUser + ")";
				var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
				var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
				var matchArray=emailStr.match(emailPat);
				
				if (matchArray==null) {
				
					alert("La dirección de Email es incorrecta (cheque su @ y .)");
					document.formq.email1.focus();
					return false;
				}
				
				
				
				var user=matchArray[1];
				var domain=matchArray[2];
				
				for (i=0; i<user.length; i++) {
					if (user.charCodeAt(i)>127) {
						alert("Este Nombre de usuario(username) contiene caracteres inválidos.");
						document.formq.email1.focus();
						return false;
				   }
				}
				for (i=0; i<domain.length; i++) {
				if (domain.charCodeAt(i)>127) {
				alert("Este nombre de dominio(domain name) contiene caracteres inválidos.");
				document.formq.email1.focus();
				return false;
				   }
				}
				
				if (user.match(userPat)==null) {
				
				alert("El nombre de usuario parece no ser válido.");
				document.formq.email1.focus();
				return false;
				}
				
				var IPArray=domain.match(ipDomainPat);
				if (IPArray!=null) {
				
				for (var i=1;i<=4;i++) {
				if (IPArray[i]>255) {
				alert("La dirección IP destino es inválida!");
				document.formq.email1.focus();
				return false;
				   }
				}
				//document.formq.submit();
				return false;
				}
				 
				var atomPat=new RegExp("^" + atom + "$");
				var domArr=domain.split(".");
				var len=domArr.length;
				for (i=0;i<len;i++) {
				if (domArr[i].search(atomPat)==-1) {
				alert("El nombre de dominio parece no ser válido.");
				document.formq.email1.focus();
				return false;
				   }
				}
				
				if (checkTLD && domArr[domArr.length-1].length!=2 && 
				domArr[domArr.length-1].search(knownDomsPat)==-1) {
				alert("La dirección debe terminar con un dominio conocido o dos letras " + "ciudad.");
				document.formq.email1.focus();
				return false;
				}
				
				if (len<2) {
				alert("La dirección no tiene nombre de host");
				document.formq.email1.focus();
				return false;
				}
			}
		}
		
		if (document.formq.fecha.value == ""){
			alert("Proporcione la fecha de cuando ocurrieron los hechos");
			document.formq.fecha.focus();
			return false;
		}
		
		if (document.formq.fecha.value!=null && document.formq.fecha.value!= ""){
			if ((!compruebafecha(document.formq.fecha.value,ferror))){
				alert("Introduzca el formato dd/mm/aaaa para la Fecha"); 
				document.formq.fecha.focus();
				return false;
			}
		}
		
		document.formq.hora.value = document.formq.hours.value + ":" + document.formq.minutes.value;
		
		if (document.formq.hora.value == "00:00"){
			alert("Proporcione la hora en que ocurrieron los hechos");
			document.formq.hours.focus();
			return false;
		}
		
		if (document.formq.entfed1.value == ""){
			alert("Proporcione la entidad donde ocurrieron los hechos");
			document.formq.entfed1.focus();
			return false;
		}
		
		if (document.formq.delega1.value == ""){
			alert("Proporcione la delegación o municipio donde ocurrieron los hechos");
			document.formq.delega1.focus();
			return false;
		}
		
		if (document.formq.lugar.value == ""){
			alert("Proporcione el Lugar donde ocurrieron los hechos");
			document.formq.lugar.focus();
			return false;
		}
		
		if (document.formq.hechos.value == ""){
			alert("Por favor proporcione la descripción de los hechos ocurridos");
			document.formq.hechos.focus();
			return false;
		} 
		
	return true;
	}

	function checkforms(){
		// Verifica que se capturen los datos mínimos necesarios de los 
		// probables responsables denunciados para poderse enviar el correo
		
		if (document.forms.nombre.value!=""){
			lFlag = true;
		}
		if (document.forms.appaterno.value!=""){
			lFlag = true;
		}
		if (document.forms.apmaterno.value!=""){
			lFlag = true;
		}
		if (document.forms.alias1.value!=""){
			lFlag = true;
		}
		if (document.forms.alias2.value!=""){
			lFlag = true;
		}
		if (document.forms.calle.value!=""){
			lFlag = true;
		}
		if (document.forms.noext.value!=""){
			lFlag = true;
		}
		if (document.forms.noint.value!=""){
			lFlag = true;
		}
		if (document.forms.col.value!=""){
			lFlag = true;
		}
		if (document.forms.delega.value!=""){
			lFlag = true;
		}
		if (document.forms.cpostal.value!=""){
			lFlag = true;
		}
		if (document.forms.entfed.options[document.forms.entfed.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.edad.value!=""){
			lFlag = true;
		}
		if (document.forms.telefono.value!=""){
			lFlag = true;
		}
		if (document.forms.email.value!=""){
			lFlag = true;
		}
		
		if (document.forms.sexo.options[document.forms.sexo.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.estatura.options[document.forms.estatura.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tipocara.options[document.forms.tipocara.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.complexion.options[document.forms.complexion.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tez.options[document.forms.tez.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tipocabello.options[document.forms.tipocabello.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.colorcabello.options[document.forms.colorcabello.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tipofrente.options[document.forms.tipofrente.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.cejas.options[document.forms.cejas.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.colorojos.options[document.forms.colorojos.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tiponariz.options[document.forms.tiponariz.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tipoboca.options[document.forms.tipoboca.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.tipolabios.options[document.forms.tipolabios.selectedIndex].value!=""){
			lFlag = true;
		}
		if (document.forms.senas.value!=""){
			lFlag = true;
		}
            	
		return true;
	}
	
	
	function checkformz(){
		// Verifica si el usuario esta dispuesto a ratificar su denuncia
		return true;
	}
	
	function checkallform(){
		// Verifica todas las formas antes de que se envien los datos por correo
		if (checkformq()==false){
			return false;
		}
		if (checkforms()==false){
			return false;
		}
		if (checkformz()==false){
			  return false;
		}
		return true;
	}


function TBrowser() {
this._name='';this._version='';this._os='';
}

var detect=navigator.userAgent.toLowerCase();var total,thestring;

if(checkIt('konqueror')){
_browser._name="Konqueror";_browser._os="Linux";
} else if(checkIt('safari')) _browser._name="Safari";
else if(checkIt('omniweb')) _browser._name="OmniWeb";
else if(checkIt('opera')) _browser._name="Opera";
else if(checkIt('webtv')) _browser._name="WebTV";
else if(checkIt('icab')) _browser._name="iCab";
else if(checkIt('msie')) _browser._name="IE";
else if(!checkIt('compatible')) {
_browser._name="Netscape";_browser._version=detect.charAt(8);
} else _browser._name="none";
if(_browser._version=='') _browser._version=detect.charAt(place+thestring.length);
if(_browser._os=='') {
if(checkIt('linux')) _browser._os="Linux";
else if(checkIt('x11')) _browser._os="Unix";
else if(checkIt('mac')) _browser._os="Mac";
else if(checkIt('win')) _browser._os="Windows";
else _browser._os="none";}

function checkIt(string) {
	place=detect.indexOf(string)+1;thestring=string;return place;
}

function xy_openNewWindow(URLtoOpen, windowName, windowFeatures, win_width, win_height, pos_x, pos_y){
	if (windowName == null || windowName == '' ) windowName='newwindow';
	if (win_width == null || win_width == '' ) win_width=600;
	if (win_height== null || win_height == '' ) win_height=400;		
	if (windowFeatures==null || windowFeatures == '' ) windowFeatures='toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no';
	if ( pos_x==null || pos_x == '') {
	scr_width=screen.availWidth;
	pos_x=parseInt(scr_width-win_width-10);
	}
	if (pos_y==null || pos_y=='') {
	scr_height=screen.availHeight;
	pos_y=parseInt((scr_height-win_height)/2);
	}
	options=windowFeatures+",width="+win_width+",height="+win_height+",left="+pos_x+",top="+pos_y;
	newWindow=window.open(URLtoOpen, windowName, options);
	newWindow.focus();
}


function go2URL(address,target){
	window.open(address,target);
}


function _divisibility(object)
{
	if (object == 1) {
		document.getElementById('denunciante').style.display = 'none';
		document.getElementById('anonima').style.display = 'inline';
		document.getElementById('msg1').innerHTML = "Te recomendamos proporciones la mayor información posible respecto de los hechos (día, hora, lugar, forma en que sucedieron) así como de quienes intervinieron (nombre, apodo y media filiación).";
	} else {
		document.getElementById('denunciante').style.display = 'inline';
		document.getElementById('anonima').style.display = 'none';
		document.getElementById('msg1').innerHTML = "Te recomendamos que escribas tus datos completos; asimismo, sugerimos proporciones la mayor informaci&oacute;n posible respecto de los hechos (d&iacute;a, hora, lugar, forma en que sucedieron), as&iacute; como de quienes intervienen (nombre, apodos y media filiaci&oacute;n), y de ser posible facilites una direcci&oacute;n de correo electr&oacute;nico para poder contactarte en caso de requerir mayor informaci&oacute;n y obtener &oacute;ptimos resultados.";
	}
} 


function _divisibility1()
{
	if (document.getElementById('responsable').style.display == 'none') {
		document.getElementById('responsable').style.display = 'inline';
	} else {
		document.getElementById('responsable').style.display = 'none';
	}
} 


// Crea un objeto que guarda un indice a la posición y al mensaje de ferror
function creaferror()
{
this.valor=0;
this.posicion=0;
return this
}

// Determina si un caracter es un número
function fnumero(car)
{
return (fnumeros.indexOf(car)>=0)
}

// Determina si un año es bisiesto
function bisiesto(anio) 
{
if (((anio % 4 == 0) && anio % 100 != 0) || anio % 400 == 0) 
  return true;
return false;
}

// Comprueba si una fecha es correcta
function compruebafecha(contenido,ferror)
{

var nsep=0;
// Comprobación de la sintáxis de una fecha 
for (var i=0; i<contenido.length; ++i)
  {
  var car=contenido.charAt(i);
  if (!fnumero(car)&&car!=separadorfecha)
	 {
	 ferror.valor=2;
	 ferror.posicion=i+1; 
	 return false;
	 } 
  if (car==separadorfecha)
	nsep++ 
  }
if (nsep!=2)
  {
  ferror.valor=3;
  ferror.posicion=i+1; 
  return false;
  }
// Comprobación de la semántica de una fecha
var pos1=contenido.indexOf(separadorfecha);
var dia=contenido.substring(0,pos1);
var pos2=contenido.indexOf(separadorfecha,pos1+1);
var mes=contenido.substring(pos1+1,pos2); 
var anio=contenido.substring(pos2+1,10);
if (anio<999||anio>=3000)
  {
  ferror.valor=4;
  ferror.posicion=6; 
  return false;
  } 
 if (mes<1||mes>12)
  {
  ferror.valor=5;
  ferror.posicion=4;
  return false;
  }
if ((mes==04&&dia>30)||(mes==06&&dia>30)||(dia<1 || dia>31)
	 ||(mes==09&&dia>30)||(mes==11&&dia>30)
	 ||(mes==02&&bisiesto(anio)&&dia>29)
	 ||(mes==02&&!bisiesto(anio)&&dia>28)
	 )
  {
  ferror.valor=6;
  ferror.posicion=2;
  
  return false;
  } 
return true;
}


function CamSelec() 
{
var _newLoc

	tdenuncia = document.formq.tdenuncia.value;
	
	if (document.formq.tdenuncia[0].checked) {
		nombre = document.formq.nombre.value;
		appaterno = document.formq.appaterno.value;
		apmaterno = document.formq.apmaterno.value;
		if (document.formq.nacionalidad[0].checked){
			nacionalidad = "nacional";
		} else {
			nacionalidad = "extranjero";
		}
		calle = document.formq.calle.value;
		noext = document.formq.noext.value;
		noint = document.formq.noint.value;
		col = document.formq.col.value;
		cpostal = document.formq.cpostal.value;
		entfed = document.formq.entfed2.value;
		delega = document.formq.delega2.value;
		telpart = document.formq.telpart.value;
		teloff = document.formq.teloff.value;
		ext = document.formq.ext.value;
		telcel = document.formq.telcel.value;
		email = document.formq.email2.value;
		fecha = document.formq.fecha.value;
		hours = document.formq.hours.value;
		minutes = document.formq.minutes.value;
		entfed1 = document.formq.entfed1.value;
		lugar = document.formq.lugar.value;
		hechos = document.formq.hechos.value;
		
		_newLoc = "predef1.asp?tdenuncia=0&nombre="+nombre+"&appaterno="+appaterno+"&apmaterno="+apmaterno+"&nacionalidad="+nacionalidad+"&calle="+calle+"&noext="+noext+"&noint="+noint+"&col="+col;
		_newLoc = _newLoc + "&cpostal="+cpostal+"&entfed="+entfed+"&delega="+delega+"&telpart="+telpart+"&teloff="+teloff+"&ext="+ext+"&telcel="+telcel+"&email="+email+"&fecha="+fecha;
		_newLoc = _newLoc + "&hours="+hours+"&minutes="+minutes+"&entfed1="+entfed1+"&lugar="+lugar+"&hechos="+hechos;
		
	} else {
		entfed1 = document.formq.entfed1.value;
		email = document.formq.email1.value;
		fecha = document.formq.fecha.value;
		hours = document.formq.hours.value;
		minutes = document.formq.minutes.value;
		lugar = document.formq.lugar.value;
		hechos = document.formq.hechos.value;
		
		_newLoc = "predef1.asp?tdenuncia=1&email="+email+"&fecha="+fecha+"&hours="+hours+"&minutes="+minutes+"&entfed1="+entfed1+"&lugar="+lugar+"&hechos="+hechos;
	}
		
	

document.location = _newLoc; 
}