// JavaScript Document
//VARIABLES CON VALOR DE PAGINAS ASP///////////////////////////////////////////////////////
var contenedor_index="<table width='940' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td width='175'><table width='165' height='500' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td height='80'><table width='160' height='160' align='center' border='0' cellspacing='0' cellpadding='0' background='images/menulateral.jpg'><tr><td class='titulos'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='icon_85.gif' width='7' height='7' /><a href='javascript:valinicio()' title='Volver a Incio' target='_self'>&nbsp;&nbsp;INICIO</a></td></tr><tr><td class='titulos'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='icon_85.gif' width='7' height='7' /><a href='javascript:ajax_misvis()' title='Misión y Visión'>&nbsp;&nbsp;MISIÓN Y VISIÓN</a></td></tr><tr><td class='titulos'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='icon_85.gif' width='7' height='7' /><a href='javascript:ajax_const()' title='Noticias'>&nbsp;&nbsp;NOTICIAS</a></td></tr><tr><td class='titulos'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='icon_85.gif' width='7' height='7' /><a href='javascript:ajax_const()' title='Testimonios'>&nbsp;&nbsp;TESTIMONIOS</a></td></tr><tr><td class='titulos'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='icon_85.gif' width='7' height='7' /><a href='javascript:ajax_certiiso()' title='Certificación ISO'>&nbsp;&nbsp;CERTIFICACIÓN ISO</a></td></tr></table></td></tr><tr><td height='320'>&nbsp;</td></tr></table></td><td width='765'><table width='747' height='526' border='0' cellspacing='0' cellpadding='0' align='center' background='images/fondopanel.jpg'><tr><td colspan='3' height='7'></td></tr><tr><td width='9'></td><td height='500' align='center'><div id='visual' style='width:727px; height:510px; border: inherit;' align='center'><table width='400' height='400' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table></div></td><td width='9'></td></tr><tr><td colspan='2' height='5'></td></tr></table></td></tr></table>";
var contenedor_lab="<table width='950' border='0' cellspacing='0' cellpadding='0' align='center'><tr><td><div id='citalab' style='width:950px; height:510px;border: inherit;' align='center'><table width='400' height='400' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table></div></td></tr></table>";
///////////////////////////////////////////////////////////////////////////////////////////
//PRIMERA COLUMNA MENU//////////////////////////////
var pag_hospital="MP_Hospital_ajax.htm";
var pag_resenahistorica="INI_Resenahistorica_ajax.htm";
var pag_biotavara="INI_BiografiaSTavara_ajax.htm";
var pag_himsanidad="INI_HimnoSanidadNava_ajax.htm";
var pag_direccion="INI_Direccion_ajax.htm";
var pag_direjecu="INI_ExDirEjecutivos_ajax.htm";
var pag_dirmedic="INI_ExDirMedicoss_ajax.htm";
var pag_misvis="INI_MisionYVision_ajax.htm";
//SEGUNDA COLUMNA MENU//////////////////////////////
var pag_stmedico="GUI_StafMedico_ajax.asp";
var pag_bsmedico="resp_medicos.asp?";
var pag_resp_medicos_ser="resp_medicos_servicio.asp?";
var pag_resp_medicos_sereg="resp_medicos_servicioreg.asp?";
var pag_departamentos="GUI_Departamentos_ajax.htm";
//TERCERA COLUMNA MENU//////////////////////////////
var pag_ancon="POL_Ancon_ajax.htm";
var pag_ventanilla="POL_Ventanilla_ajax.htm";
var pag_sanborja="POL_SanBorja_ajax.htm";
//CUARTA COLUMNA MENU///////////////////////////////
var pag_onconaval="PRO_Onconaval_ajax.htm";
var pag_segcapa="PRO_Segundacapa_ajax.htm";
//QUINTA COLUMNA MENU///////////////////////////////
var pag_formatos="GSA_Formatos_ajax.htm";
var pag_convocatorias="GSA_Convocatorias_ajax.htm";
var pag_cronograma="GSA_Cronograma_map.htm";
var pag_descargasotros="GSA_Descargasotros_ajax.htm";
//SEPTIMA COLUMNA MENU//////////////////////////////
var pag_telefonos="CNT_listatelef_ajax.htm";
//VARIOS//////////////////////////////
var pag_ubicacion="MB_Ubicacion_ajax.htm";
var pag_paneles="INI_paneles_0902.html";
var pag_banner="INI_banner_new.html";
var pag_testipri="NOT_testiprimero_ajax.htm";
var pag_testisegu="NOT_testisegundo_ajax.htm";
var pag_invespri="NOT_investipromero_ajax.htm";
var pag_notipri="NOT_notiprimera_ajax.htm";
var pag_notisegu="NOT_notisegunda_ajax.htm";
var pag_notiterc="NOT_notitercero_ajax.htm";
var pag_noticuar="NOT_noticuarto_ajax.htm";
var pag_notiquin="NOT_notiquinto_ajax.htm";
var pag_notisext="NOT_notisexto_ajax.htm";
var pag_notisept="NOT_notiseptimo_ajax.htm";
var pag_notiocta="NOT_notioctavo_ajax.htm";
var pag_certiiso="LIB_Certificacion_ajax.html";
var pag_cronog="GSA_Cronograma_ajax.htm";
var pag_cosnt="Construccionpag_ajax.htm";
var pag_regcusu="registrocorreousuario.asp?";
var pag_rptcusu="Resptcusu.asp?";
var pag_logincusu="seguridadcusu_ajax.html";
var pag_citalab="ONL_Cita_lab_ajax.htm";
var pag_online="ONL_Citas.htm";
var pag_enlaces="PAN_enlacesinteres_ajax.htm";
////////////////////////////////////////////////////////////////////////////////////////////
//VARIABLES AJAX////////////////////////////////////////////////////////////////////////////
var http = http_objeto();
var http2 =http_objeto2();
////////////////////////////////////////////////////////////////////////////////////////////
//FUNCIONES PARA AJAX///////////////////////////////////////////////////////////////////////
function http_objeto(){
  var xmlhttp;
  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  } else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}
  }
  return xmlhttp;
}
function http_objeto2(){
  var xmlhttp;
  if(window.XMLHttpRequest){
    xmlhttp = new XMLHttpRequest();
  } else if (window.ActiveXObject){
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (!xmlhttp){
        xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
    	}
  }
  return xmlhttp;
}
//FIN PRINCIPAL/////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
function cambias(){
	var vinscip=document.getElementById('index').value;
	alert("Arturo Z");
}
//FUNCIONES DE REDIRECIONAMIENTO////////////////////////////////////////////////////////////
function div_visual(){
   		 if (http.readyState == 4) {
    			if(http.status==200) {
					document.getElementById('visual').innerHTML = http.responseText;
        		}
    	}
}
function div_buscar(){
   		 if (http.readyState == 4) {
    			if(http.status==200) {
					document.getElementById('buscar').innerHTML = http.responseText;
        		}
    	}
}
function div_servicios(){
   		 if (http.readyState == 4) {
    			if(http.status==200) {
					document.getElementById('servicios').innerHTML = http.responseText;
        		}
    	}
}
function div_banner(){
   		 if (http.readyState == 4) {
    			if(http.status==200) {
					document.getElementById('presenta').innerHTML = http.responseText;
        		}
    	}
}
function div_paneles(){
   		 if (http2.readyState == 4) {
    			if(http2.status==200) {
					document.getElementById('panelbar').innerHTML = http2.responseText;
        		}
    	}
}
function div_serviciosform(){
   		 if (http2.readyState == 4) {
    			if(http2.status==200) {
					document.getElementById('serviciosform').innerHTML = http2.responseText;
        		}
    	}
}
function div_citalab(){
   		 if (http.readyState == 4) {
    			if(http.status==200) {
					document.getElementById('citalab').innerHTML = http.responseText;
        		}
    	}
}
//RESPUESTAS PARA EL MENU///////////////////////////////////////////////////////////////////
function ajax_const(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_cosnt,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
////////////////////////////////////////////////////////////////////////////////////////////
function ajax_inicio(){
  document.getElementById('panelbar').innerHTML = ("<table width='180' height='560' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table>");
  document.getElementById('presenta').innerHTML = ("<table width='450' height='300' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table>");
  http2.open("GET",pag_paneles,true);
  http.open("GET",pag_banner,true);
  http2.onreadystatechange=div_paneles;
  http.onreadystatechange=div_banner;
  http2.send(null);
  http.send(null);
  	var opciones = "top="+100+",left="+100+",width="+600+",height="+400+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	window.open('POP_Cronograma.html',"Enlaces",opciones);
	//var opciones2 = "top="+25+",left="+700+",width="+500+",height="+570+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	//window.open('POP_Prevencion.html',"Prevencion",opciones2);
	//var opciones3 = "top="+300+",left="+100+",width="+615+",height="+390+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0";
	//window.open('POP_Diploma.html',"Diploma",opciones3);
}
function ajax_hospital(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_hospital,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_resenahistorica(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_resenahistorica,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_biotavara(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_biotavara,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_himsanidad(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_himsanidad,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_direccion(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_direccion,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_direjecu(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_direjecu,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_dirmedic(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_dirmedic,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_misvis(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_misvis,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_stmedico(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_stmedico,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_bsmedico(){
	var vdepa=document.getElementById('departamento').value;
	var vserv=document.getElementById('especialidad').value;
	var vmedi=document.getElementById('medico').value;
  document.getElementById('buscar').innerHTML = ("<table width='650' height='380' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table>");
  http.open("GET",pag_bsmedico +"departamento=" + vdepa + "&especialidad=" + vserv + "&medico=" + vmedi,true);
  http.onreadystatechange=div_buscar;
  http.send(null);
}
function ajax_servicios(){
	var vdepa=document.getElementById('departamento').value;
  document.formmed.medico.value="";
  document.getElementById('servicios').innerHTML = ("<table border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='texto-grissp'>cargando .... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/index/cargatexto.gif' width='50' height='10'></td></tr></table>");
  http.open("GET",pag_resp_medicos_ser + "departamento=" + vdepa ,true);
  http.onreadystatechange=div_servicios;
  http.send(null);
}
function ajax_serviciosform(){
	var vdeparg=document.getElementById('departamentoform').value;
  document.getElementById('serviciosform').innerHTML = ("<table border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='texto-grissp'>cargando .... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/index/cargatexto.gif' width='50' height='10'></td></tr></table>");
  http2.open("GET",pag_resp_medicos_sereg + "departamentoform=" + vdeparg ,true);
  http2.onreadystatechange=div_serviciosform;
  http2.send(null);
}
function ajax_departamentos(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_departamentos,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_ancon(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_ancon,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_ventanilla(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_ventanilla,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_sanborja(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_sanborja,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_onconaval(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_onconaval,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_segcapa(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_segcapa,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_formatos(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_formatos,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_convocatorias(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_convocatorias,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_cronograma(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_cronograma ,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_descargasotros(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_descargasotros,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_telefonos(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_telefonos,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_ubicacion(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_ubicacion,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
////////////////////////////////////////////////////////////////////////////////////////////
function ajax_testipri(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_testipri,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_testisegu(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_testisegu,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_invespri(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_invespri,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notipri(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notipri,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notiocta(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notiocta,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notisext(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notisext,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notisegu(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notisegu,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notiquin(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notiquin,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_noticuar(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_noticuar,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notiterc(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notiterc,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_notisept(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_notisept,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
////////////////////////////////////////////////////////////////////////////////////////////
function ajax_certiiso(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_certiiso,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_cronog(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_cronog,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_regcusu(){
	var usuar = document.getElementById('usu').value;
	var clav = document.getElementById('pas').value;
  document.getElementById('visual').innerHTML = ("<table width='650' height='380' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table>");
  http.open("GET",pag_regcusu + "usuario=" + usuar + "&clave=" + clav,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_rptcusu(){
	var vnomb = document.getElementById('cregnombre').value;
	var vaps = document.getElementById('cregapellidos').value;
	var vcip = document.getElementById('cregcip').value;
	var vdni = document.getElementById('cregdni').value;
	var vtlf = document.getElementById('cregtelefono').value;
	var vcel = document.getElementById('cregcelular').value;
	var vanx = document.getElementById('creganexo').value;
	var vdep = document.getElementById('departamentoform').value;
	var vser = document.getElementById('especialidadform').value;
	var vofi = document.getElementById('cregoficina').value;
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_rptcusu + "nom=" + vnomb + "&apes=" + vaps + "&cip=" + vcip + "&dni=" + vdni + "&telf=" + vtlf + "&celu=" + vcel + "&anex=" + vanx + "&depa=" + vdep + "&serv=" + vser + "&ofic=" + vofi,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}

function ajax_logincusu(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_logincusu,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_rlogincusu(){
  document.getElementById('visual').innerHTML = ("<table width='650' height='380' border='0' cellspacing='0' cellpadding='0'><tr><td align='center' class='espera'>cargando .... <BR><BR><img src='images/index/carga.gif' width='55' height='55'></td></tr></table>");
  http.open("GET",pag_logincusu,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
function ajax_citalab(){
  document.getElementById('index').innerHTML = (contenedor_lab);
  http.open("GET",pag_citalab,true);
  http.onreadystatechange=div_citalab;
  http.send(null);
}
function ajax_online(){
  document.getElementById('index').innerHTML = (contenedor_lab);
  http.open("GET",pag_online,true);
  http.onreadystatechange=div_citalab;
  http.send(null);
}
function ajax_enlaces(){
  document.getElementById('index').innerHTML = (contenedor_index);
  http.open("GET",pag_enlaces,true);
  http.onreadystatechange=div_visual;
  http.send(null);
}
