<!--
var strColumns_Current = "180,*";

function alerta(msg){
var miURL
(alerta.arguments.length!=0)?miURL="/includes/alerta.asp?msg=" + msg:miURL="/includes/alerta.asp";
window.showModalDialog(miURL ,"miAlerta","dialogWidth=400px; dialogHeight=200px; status=no; help=no; unadorned=no;");
}

function confirma(msg){
var miURL
(confirma.arguments.length!=0)?miURL="/includes/confirma.asp?msg=" + msg:miURL="/includes/confirma.asp";
var miReturn = window.showModalDialog(miURL ,"miConfirma","dialogWidth=400px; dialogHeight=200px; status=no; help=no; unadorned=no;");
return miReturn;
}

function hideMenu() {
  strColumns_Current = top.document.frames['frmset02'].cols
  top.document.frames['frmset02'].cols = "0,*";
}

function showMenu() {
  top.document.frames['frmset02'].cols = strColumns_Current;
}

function ponerTit(titulo){
  var titulo
  if (top.frm03) {
		top.frm03.document.onload =	changeTit(titulo);
	}
	else {
//document.write ('<h4>'+titulo+'</h4>');
	}
}

function quitarTit(){
  if (top.frm03) changeTit('');
}

function changeTit(titulo){
	var titulo
	if (top.frm03.tit2NDTop) top.frm03.tit2NDTop.innerHTML = titulo;
}

function expandeColapsa(este) {
	imgExpCol(este);

// Si el elemento hijo existe, expandirlo o colapsarlo.
	expCol(este)
}

function expCol(este) {
// Obtener elemento hijo.
var brother = este.nextSibling;

// Si el elemento hijo existe, expandirlo o colapsarlo.
	if (brother) brother.className = brother.className == "collapsed" ? "expanded" : "collapsed";
}

function expande(este) {
	// Obtener elemento hijo.
	var brother = este.nextSibling;

	imgExpCol(este);

	// Si el elemento hijo existe, expandirlo o colapsarlo.
		if (brother) brother.className = brother.className == "collapsed" ? "expanded" : "expanded";
}


function swapLabel(label){

if (document.getElementById("sSolapa")) miSSolapa = sSolapa;
else {
		LastSolapa = menuSolapas.getElementsByTagName("SPAN").length - 1;
		miSSolapa = menuSolapas.getElementsByTagName("SPAN")[LastSolapa];
}

	// Guardo el código HTML que contenga label
	var tmpHTML = label.innerHTML;
	var tmpHTML2 = miSSolapa.innerHTML;

	// Navego la URL del enlace que contiene label
	label.children.tags('A')[0].click();

	// Copio el código HTML guardado en tempHTML2 sustiyendo el de label
	label.innerHTML = tmpHTML2;

	// Copio el código HTML guardado en tempHTML sustiyendo el de sSolapa
	miSSolapa.innerHTML = tmpHTML;

	// Doy el estilo CSS a cada uno el que debe llevar
	label.children.tags('A')[0].className='Label';
	miSSolapa.children.tags('A')[0].className='sLabel';
}

function sClick(este,mostrarEste){
sOcultaTodas(este);
var x = document.getElementById(mostrarEste)
if (x) x.className = "expanded";
}

function sOcultaTodas(este){
myTR = menuSolapas.getElementsByTagName('TR').item(1);

myTablesInTR = myTR.getElementsByTagName('DIV');

for (var i=0; i<myTablesInTR.length;i++){
  myTablesInTR[i].className = "collapsed";
	}
}

function sClick2(este,mostrarEste){
var x = document.getElementById(mostrarEste)
sOcultaTodas2(x);
if (x) x.className = "expanded";
}

function sOcultaTodas2(este){
myTR = este.parentNode;

myTablesInTR = myTR.getElementsByTagName(este.tagName);

for (var i=0; i<myTablesInTR.length;i++){
  myTablesInTR[i].className = "collapsed";
	}
}

function expBarAll(){
expColAll("expanded");
}

function colBarAll(){
expColAll("collapsed");
}

function expColAll(tipo){
var aTRs = document.getElementsByTagName('TR');

for (var i=0; i<aTRs.length;i++){
  if (aTRs[i].className == "hand"){
  var brother = aTRs[i].nextSibling;
	if (brother.className != tipo) {
		brother.className = tipo;
		imgExpCol(aTRs[i]);
			}
		}
	}
}

function imgExpCol(este){
	var miIndex = este.getElementsByTagName('IMG').length-1;
	var imgChild = este.getElementsByTagName('IMG').item(miIndex);

	if (imgChild){
	var splitSrcImg = imgChild.src.split('/');
	var fileSrcImg = splitSrcImg[splitSrcImg.length - 1]
	}

	if (fileSrcImg) {
		newFileSrcImg = fileSrcImg == "icoUp.gif" ? "icoDwn.gif" : "icoUp.gif";
		imgChild.src=imgChild.src.replace(fileSrcImg, newFileSrcImg);
	}
}

function SoloNumeros (){
  if (event.keyCode < 48 || event.keyCode > 57) return (event.returnValue = false);
}

function SoloDecimales (){
  if (event.keyCode < 48 || event.keyCode > 57)
		if (event.keyCode!=44)
		 return (event.returnValue = false);
}


function checkNumKey(obj,dato) {
// Obj es el objeto y dato es el value del objeto pasado
	var i, tipo;
	var longitud;
	var caracter;
	var sumo = 0;
	longitud = dato.length;
	valido = "0123456789,";

	for ( i=0; i <= longitud; i++)
	{
		caracter = dato.substring(i,i+1)
		if (valido.indexOf(caracter) == -1)
		{
			obj.value = dato.substring(0,i);
			return false;
		}
	}
	return true;
}

function EsSoloNumero(dato) {
// true si el dato es un numero , false si no lo es
	var i, tipo;
	var longitud;
	var caracter;
	var sumo = 0;
	longitud = dato.length;
	valido = "0123456789,";

	for ( i=0; i <= longitud; i++)
	{
		caracter = dato.substring(i,i+1)
		if (valido.indexOf(caracter) == -1)
		{
			return false;
		}
	}
	return true;
}


function checkNum(obj,dato,tipo){

switch (tipo) {
case '24':
if (dato >= 24) obj.value = "";
break;

case '60':
if (dato >= 60) obj.value = "";
break;
}

longitud = dato.length;

if (longitud == 1){
	var caracter = dato.substring(0,1)
	obj.value = "0" + dato;
	}
}


// dato necesario para la funcion popUpBI()
var windowBI = false;

function popUpBI(este, tipo){
var field = este.parentNode.getElementsByTagName('INPUT')[0];
var fldTarget = field.uniqueID;
var frmTarget = field.form.uniqueID;

if (!((fldTarget) && (frmTarget))) alerta("no llega algún dato");
else var biURL = '/includes/popup/bI.asp?target=' + fldTarget + '&form=' + frmTarget +'&tipo=' + tipo;

if (windowBI && !windowBI.closed && (windowBI.location.href.indexOf(biURL)!= -1)) windowBI.focus();
else  windowBI = window.open(biURL,'windowBI','scrollbars=yes,resizable=yes,width=300,height=400,top=20,left=20');
}

// function focoDNext(this) Método que accede al primer elemento del primer formulario
// que exista en el iframe donde se aplique en el evento Focus.

function focoDNext(este){
var huboElement;
miFrm = este.uniqueID;
var aElements = frames[miFrm].document.forms[0].elements;
for (i=0;i < aElements.length; i++){
	if ((aElements[i].type != 'hidden') && (!(aElements[i].disabled))) {
		frames[miFrm].document.forms[0].elements[i].focus();
		break;
		}
	}
}

function onEnter(funcion){
  if (event.keyCode == 13){
		event.returnValue=false;
		eval(funcion);
	}
}

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 abrirEnExcel(){
	var miFormTarget = frmQuery.target;
		frmQuery.target = 'miWin2Excel';
		frmQuery.ExportarAExcel.value = "si";
		frmQuery.submit();
		frmQuery.ExportarAExcel.value = "";
		frmQuery.target = miFormTarget;
}

function expandeColapsaNexus(este,idImg,img1,img2){

	var imgChild = document.all(idImg);
	var brother = este.nextSibling;

// Si el elemento hijo existe, expandirlo o colapsarlo.
	if (brother){
		if(brother.className == "collapsed"){
			brother.className = "expanded";
			imgChild.src = img1;
		}
		else{
			brother.className = "collapsed";
			imgChild.src = img2;
		}
	}

}


function expColAllNexus(tipo){
	var aTRs = document.getElementsByTagName('TR');

	for (var i=0; i<aTRs.length;i++){
	  if (aTRs[i].className == "hand"){
	  var brother = aTRs[i].nextSibling;
		if (brother.className != tipo) {
			brother.className = tipo;
//			imgExpCol(aTRs[i]);
				}
			}
		}
}

//-->
