function  votaEnc(ide,tam){
		var inpArr = document.getElementsByTagName("input");
		for (var i=0;i<inpArr.length;i++){
			if (inpArr[i].type == "radio" && inpArr[i].checked) {
				var voto = inpArr[i].value;
			}
		}
		if(!voto){
		alert("Debes seleccionar una opción para poder votar");	
		}else{
			location.href = '?op='+voto+'&ide='+ide+'&tam='+tam;	
		}
	}
function inscrib(proc,prove){
		location.href = "inscribir.php?idproc="+proc+"&idprov="+prove;
	}
function buscar(){
	var categoria, estado, fechainvi, fechacierre
	categoria = document.getElementById("categoria").value;
	estado = document.getElementById("estado").value;
	fechainvi = document.getElementById("fechainvi").value;
	fechacierre = document.getElementById("fechacierre").value;
	if(categoria != "no"){
	document.location.href = "resultados_procesos.php?categoria="+categoria;
	}
	if(estado != "no"){
	document.location.href = "resultados_procesos.php?estado="+estado;
	}
	if(categoria != "no" && estado != "no"){
	document.location.href = "resultados_procesos.php?categoria="+categoria+"&estado="+estado;
	}
	if(fechainvi != "" && fechacierre != ""){
	document.location.href = "resultados_procesos.php?fechainvi="+fechainvi+"&fechacierre="+fechacierre;
	}
	if(categoria != "no" && estado != "no" && fechainvi != "" && fechacierre != ""){
	document.location.href = "resultados_procesos.php?categoria="+categoria+"&estado="+estado+"&fechainvi="+fechainvi+"&fechacierre="+fechacierre;
	}
	if(categoria == "no" && estado == "no" && fechainvi == "" && fechacierre == ""){
	document.location.href = "procesos.php";
	}
}

function busNo(){
	var idp = document.getElementById("buscar").value;
	document.location.href = "verprocesob.php?busca="+idp;
}
function subef(idp) {
 //var opener = window.open('http://www.invitroweb.com.co/metroseg/subeFoto.php?idp='+idp,'fotos','width=500,height=300');
 var opener = window.open('../archivos/subeFoto.php?idp='+idp,'fotos','width=500,height=300');
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='?dep="+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


function carga(strURL) {
    var xmlHttpReq = false;
    var self = this;
	var dep = document.getElementById("idepartamento").value;

	// Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
	//para firfox hay que enviar expacio en blanco como argumento o genera error
    self.xmlHttpReq.send("dep="+dep);
	
	}

function updatepage(str){
		    document.getElementById("paisdepto").innerHTML = str;
}

function valida(){
		if(document.form1.razonsocial.value == ""){
			document.form1.razonsocial.focus();
		}else if(document.form1.nit.value == ""){
			document.form1.nit.focus();
		}else if(document.form1.razonsocial.value == ""){
			document.form1.razonsocial.focus();
		}else if(document.form1.replegal.value == ""){
			document.form1.replegal.focus();
		}else if(document.form1.contacto.value == ""){
			document.form1.contacto.focus();
		}else if(document.form1.cargo.value == ""){
			document.form1.cargo.focus();
		}else if(document.form1.domicilio.value == ""){
			document.form1.domicilio.focus();
		}else if(document.form1.idpais.value == "no"){
			document.form1.idpais.focus();
		}else if(document.form1.idepartamento.value == "nan"){
			document.form1.idepartamento.focus();
		}else if(document.form1.telefono.value == ""){
			document.form1.telefono.focus();
		}else if(document.form1.celular.value == ""){
			document.form1.celular.focus();
		}else if(document.form1.pagweb.value == ""){
			document.form1.pagweb.focus();
		}else if(document.form1.email.value == ""){
			document.form1.email.focus();
		}else if(document.form1.email.value.indexOf("@") < 0){
			document.form1.email.focus();
		}else{
			document.form1.submit();
		}
		
}
function valida2(){
		if(document.form1.establecimiento.value == ""){
			document.form1.establecimiento.focus();
		}else if(document.form1.cedula.value == ""){
			document.form1.cedula.focus();
		}else if(document.form1.clasificacionesp.value == ""){
			document.form1.clasificacionesp.focus();
		}else if(document.form1.nbanco.value == ""){
			document.form1.nbanco.focus();
		}else if(document.form1.nocuenta.value == "" || isNaN(document.form1.nocuenta.value)){
			document.form1.nocuenta.focus();
		}else if(document.form1.ciubanco.value == ""){
			document.form1.ciubanco.focus();
		}else if(document.form1.codact.value == ""){
			document.form1.codact.focus();
		}else if(document.form1.pass.value == "" || document.form1.pass.value.length == 0){
			document.form1.pass.focus();
		}else if(document.form1.pass2.value == "" || document.form1.pass.value != document.form1.pass2.value){
			document.form1.pass2.focus();
		}else{
			document.form1.submit();
		}
		
}

function contact(){
	
		if(document.form1.nombre.value == ""){
			document.form1.nombre.focus();
		}else if(document.form1.profesion.value == ""){
			document.form1.profesion.focus();
		}else if(document.form1.empresa.value == ""){
			document.form1.empresa.focus();
		}else if(document.form1.email.value == ""){
			document.form1.email.focus();
		}else if(document.form1.email.value.indexOf("@") < 0){
			document.form1.email.focus();
		}else if(document.form1.telefono.value == ""){
			document.form1.telefono.focus();
		}else if(document.form1.ciudad.value == ""){
			document.form1.ciudad.focus();
		}else{
			document.form1.submit();
		}
		
}

