/******************************************************************************
* versecciones.js                                                             *
*                                                                             *
* Copyright 2005 por Jorge Louis Fernández Heredia.                           *                                                                             *                                       *
* última actualizacion: Noviembre 17, 2005.                                   *
* Hace visible los SPAN que se encuentran ocultos y oculta los que estan      *
* visibles, aunque lo hace uno a la vez, no pueden haber varios SPAN visibles *
*                                                                       *
******************************************************************************/
//Obtiene el objeto de la página
function obtenerObjeto(nombre){
	//nombre -> id del objeto que se intenta capturar
	//alert(nombre);
	if(document.getElementById) return document.getElementById(nombre);
	else{
		if(document.all) return document.all[nombre];
	}
}
/******************************************************************************/
//Muestra spans que están dentro de un menu, con un click
// muestra el span correspondiente y oculta todos los span que estén visibles.
function playBlocks(x,y,img){
	//x -> id del span
	//y -> número total de span existentes
	//img -> variable booleana que indica si existe alguna imagen asociada fuera del span q se intenta mostrar
	var i=1;
	var obj;
	x = obtenerObjeto(x);
	if(x.style.visibility=="hidden"){
		x.style.visibility="visible";
		x.style.display="block";
		var letraobj=x.id.substring(0,1); //Obetenemos la letra que ira antes del numero de span, 
					//debido a que pueden haber span internos al mismo para
					//lo cual si el principal es "a", los internos serían "b", "c", etc.
		var c=x.id.substring(1);    //Obtenemos el número de span del mismo tipo "a" o "b" para poder saber en cual nos encontramos
		obj=parseInt(c);
		//Si hay una imagen relacionada fuera del span deberá mostrarse
		if(img==true){
			var imagen;
			imagen = obtenerObjeto("img"+c);
			imagen.style.visibility="visible";
			imagen.style.display="block";
		}
		//  x.innerText=obj;
		while (i < obj){
			var letraobjsgt = letraobj + i;
			letraobjsgt = obtenerObjeto(letraobjsgt);
			letraobjsgt.style.visibility="hidden";
			letraobjsgt.style.display="none";
			if(img==true){
				imagen = obtenerObjeto("img"+i);
				imagen.style.visibility="hidden";
				imagen.style.display="none";
			}
			i=i+1;
		}
		i=obj+1;
		while (i <= y){
			var letrafin = letraobj + i;
			letrafin = obtenerObjeto(letrafin);
			letrafin.style.visibility="hidden";
			letrafin.style.display="none";
			if(img==true){
				imagen = obtenerObjeto("img"+i);
				imagen.style.visibility="hidden";
				imagen.style.display="none";
			}
			i=i+1;
		}
	}else{
		x.style.visibility="hidden";
		x.style.display="none";
	}
}

function abrirPopUp(pagina){
	window.open(pagina,"anuncio","statusbar=0,menubar=0");
}


/******************************************************/
/**JLEON**/
/*****************************************************/
if (document.layers) {n=1;ie=0}
if (document.all) {n=0;ie=1}

function init() {
        if (n) tab = document.tabDiv
		if (n) poptext = document.poptextDiv
		if (ie) tab = tabDiv.style
        if (ie) poptext = poptextDiv.style
}

function init2() {
        if (n) tab2 = document.tabDiv2
		if (n) poptext2 = document.poptextDiv2
		if (ie) tab2 = tabDiv2.style
        if (ie) poptext2 = poptextDiv2.style
}

function init3() {
        if (n) tab3 = document.tabDiv3
		if (n) poptext3 = document.poptextDiv3
		if (ie) tab3 = tabDiv3.style
        if (ie) poptext3 = poptextDiv3.style
}

function init4() {
        if (n) tab4 = document.tabDiv4
		if (n) poptext4 = document.poptextDiv4
		if (ie) tab4 = tabDiv4.style
        if (ie) poptext4 = poptextDiv4.style
}

function init5() {
        if (n) tab5 = document.tabDiv5
		if (n) poptext5 = document.poptextDiv5
		if (ie) tab5 = tabDiv5.style
        if (ie) poptext5 = poptextDiv5.style
}

var tabShow=1;



function hidepoptext() {

        if (tabShow == 0) {
        	if (n) {
                tab.visibility = "hide";
                tab.visibility = "show";
                poptext.visibility = "hide";
                tabShow = 1;
                return;
           	}

			if (ie) {
                tab.visibility = "hidden";
                tab.visibility = "visible";
                poptext.visibility = "hidden";
                tabShow = 1;
                return;
           }

  }
        if (tabShow == 1) {
        	if (n) {
                tab.visibility = "hide";
                tab.visibility = "show";
                poptext.visibility = "show";
                tabShow = 0;
       			   }
			if (ie) {
				tab.visibility = "hidden";
                tab.visibility = "visible";
                poptext.visibility = "visible";
                tabShow = 0;
				}
}
}



function hidepoptext2() {

        if (tabShow == 0) {
        	if (n) {
                tab2.visibility = "hide";
                tab2.visibility = "show";
                poptext2.visibility = "hide";
                tabShow = 1;
                return;
           	}

			if (ie) {
                tab2.visibility = "hidden";
                tab2.visibility = "visible";
                poptext2.visibility = "hidden";
                tabShow = 1;
                return;
           }

  }
        if (tabShow == 1) {
        	if (n) {
                tab2.visibility = "hide";
                tab2.visibility = "show";
                poptext2.visibility = "show";
                tabShow = 0;
       			   }
			if (ie) {
				tab2.visibility = "hidden";
                tab2.visibility = "visible";
                poptext2.visibility = "visible";
                tabShow = 0;
				}
}
}

function hidepoptext3() {

        if (tabShow == 0) {
        	if (n) {
                tab3.visibility = "hide";
                tab3.visibility = "show";
                poptext3.visibility = "hide";
                tabShow = 1;
                return;
           	}

			if (ie) {
                tab3.visibility = "hidden";
                tab3.visibility = "visible";
                poptext3.visibility = "hidden";
                tabShow = 1;
                return;
           }

  }
        if (tabShow == 1) {
        	if (n) {
                tab3.visibility = "hide";
                tab3.visibility = "show";
                poptext3.visibility = "show";
                tabShow = 0;
       			   }
			if (ie) {
				tab3.visibility = "hidden";
                tab3.visibility = "visible";
                poptext3.visibility = "visible";
                tabShow = 0;
				}
}
}

function hidepoptext4() {

        if (tabShow == 0) {
        	if (n) {
                tab4.visibility = "hide";
                tab4.visibility = "show";
                poptext4.visibility = "hide";
                tabShow = 1;
                return;
           	}

			if (ie) {
                tab4.visibility = "hidden";
                tab4.visibility = "visible";
                poptext4.visibility = "hidden";
                tabShow = 1;
                return;
           }

  }
        if (tabShow == 1) {
        	if (n) {
                tab4.visibility = "hide";
                tab4.visibility = "show";
                poptext4.visibility = "show";
                tabShow = 0;
       			   }
			if (ie) {
				tab4.visibility = "hidden";
                tab4.visibility = "visible";
                poptext4.visibility = "visible";
                tabShow = 0;
				}
}
}

function hidepoptext5() {

        if (tabShow == 0) {
        	if (n) {
                tab5.visibility = "hide";
                tab5.visibility = "show";
                poptext5.visibility = "hide";
                tabShow = 1;
                return;
           	}

			if (ie) {
                tab5.visibility = "hidden";
                tab5.visibility = "visible";
                poptext5.visibility = "hidden";
                tabShow = 1;
                return;
           }

  }
        if (tabShow == 1) {
        	if (n) {
                tab5.visibility = "hide";
                tab5.visibility = "show";
                poptext5.visibility = "show";
                tabShow = 0;
       			   }
			if (ie) {
				tab5.visibility = "hidden";
                tab5.visibility = "visible";
                poptext5.visibility = "visible";
                tabShow = 0;
				}
}
}

