// JavaScript Document

var index1="";
var index2="";
var index3="";

var src1="";
var src2="";
var src3="";

var seleccion=-1;

imagenes=new Array();


enlaces=new Array();
enlaces2=new Array();
enlaces[0]="<a href='Javascript:cambiar_detalle(1)' id='l1'>constancias_para_ciudadanos.php</a>";
enlaces[1]="<a href='Javascript:cambiar_detalle(2)' id='l2'>constancias_para_quienes_trabajaron.php</a>";
enlaces[2]="<a href='Javascript:cambiar_detalle(3)' id='l3'>C</a>";

var direccion="<a href='index.php'>Inicio </a><a href='constancias.php'>&gt;&gt; Constancias      </a>";

enlaces2=enlaces;
var temp="";
var id="";

var eleccion=-1;



var peticion = false; 
if (window.XMLHttpRequest) {
      peticion = new XMLHttpRequest();
      } else if (window.ActiveXObject) {
            peticion = new ActiveXObject("Microsoft.XMLHTTP");
}

var peticion = false; 

if (window.XMLHttpRequest) {
      peticion = new XMLHttpRequest();
      } else if (window.ActiveXObject) {
            peticion = new ActiveXObject("Microsoft.XMLHTTP");
}

function cargar_enlaces()
{
document.getElementById('enlaces').innerHTML=enlaces2[0]+"&nbsp;&nbsp;"+enlaces2[1]+"&nbsp;&nbsp;"+enlaces2[2];
}

function ObtenerDatosConst(datos,divID) {
if(peticion) {
     var obj = document.getElementById(divID); 
     peticion.open('GET',datos); 
     peticion.onreadystatechange = function()  { 
          if (peticion.readyState == 4) { 
               obj.innerHTML = peticion.responseText; 
          } 
     } 
peticion.send(null); 
}

}

function ObtenerDatosSemi(datos,divID) { 
if(peticion) {
     var obj = document.getElementById(divID); 
     peticion.open("GET", datos); 
     peticion.onreadystatechange = function()  { 
          if (peticion.readyState == 4) { 
               obj.innerHTML = peticion.responseText; 
          } 
     } 
peticion.send(null); 
}
}

function cargar_dialogo()
{opc=document.getElementById("form2").value;
 
 if(opc==0)ObtenerDatosSemi('modConstancias/constancias_para_ciudadanos.php','tipodialogo');
 if(opc==1)ObtenerDatosSemi('modConstancias/constancias_para_quienes_trabajaron.php','tipodialogo');

}

function cambiar_detalle(param)
{
id=param;

for(var i=0;i<3;i++)
 {enlaces2[i]=enlaces[i];
 }

document.getElementById('enlaces').innerHTML=enlaces2[0]+"&nbsp;&nbsp;"+enlaces2[1]+"&nbsp;&nbsp;"+enlaces2[2];

temp=direccion;

switch(param)
{case 1:ObtenerDatosGoecor('modConstancias/constancias_para_ciudadanos.php?id='+param,'detalle');
        temp=temp+"<a href='Javascript:cambiar_detalle(1)'>&gt;&gt;Constancias para ciudadanos </a>";
		//document.getElementById('dir').innerHTML=temp;
		//document.getElementById('11').style.color="#a82424";
		break;
case 2:ObtenerDatosGoecor('modConstancias/constancias_para_quienes_trabajaron.php?id='+param,'detalle');
        temp=temp+"<a href='Javascript:cambiar_detalle(2)'>&gt;&gt; Constancias para quienes trabajaron en ONPE</a>";
		//document.getElementById('dir').innerHTML=temp;
		//document.getElementById('l1').style.color="#a82424";
		break;		
 default:
}

}


function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && document.all)? document.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
        oElement = arrElements[i];      
        if(oRegExp.test(oElement.className)){
            arrReturnElements.push(oElement);
        }   
    }
    return (arrReturnElements)
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function Mostrar_Tipo_Const()
{opc=document.getElementById("ls_constancias").value;
 if(opc==0)
 {document.getElementById("tipo_constancias").style.visibility="visible";
 }else{
 document.getElementById("tipo_constancias").style.visibility="hidden";
 }
 
}



