var bV=parseInt(navigator.appVersion);
NS4=(document.layers) ? true : false;
var agt = navigator.userAgent.toLowerCase();
NS5 = (navigator.appVersion.charAt(0) >= "5") ? true : false;
IE4=(!NS5 && (document.all) && (bV>=4))?true:false;


ver4 = (NS4 || IE4 || NS5) ? true : false;
function navOver(imName,dir,over,bot) {
if (!document.images) {return};
whichIm = (NS4 && bot) ? document.elFooter.document.images[imName] : document.images[imName];
if (over) {whichIm.src = "../art/b_" + dir + "_over.gif"}
else {whichIm.src = "../art/b_" + dir + ".gif"}
}
function navPress(imName,dir,press,bot) {
whichIm = (NS4 && bot) ? document.elFooter.document.images[imName] : document.images[imName];
if (press) {whichIm.src = "../art/b_" + dir + "_down.gif"}
else {whichIm.src = "../art/b_" + dir + ".gif"}
}
function expandIt(){return}
function expandAll(){return}
isExpanded = false;
isDynamic = true;
preExpand = '';
preExpand2 = '';
function getIndex(el) {
	ind = null;
	for (i=0; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.id == el) {
			ind = i;
			break;
		}
	}
	return ind;
}

function arrange() {
	nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
	for (i=firstInd+1; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.visibility != "hide") {
			whichEl.pageY = nextY;
			nextY += whichEl.document.height;
		}
	}
}

function initIt(varShow,showLast){
	var exs0,exs1,exs2,exs3;

  if (isDynamic) {
  	if (NS4) {
		for (i=0; i<document.layers.length; i++) {
			whichEl = document.layers[i];
			if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
		}
		arrange();
	} else if (NS5) {
	        tempColl = document.getElementsByTagName("DIV");
		for (i=0; i<tempColl.length; i++) {
			if (tempColl.item(i).className == "child") tempColl.item(i).style.display = "none";
		}		
	} else {
		tempColl = document.all.tags("DIV");
		for (i=0; i<tempColl.length; i++) {
			if (tempColl(i).className == "child") tempColl(i).style.display = "none";

			if (tempColl(i).id == "opcion0Child")
				exs0 = true;
			if (tempColl(i).id == "indice0")
				exs1 = true;
			if (tempColl(i).id == "nav0Child")
				exs2 = true;
			if (tempColl(i).id == "nav1Child")
				exs3 = true;

		}
	}
        if (preExpand != '') {
	  expandIt(preExpand);
        }
	if (preExpand2 != '') {
	  expandIt(preExpand2);
        }

	whichEl = eval("indice" + varShow);
	whichEl.className = "link2b";

	if(exs0){
		whichEl = eval("opcion" + varShow + "Child");
		whichEl.style.display = "block";			//Mostrar el primer bloque
	}


	if(exs1){
		whichEl = eval("indice" + "0");
		whichEl.className = "link2b";
	}
	if(varShow > 0) {
			exs2 = false;
	}
	if(exs2){
		whichEl = eval("nav" + "0" + "Child");
		whichEl.style.display = "none";			//Ocultar el boton de anterior
	} else {
		whichEl = eval("nav" + "0" + "Child");
		whichEl.style.display = "block";			//Ocultar el boton de anterior
	}

	if(exs3){
		if(showLast == 1) {
			whichEl = eval("nav" + "1" + "Child");
			whichEl.style.display = "block";			//Ocultar el boton de anterior
		} else {
			whichEl = eval("nav" + "1" + "Child");
			whichEl.style.display = "none";			//Ocultar el boton de anterior
		}
	}


  }
}

function expandIt(el) {
	if (!ver4) return;
	if (IE4) {expandIE(el)} else if (NS5) {expandNS5(el)} else  {expandNS(el)}
}

function expandIE(el) { 
	whichEl = eval(el + "Child");
	
	if (whichEl.style.display == "none") {
		whichEl.style.display = "block";
		
	}
	else {
		whichEl.style.display = "none";
		
	}
}

function showThis(idel,maximo){
	pos = idel;
	if(pos==0){
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "block";
		pos=1;
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "none";
		pos=2;
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "none";
		return 1;
	}
	if(pos==1){
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "block";
		pos=0;
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "none";
		pos=2;
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "none";
		return 1;
	}
	if(pos==2){
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "block";
		pos=0;
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "none";
		pos=1;
		whichEl = eval("opcion" + pos + "Child");
		whichEl.style.display = "none";
		return 1;
	}
}



function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		whichEl.visibility = "show";
	}
}

function showTop() {
       for (i=firstInd; i<document.layers.length; i++) {
	 whichEl = document.layers[i];
       }
}

with (document) {
	write("<STYLE TYPE='text/css'>");
	if (NS4) {
		write(".parent {position:absolute; visibility:show}");
		write(".child {position:absolute; visibility:hidden}");
		write(".regular {position:absolute; visibility:show}")
	}
	else {
		write(".child {display:none}")
	}
	write("</STYLE>");
}

