var indele="";
nlina = 20;
function mostrar1(eti,num)
{
var etiq=trim(eti);
var literal="";
var bot='bot' + eti;
var fila='tr' + eti;
document.getElementById(bot).style.display= "none";

switch (etiq) 
   {
   case "MCEST":
   case "MATCES":
    literal = "Materia CES";
    document.getElementById(bot).style.display= "";
    break;
   case "MATBIB":
    document.getElementById(bot).style.display= "";
    break;
   case "MBIBT":
    document.getElementById(bot).style.display= "";
    break;
   case "AUTORI":
    document.getElementById(bot).style.display= "";
    break;
   case "REGISTRO":
     literal = "Número de Registro";
     break;
   case "FPUB":
     literal = "Fecha de Publicación";
     break;
   case "FECPUB":
     literal = "Año de Publicación";
     break;
   case "PPUB":
     literal = "País de Publicación";
     break;
   case "FRC":
     literal = "Periodicidad";
     break;
   case "FDI":
    literal = "Fecha del dictamen";
    break;
   case "ORGT":
    literal = "Organismo solicitante";
    break;
   case "CT":
    literal = "Comisión de trabajo";
    document.getElementById(bot).style.display= "";
    break;
   case "PONPER":
    literal = "Intervinientes";
    document.getElementById(bot).style.display= "";
    break;
   case "VPT":
    literal = "Votos particulares";
    break;
   case "MT":
    document.getElementById(bot).style.display= "";
    break;
   case "MCT":
    literal = "Materia CES";
    document.getElementById(bot).style.display= "";
    break;
   case "IDT":
    literal = "Identificación";
    break;
   case "FSES":
    literal = "Fecha de la sesión";
    break;
   case "IPT":
    literal = "Intervinientes";
    document.getElementById(bot).style.display= "";
    break;
   case "RGN":
    literal = "Órgano";
    document.getElementById(bot).style.display= "";
    break;
   case "DAT":
    literal = "Dictámenes/Informes aprobados";
    break;
   case "INS":
    literal = "Institución";
    document.getElementById(bot).style.display= "";
    break;
   case "TDOC":
    literal = "Tipo de documento";
    document.getElementById(bot).style.display= "";
    break;
   case "---":
     literal = "---";
     break;
   default: 
     break; 
   }
  if (trim(document.getElementById(eti).innerHTML) == "---")
   {
    document.getElementById(fila).style.display= "none";
   }
  if (literal != "")
   {
    document.getElementById(eti).innerHTML = literal;
   }
}

function indices(etiq)
{
var etiqq=trim(etiq);
var ivista="";
var itabla="";
indele=etiq;
funcion = "SWF-SEAA";
switch (etiqq) 
{
   case "MCEST":
   case "MATCES":
   case "MCT":
     ivista="TESCESA";
     break;
   case "MATBIB":
     ivista="TESOITA";
     break;
   case "MT":
     ivista="TESOITA";
     break;
   case "MBIBT":
     ivista="TESOITA";
     break;
   case "AUTORI":
     ivista="APERSA";
     break;
   case "CT":
     itabla="CES-ORG";
     funcion="SWF-LEET";
     break;
   case "PONPER":
   case "IPT":
     itabla="CES-INT";
     funcion="SWF-LEET";
     break;
   case "RGN":
     itabla="CES-TSES";
     funcion="SWF-LEET";
     break;
   case "INS":
     itabla="CES-INST";
     funcion="SWF-LEET";
     break;
   case "TDOC":
     itabla="CES-DOC";
     funcion="SWF-LEET";
     break;
   default: 
     break; 
}
bars="TOOLBAR=no ,location=no,SCROLLBARS=1,RESIZABLE=1,WIDTH=550,HEIGHT=500";
bars += ",menubar=no ,top=40,left=50";
msg = pcgi + "?-FUNC=" + funcion + "&-USER=" + user + "&-AKEY=" + akey;
if (funcion == "SWF-LEET") {
   msg += "&-VIEW=" + view + "&-NLIN=" + nlina + "&-TABL=" + itabla ;
}
else
   msg += "&-VIEW=" + ivista + "&-NLIN=" + nlina;
msg += "&-DCSS=" + dcss;
ventana = window.open (msg,"VENTANA",bars);  
ventana.focus();
}
function Transf (val){
var jj = window.opener.indele;
idcaja="caja"+jj;
val = val.replace(/,/g, "");
window.opener.document.getElementById(idcaja).value=val;
self.close();}

function inileet()
{
csidr = iniv.replace(/ /g,"+");
var funcion = 'SWF-LEET';
msg = pcgi + "?-FUNC=" + funcion + "&-USER=" + user ;
msg += "&-AKEY=" + akey + "&-VIEW=" + view;
msg += "&-TABL=" + trim(tabl) + "&-CSIG=" + csidr + "&-INIV=" + csidr;
msg += "&-NLIN=" + nlin ;
msg += "&-DCSS=" + dcss;
document.location = msg;
}
/* paginar elementos de tabla */
function pagleet()
{
csidr = csid.replace(/ /g,"+");
iniv = "";
var funcion = 'SWF-LEET';
msg = pcgi + "?-FUNC=" + funcion + "&-USER=" + user ;
msg += "&-AKEY=" + akey + "&-VIEW=" + view;
msg += "&-TABL=" + trim(tabl) + "&-CSIG=" + csidr + "&-INIV=" + iniv ;
msg += "&-NLIN=" + nlin ;
msg += "&-DCSS=" + dcss;
document.location = msg;
}

function imprimir(){
/* if ( dispimp == "Extracto" ) { */
if ( dispimp == "Extracto"  || dispimp == "WREF") { 
  if ( func == "SWF-NAVI" ) {
    funcionout = "CEF-NAVI";
    para1 = "&-ITEM=" + item + "&-NAVE=" + asoc + "&-INIT=" + init ;
    if (isni!=99999999) para1 += "&-ISNI=" + isni;
  }
  else {
    funcionout = "CEF-EXTI";
    para1 = "&-NACC=" + nacc + "&-ISNQ=" + isnq + "&-NINI=" + trim(nini) + "&-NLIN=" + nlin + "&-NNEW=" + trim(nini) ;
  }
  if (dispimp == "WREF" ){ para1 += "&-DISP=WREF"; }
}
else {
  funcionout = "CEF-IMPR";
  if ( func == "SWF-DISP" )
   para1 = "&-ITEM=" + item + "&-DISP=" + disp;
  else
   para1 = "&-ITEM=" + itemimp + "&-DISP=" + dispimp;
}
para = pcgi +  "?-FUNC=" + funcionout + "&-USER=" + user + "&-AKEY=" + akey + "&-VIEW=" + view; 
para += para1;

para2 = "MENUBAR=1,SCROLLBARS=1,RESIZABLE=1,WIDTH=680,HEIGHT=500"; 
ww=window.open(para,"IMPRIMIR",para2); 
ww.focus(); }

function hojaprestamo() {
para = pcgi + "?-FUNC=SWF-PRES&-USER=" +user+ "&-AKEY="+akey+ "&-VIEW="
+view+ "&-ITEM=" + item + "&-LECT=" + lect ;
para2 = "TOOLBAR=0,SCROLLBARS=1,RESIZABLE=1,WIDTH=650,HEIGHT=500";
w=window.open(para,"PRESTAMO",para2);
w.focus();
}

/* funciones de localizaciones electronicas */
function recurso(rvista,retiq)
{
var funcion = 'CEF-LELE';
msg = pcgi + "?-FUNC=" + funcion + "&-USER=" + user + "&-AKEY=" + akey; 
msg += "&-VIEW=" + rvista + "&-LA01=" + retiq + "&-NLAB=01" + "&-DISP=" + disp;
msg += "&-NLIN=" + nlin + "&-DCSS=" + dcss;
document.location = msg;
}

function lele(valor)
{
val = trim(valor);
val = val.replace(" ","+");
var funcion = 'CEF-LELE';
msg = pcgi + "?-FUNC=" + funcion + "&-USER=" + user + "&-EXTR=" + extr;
msg += "&-AKEY=" + akey + "&-VIEW=W99BMON" ;
msg += "&-NACC=" + nacc ;
msg += "&-NINI=" + nfin + "&-NNEW=" + nnew;
msg += "&-LA01=" + "L856" ; 
msg += "&-LA02=ORDMATC" + "&-VA02=ge+'" + val + "'" + "&-NLAB=02";
msg += "&-NLIN=" + nlin;
msg += "&-DCSS=" + dcss;
parent.location = msg;
}
function obj856(idobj,campo)
{
if (campo != "")
{
iniu = campo.indexOf('{U');
finu = campo.indexOf('U}');
iniy = campo.indexOf('{Y');
var ocu = idobj.substring(1,2);
var tipo = campo.substring(finu - 4,finu);
var tip4 = campo.substring(finu - 5,finu);
var subu;
if (campo.substring(iniu + 2,iniu + 3)=="/" ) subu = campo.replace("{U","<a class='recurso' target='_blank' href='");
else subu = campo.replace("{U","<a class='recurso' target='_blank' href='http://");
if (iniy == -1) /* no hay texto del enlace */
  subu = subu.replace("U}","'> Enlace</a>");
else
  subu = subu.replace("U}","'>");
subu = subu.replace("{Y","");
subu = subu.replace("Y}","</a>");
  
subu = subu.replace("{Z","");
if (tipo == ".htm" || tipo == ".jsp" || tip4 == ".html")
   subu = "<img src='/sirweb/images/http.jpg'>" + subu;
else
{
if (tipo == ".pdf" )
   subu = "<img src='/sirweb/images/pdf.jpg'>" + subu;
else
if (tipo == ".doc" )
   subu = "<img src='/sirweb/images/doc.jpg'>" + subu;
else
   subu = "<img src='/sirweb/images/http.jpg'>" + subu;
}
if (ocu != "1")
   subu = "<br/>" + subu;
document.getElementById(idobj).innerHTML = subu;
}
}

function pintar_boton()
{
if (!( user == "WEBCES" && (ente=="00059" || ente=="00047"
 || ente=="00052"  || ente=="00081")))
{
document.getElementById('botpres').style.display='none';
}
/* 200811 ini*/
if (ente!="00055")
{document.getElementById('botfasc').style.display='none';}
/* 200811 fin*/
}
/* 200811 ini*/
/* navegación */
function fasc(item) 
{				
//if (oper == "I" && init == "") {
  init = " ";
// }
  var funcion = 'CEF-NAVE';
  msg = pcgi + "?-FUNC=" + funcion + "&-USER=" + user ;  
  msg += "&-AKEY=" + akey + "&-VIEW=" + view; 
  msg += "&-NAVE=CP" + "&-ITEM=" + item;
  msg += "&-INIT=" + init + "&-ISNI=" + isnd ;
  msg += "&-NLIN=" + nlin;
  msg += "&-DCSS=" + dcss;

  document.location = msg;
}
/* 200811 fin*/
/* tmp -----------------------------------  */
function objext(nrec,nobj,lin1,lin2,lin3)
{
/* alert(nobj + "\n lin1:" + lin1 + "\n lin2:" + lin2 + "\n lin3:" + lin3);*/
numobj='obj' + nobj;
aobj='a' + nobj;
numtr = nrec+nobj;

if ( lin3=="Portada" || (lin1 == "" && lin2 == "" && lin3 == ""))
{document.getElementById(numtr).style.display= "none";}
if (lin2 == "Portada" || lin3 == "Portada")
{document.getElementById(numobj).src = "http://" + lin1;}
if (lin3 == ""){document.getElementById(aobj).innerHTML= "Enlace" ;}
}
function AbrirOtraVentana (itemori) {
bars="TOOLBAR=no,SCROLLBARS=1,RESIZABLE=0,WIDTH=400,HEIGHT=200"; 
bars += ",menubar=no,top=200,left=250";
odirec = pcgi + "?-FUNC=SWF-DISP" + "&-USER=" + user; 
odirec += "&-AKEY=" + akey + "&-ITEM=" + itemori + "&-VIEW=" + view + "&-DISP=WETIQ" ;
otra = window.open (odirec,"OTRA",bars);}
function puntero(it) {
var entp=it.substring(0,5);
if (entp == '00055' || entp == '00086' || entp == '00087') fdisp(it);
else rela(it);
}
function nuevabus() {
if (view == 'W98BPER' || view == 'W99BMON') recurso(view,'L856');
else vista('F',view);
}
function noticia(ob){
window.open("/repositorio/NOTICIAS/" + ob.substring(0,6) + "/" + ob,"","");
}


