function actualizar_colegiado(){ 
  mail=document.getElementById('txtCorreo1').value;
   depa=document.getElementById('cboDepa').value;
    prov=document.getElementById('cboprovincia').value;
    dist=document.getElementById('cbodistrito').value;
    telefono=document.getElementById('txtTlfnfijo').value;
    celular=document.getElementById('txtTlfnMovil').value;
    direccion=document.getElementById('txtDireccion').value;
    ecivil=document.getElementById('txtEstCivil').value;
    sexo=document.getElementById('CboSexo').value;
    fechanac=document.getElementById('txtFechaNac').value ;
    cip=document.getElementById('hdnCIPcolegiado').value ;
   
	if(confirm('Ud. desea actualizar estos datos?')==true) {
	  url='Ccontrol/Ccontrol.php';
		data='accion=actualizar_colegiado&email='+mail+'&ubigeo='+(depa+prov+dist)+'&direccion='+direccion+'&ecivil='+ecivil+'&sexo='+sexo+'&fechanac='+fechanac+'&celular='+celular+'&telefono='+telefono+'&cip='+cip;
		myajax.Request({
				 url: url,
				 param: data,
					 onOK:function(transport){
						     alert(transport.responseText) ;
						 }
			      });
	}
}

function buscar_colegiados(){
    //alert("Lo sentimos, la p\xE1gina est\xE1 en mantenimiento") ;
    apepa=document.getElementById('txt_apepa').value;
    apema=document.getElementById('txt_apema').value;
    prenombres=document.getElementById('txt_prenombres').value; cip=0;
    cip=document.getElementById('txt_cip').value;
    id=mostrar_valor_seleccionado('opt_busqueda');
    tipo=mostrar_valor_seleccionado('opt_tipo');
   
        document.getElementById('resultado_busqueda').style.display='block';  
    if(tipo=='T') { if(id=='N') opc=4; else  opc=3;   }
    else if(tipo=='O')  {  if(id=='N') opc=1; else  opc=2;  }
   
    if(id=='N'){
         if(apepa!='' && prenombres!='' )
                 myajax.Link('Ccontrol/Ccontrol.php?accion=buscar_colegiado&apepa='+encodeURIComponent(apepa)+'&apema='+encodeURIComponent(apema)+'&nombres='+encodeURIComponent(prenombres)+'&bus='+opc+'&tipo='+tipo,'detalle_busqueda');
        else alert('Ud. debe ingresar apellido paterno y prenombres') ;     
    }
    
    if(id=='C'){
        if(cip!='' ) {
			apepa=cadenasincero(cip) ; 
                 myajax.Link('Ccontrol/Ccontrol.php?accion=buscar_colegiado&apepa='+apepa+'&apema='+apema+'&nombres='+prenombres+'&bus='+opc+'&tipo='+tipo,'detalle_busqueda'); }
        else alert('Ud. debe ingresar el CIP') ;   
    }
}

function muestra_cumple(id){
    $('detalle_cumple').style.display='block';
    myajax.Link('Ccontrol/Ccontrol.php?accion=buscar_cumple&idcap='+id,'detalle_cumple');
}

function mostrar_directivos(){
    periodo=$('cboPeriodo_directivo').value;
    sede=$('cboConsejo_directivo').value; sede=sede.split('|'); id_sede=sede[0]; id_consejo=sede[1];
    organismo=$('cboOrganismo_directivo').value;
    cargo=$('cboCargo_directivo').value;
    $('busca_directivos').style.display='block';
    myajax.Link('Cvista/institucional/quienesSomos/busqueda_directivos.php?accion=busca_directivos&periodo='+periodo+'&id_sede='+id_sede+'&id_consejo='+id_consejo+'&organismo='+organismo+'&cargo='+cargo,'busca_directivos');
}

