function verban(id) {
  idv=document.getElementById(id);
  idv.style.border='2px ridge lightsteelblue';
}
function hidban(id) {
  idh=document.getElementById(id);
  idh.style.border='0px';
}
function vertit(id) {
  idv=document.getElementById(id);
  if ((screen.width<1024) && (screen.height<768))
  {
    if (idv.className=="ban") { idv.className="ban6x8"; }
    else { if (idv.className=="ace") { idv.className="ace6x8"; }
    }
  }
  idv.style.visibility="visible";
}
function hidtit(id) {
  idh=document.getElementById(id);
  if ((screen.width<1024) && (screen.height<768))
  {
    if (idh.className=="ban6x8") { idh.className="ban"; }
    else { if (idh.className=="ace6x8") { idh.className="ace"; }
    }
  }
  idh.style.visibility="hidden";
}
function abrir(pagina) {
    OpenWin = this.open(pagina,'_self');
}

function placeFocus() {
    now = new Date()
    offs = now.getTimezoneOffset()-60;
    window.usu.offset.value=offs;

    if (document.forms.length > 0) {
        var field = document.forms[0];
            for (i = 0; i < field.length; i++) {
                if ((field.elements[i].type == "password") || (field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
                    document.forms[0].elements[i].focus();
                    break;
                }
            }
   }
}
function exists(userEntry, message) { 
 var aCharExists = 0; var entry = userEntry; 
 if (entry) {
   for (var i=0; i<entry.length; i++) {
     if (entry.charAt(i) != " ") {
       aCharExists = 1;
     }
   }
 } 
 if (!aCharExists) {
    alert(message);
 }
}
function txtcol( fld ) 
{ 
   fld.style.backgroundColor = '#66CCFF'; 
}
function disableForm(theform) {
    if (document.all || document.getElementById) {
        for (i = 0; i < theform.length; i++) {
            var tempobj = theform.elements[i];
            if (tempobj.type.toLowerCase() == "submit")
                tempobj.disabled = true;          
        }
    }
}
function copioValor(posi,cel) {
    box = eval(cel);
    box.value=posi;
}
function Highlight(e)
{
 if (e.parentNode.className == "normal") {
   e.parentNode.className = "marcado";
 }
 else if (e.parentNode.className == "marcado") {
   e.parentNode.className = "normal";
 }
}

function Highlight8(e)
{
 if (e.parentNode.className == "normal8") {
   e.parentNode.className = "marcado";
 }
 else if (e.parentNode.className == "marcado") {
   e.parentNode.className = "normal8";
 }
}
function Start(page,ven,arriba,izq,alto,ancho) {
var random_num = (Math.round((Math.random()*99)+1));
var venta=ven+random_num;
OpenWin = this.open(page, venta, "status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,top="+arriba+",left="+izq+",height="+alto+",width="+ancho+",false");
}
function Start_men(page,ven,arriba,izq,alto,ancho) {
var random_num = (Math.round((Math.random()*99)+1));
var venta=ven+random_num;
OpenWin = this.open(page, venta, "status=no,toolbar=yes,menubar=no,location=no,scrollbars=yes,resizable=yes,top="+arriba+",left="+izq+",height="+alto+",width="+ancho+",false");
}
function expandArg(id) {
  var idv=document.getElementById(id);
  var imag=document.getElementById('expa');
  var map=document.getElementById('mapa');
  var canta=document.getElementById('canta');
  var conte=document.getElementById('contenido');
  var puntero1=document.getElementById('botones'); 
  var puntero2=document.getElementById('interchg');
  if (document.dummy.ancho.value=='0') {
      imag.src='../images/icoRight.gif';
      imag.title='Achicar esta ventana';
     
  	  var tc1=puntero1.firstChild;			// apunto al objeto tcambio
  	  var cus1=puntero1.lastChild;			// apunto al objeto customsaduana  	  
	  puntero2.appendChild(tc1);
	  puntero2.appendChild(cus1);	  
	  puntero2.style.visibility='hidden';

      document.dummy.ancho.value=map.width;
      document.dummy.alto.value=map.height;
      map.width='0';
      map.height='0';
      document.dummy.ancho1.value=canta.width;
      document.dummy.alto1.value=canta.height;
      canta.width='0';
      canta.height='0';
      conte.style.width='10';
      idv.style.width='545';
  } else {
      imag.src='../images/icoLeft.gif';
      imag.title='Expandir esta ventana';   
      idv.style.width='205';
      conte.style.width='350';   
  	  var puntero1=document.getElementById('interchg');      
  	  var tc1=puntero1.firstChild;			// apunto al objeto tcambio
  	  var cus1=puntero1.lastChild;			// apunto al objeto customsaduana  	  
	  var puntero2=document.getElementById('botones');
	  puntero2.appendChild(tc1);
	  puntero2.appendChild(cus1);      
	  puntero2.style.visibility='visible';      
      
      map.width=document.dummy.ancho.value;
      map.height=document.dummy.alto.value;
      document.dummy.ancho.value='0';
      document.dummy.alto.value='0';
      canta.width=document.dummy.ancho1.value;
      canta.height=document.dummy.alto1.value;
      document.dummy.ancho1.value='0';
      document.dummy.alto1.value='0';
  }
}
function expand(id) {
  var idv=document.getElementById(id);
  var imag=document.getElementById('expa');
  var map=document.getElementById('mapa');
  var canta=document.getElementById('canta');
  var conte=document.getElementById('contenido');
  if (document.dummy.ancho.value=='0') {
      imag.src='../images/icoRight.gif';
      imag.title='Achicar esta ventana';
      document.dummy.ancho.value=map.width;
      document.dummy.alto.value=map.height;
      map.width='0';
      map.height='0';
      document.dummy.ancho1.value=canta.width;
      document.dummy.alto1.value=canta.height;
      canta.width='0';
      canta.height='0';
      conte.style.width='10';
      idv.style.width='545';
  } else {
      imag.src='../images/icoLeft.gif';
      imag.title='Expandir esta ventana';   
      idv.style.width='205';
      conte.style.width='350';     
      map.width=document.dummy.ancho.value;
      map.height=document.dummy.alto.value;
      document.dummy.ancho.value='0';
      document.dummy.alto.value='0';
      canta.width=document.dummy.ancho1.value;
      canta.height=document.dummy.alto1.value;
      document.dummy.ancho1.value='0';
      document.dummy.alto1.value='0';
  }
}
function expandSinCanta(id) {
  var idv=document.getElementById(id);
  var imag=document.getElementById('expa');
  var map=document.getElementById('mapa');
  var conte=document.getElementById('contenido');
  if (document.dummy.ancho.value=='0') {
      imag.src='../images/icoRight.gif';
      imag.title='Achicar esta ventana';
      document.dummy.ancho.value=map.width;
      document.dummy.alto.value=map.height;
      map.width='0';
      map.height='0';
      conte.style.width='10';
      idv.style.width='545';
  } else {
      imag.src='../images/icoLeft.gif';
      imag.title='Expandir esta ventana';   
      idv.style.width='205';
      conte.style.width='350';     
      map.width=document.dummy.ancho.value;
      map.height=document.dummy.alto.value;
      document.dummy.ancho.value='0';
      document.dummy.alto.value='0';
  }
}
