/*DOCUMENTO JS*/
function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN().getUTCDate(),tN().getUTCHours(),tN().getUTCMinutes(),tN().getUTCSeconds()); x.setTime(x.getTime()+7200000); return x; } 
function tN(){ return new Date(); } 
function lZ(x){ return (x>9)?x:'0'+x; } 
function dT(){ if(fr==0){ fr=1; document.write('<span id="tP">'+eval(oT)+'</span>'); } tP.innerText=eval(oT); setTimeout('dT()',1000); } 
function y4(x){ return (x<500)?x+1900:x; } 
var dN=new Array('Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'),mN=new Array('Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Setiembre','Octubre','Noviembre','Diciembre'),fr=0,oT="dN[tS().getDay()]+','+' '+tS().getDate()+' '+mN[tS().getMonth()]+' '+y4(tS().getYear())+' '+'|'+' '+lZ(tS().getHours())+':'+lZ(tS().getMinutes())";

var estado = false;

function show(object) {
    if (document.layers && document.layers[object])
        document.layers[object].visibility = 'visible';
    else if (document.all) {
        document.all[object].style.visibility = 'visible';
        document.all[object].style.zIndex = 100;
    }
}
function hide(object) {
    if (document.layers && document.layers[object])
        document.layers[object].visibility = 'hidden';
    else if (document.all)
        document.all[object].style.visibility = 'hidden';
}


function CargoInfo(theURL,inter,accion,id,t,tid,sid) {
	parent.InfoDocs.document.location = theURL;
}

function LoadPages(theURL) {
	document.write ('<form name="Cargar" action="'+theURL+'" method="POST" target="Contenido">');
	document.write ('</form>');
	document.Cargar.submit();
/*
function LoadPages(theURL,inter,accion,id,t,tid,sid) {
	document.write ('<form name="Cargar" action="'+theURL+'" method="GET" target="Contenido">');
	document.write ('<input type="hidden" name="Inter" value="'+inter+'">');
	document.write ('<input type="hidden" name="Accion" value="'+accion+'">');
	document.write ('<input type="hidden" name="id" value="'+id+'">');
	document.write ('<input type="hidden" name="tid" value="'+t+'">');
	document.write ('<input type="hidden" name="sid" value="'+tid+'">');
	document.write ('<input type="hidden" name="" value="'+sid+'">');
	document.write ('</form>');
	document.Cargar.submit();


	parent.Contenido.document.location = theURL;
*/
}

function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
   }
 }
}

function LoadPage(theURL,thePAGE) {
	document.getElementById(thePAGE).src = theURL;
}

function GraboStatsDocs(theURL) {
	parent.Stats.document.location = theURL;
}


function out(obj, new_style) { 
if(estado == false) {
	obj.className = new_style;
	}
else {
	return;
	}
}

function outer() { 
if(estado == true) {
	estado = false;
	}
else {
	return;
	}
}

function Navego(theURL) {
	window.location.href = theURL;
}

function over(obj, new_style, Nmenu) {
estado = false;
for (i=1; i<document.buscador.numsmenu.value; i++) 
 {  document.getElementById('opt'+i+'').className = 'optOff'; }

document.getElementById(Nmenu).className = 'optOff';
if(estado == false) {
	obj.className = new_style;
	}
else {
	return;
	}
}


/*
function VuelcoPagina(id,t,eldocid,sid,inter){
	window.open('CacexDoc.asp?Accion=Info&Inter='+inter+'&id='+id+'&sid='+id+'&t='+t+'&tid='+eldocid+'&eldocid='+eldocid+'','Contenido');
}
*/

function VuelcoPagina(theURL){
	Ventana=window.open(theURL,'Contenido');
	Ventana.focus();
}

function menuclick(obj, new_style,infomenu) {
for (i=1; i<document.buscador.numsmenu.value; i++) 
 {  document.getElementById('opt'+i+'').className = 'optOff'; }
document.buscador.infomenu.value = infomenu;
obj.className = new_style;
estado = true;
return false;
}

function MarcoMenu(){
	if (document.buscador.infomenu.value!=''){
	document.getElementById(document.buscador.infomenu.value).className = 'optOn';
	}
}

function CargoInfoFlujo(elHTML){
	show('Infos2');
	document.getElementById('Infos2').innerHTML= elHTML;
}

function CierroInfoFlujo(){
	hide('Infos2');
}


function CargoInfoTema(elHTML){
	show('Infos');
	document.getElementById('Infos').innerHTML= elHTML;
}

function CierroInfoTema(){
	hide('Infos');
}

function CWin(ancho,alto,url,urlName,scrols){
var ancho = ancho;
var alto = alto;
var Arriba = (screen.height-alto)/2;
var Derecha = (screen.width-ancho)/2;
Ventana=window.open
(url,urlName,'width=' + ancho + ',height=' + alto + ',top=' + Arriba + ',left=' + Derecha + ',scrollbars='+scrols+'');
Ventana.focus();
}

function POWin(ancho,alto,url,urlName,scrols){
var ancho = ancho;
var alto = alto;
Ventana=window.open
(url,urlName,'width=' + ancho + ',height=' + alto + ',top=0,left=0,scrollbars='+scrols+'');
Ventana.focus();
}


//defino lenguaje del string 
var langShow = "Mostrar";
var langHide = "Ocultar"


// mostrar ocultar celdas
function ShowHideInfos(idTD, idImg){
	var td = document.getElementById(idTD);
	var img = document.getElementById(idImg);
	if(td != null && img != null){
		var isHidden = td.style.display == "none" ? true : false;
		img.src = isHidden ? "media/images/ico_hide.gif" : "media/images/ico_show.gif";
		img.alt = isHidden ? langHide : langShow;
		td.style.display = isHidden ? "" : "none";
	}
}


function VerDocs(url) {
window.open(url,'DOCUMENTOS','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,top=10,left=10,width=805,height=520');
/*
	Ventana = window.open('','DOCUMENTOS','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,top=10,left=10,width=805,height=520');
	Ventana.document.write( "<html><head><title>&copy; Documentos C@sce</title>" );
	Ventana.document.write( "<STYLE TYPE='text/css'>" );
	Ventana.document.write( "A {font-family: verdana; font-size: 10px; color: #000000; text-decoration : none;}" );
	Ventana.document.write( "A:Visited {font-family: verdana;font-size: 10px; color: #000000; }" );
	Ventana.document.write( "A:Active { font-family: verdana; font-size: 10px; color: #000000; }" );
	Ventana.document.write( "A:Hover { font-family: verdana; font-size: 10px; color: #000000; }" );
	Ventana.document.write( "IMG {border-color : #000000;}" );
	Ventana.document.write( "BODY { font-family: verdana; font-size : 10px; font-weight: normal; color : #000000; background-color : #F7FBF7; }" );
	Ventana.document.write( "</STYLE>" );
	Ventana.document.write("<meta http-equiv='imagetoolbar' content='no'>");
	Ventana.document.write( "</head><body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>" );
	Ventana.document.write( "<table cellpadding=0 cellspacing=0 border=0>" );
	Ventana.document.write( "<tr><td align='left'>&nbsp;&nbsp;<a>&copy; Documentos C@sce</a></td>" );
	Ventana.document.write( "<td align='right'><a href='javascript:top.window.close();'>»»cerrar««</a>&nbsp;&nbsp;<a href='pdf.asp?pic=http://www.format-e.net/cacexdoc/Pictures.asp?docid="+id+"&view=1'>Imprimir</a>&nbsp;&nbsp;</td></tr>" );
	Ventana.document.write( "<tr><td colspan=2><img src='"+imgRuta+"' border=0 alt='"+imgCaption+"'></td></tr>" );
	Ventana.document.write( "<tr><td align='left'>&nbsp;&nbsp;&copy; Documentos C@sce&nbsp;&nbsp;&nbsp;<a href='pdf.asp'>Imprimir</a></td>" );
	Ventana.document.write( "<td align='right'><a href='javascript:top.window.close();'>»»cerrar««</a>&nbsp;&nbsp;</td></tr>" );
	Ventana.document.write( "</table></body></html>" );
	Ventana.document.close();
*/
}

// mensajes de alertas
function msg(mensaje)
{
  switch (mensaje)
  {
	// opcion 1
    case 1: { alert('ATENCIÓN!!\n\nESTE DOCUMENTO NO ES VÁLIDO!!\nSOLO SE VISUALIZA A TITULO DE EJEMPLO!!\nPOR FAVOR NO UTILICE ESTE DOCUMENTO PARA PRESENTARLO A ADMINISTRACIÓN!!\n\n\nMuchas gracias.\n\n\nEl equipo de DocumentaC@SCE.'); break }
	// opcion 2
    case 2: { alert('ATENCIÓN!!\n\nESTE DOCUMENTO NO ES VÁLIDO!!\nSOLO SE DISTRIBUYE A TITULO DE EJEMPLO!!\nPOR FAVOR NO UTILICE ESTE DOCUMENTO PARA PRESENTARLO A ADMINISTRACIÓN!!\n\n\nMuchas gracias.\n\n\nEl equipo de DocumentaC@SCE.'); break }
	// opcion por defecto
    default: { alert('No hay alertas'); break }
  }
}

function CheckBuscador() {
Texto = Trim(document.buscador2.Texto.value);
if(Texto.length < 1){
msg = "Debe utilizar un mínimo criterio de búsqueda!";
}
if (msg != "") {
alert(msg);
return false;
}
else document.buscador2.submit();
}

function LTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(0)) != -1) {
      var j=0, i = s.length;
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
         j++;
      s = s.substring(j, i);
   }
   return s;
}
function RTrim(str)
{
   var whitespace = new String(" \t\n\r");
   var s = new String(str);
   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
      var i = s.length - 1;       // Get length of string
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
         i--;
      s = s.substring(0, i+1);
   }
   return s;
}
function Trim(str)
{
   return RTrim(LTrim(str));
}

// mostrar ocultar panel informativo
function ShowPanel(panel,rid,stringid,optnum) {
 if (rid==stringid)
    {
	ShowHideInfos('td_'+panel+'', 'img_'+panel+'');
	over('opt'+optnum+'','optOn','opt'+optnum+'');
    }
}

function AddFavoritos() {window.external.AddFavorite('http://casce.camaras.org','Documentos C@SCE')}


function hidestatus(){
window.status='C@sce Documentación - © www.casce.org 2003-2005'
return true
}

if (document.layers)
document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)

document.onmouseover=hidestatus
document.onmouseout=hidestatus