var bV=parseInt(navigator.appVersion);
NS6=(!document.all && document.getElementById) ? true : false;
NS4=(document.layers ) ? true : false;
IE4=((document.all)&&(bV>=4))?true:false;
ver4 = (NS4 || IE4 || NS6) ? true : false;
isExpanded = false;
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=0+1; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        if (whichEl.visibility != "hide") {
            whichEl.pageY = nextY;
            nextY += whichEl.document.height;
        }
    }
}

function initIt(){
    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 (IE4){
	        tempColl = document.all.tags("DIV");
        	for (i=0; i<tempColl.length; i++) {
	            if (tempColl(i).className == "child") tempColl(i).style.display = "none";
        	}
	}
    }
}
function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		whichEl.visibility = "show";
	}
}
function expandIt(el) {
    if (!ver4) return;
    if (IE4) {
	expandIE(el);
    } else {
	if (NS4) {
		expandNS(el);
	}else{
		expandNS6(el);
	}
    }
}

function closeallie() { 
    tempColl = document.all.tags("DIV");
    for (i=0; i<tempColl.length; i++) {
        if (tempColl(i).className == "child") {
		tempColl(i).style.display = "none";
	}
    }
    // cierra todas las imagenes
    for (i=0; i<document.images.length; i++) {    
	if (document.images[i].name.indexOf("imEx") != -1){
	    document.images[i].src = dngif;
	}
    }

}

function expandIE(el) { 
    tempColl = document.all.tags("DIV");
    for (i=0; i<tempColl.length; i++) {
        if (tempColl(i).className == "child") {
		tempColl(i).style.display = "none";
	}
    }
    // cierra todas las imagenes
    for (i=0; i<document.images.length; i++) {    
	if (document.images[i].name.indexOf("imEx") != -1){
	    document.images[i].src = dngif;
	}
    }

    whichEl = eval(el + "Child");
    whichIm = eval("document.images['imEx" + el+"']");
    if (whichIm != null) {
        whichIm.src = upgif ;	
    }


    if (whichEl.style.display == "none") {
        whichEl.style.display = "block";
	if (whichIm != null) {
        	whichIm.src = upgif;
	}
	MM_showHideLayers(el +"Child" ,'','show');
    }
    else {
        whichEl.style.display = "none";
	if (whichIm != null) {
        	whichIm.src = dngif;
	}
	MM_showHideLayers(el +"Child" ,'','hide');
    }
}

function expandNS6(el) {
	

    // Cambio todas las imagenes a down
    //---------------------------------
    for (i=0; i<document.images.length; i++) {    
	if (document.images[i].name.indexOf("imEx") != -1){
	    document.images[i].src = dngif;
	}
    }
   

    // Cierro todos los div a hidden
    //-----------------------------------------
	tempColl = document.getElementsByTagName("DIV");
    	for (i=0; i<tempColl.length; i++) {
           whichEl = tempColl[i].getAttribute("Id");
	   if (whichEl == null){
		// nulo"
	   }else{
		   if (whichEl.indexOf('Child') != -1) {
			if (whichEl.indexOf('Foto') == -1) {
			    myElement = document.getElementById(whichEl);
			    myElement.style.visibility = 'hidden';
			}
		   }
	   }
        }

    // abro imagen
    //-------------------------------------------------
    whichIm = eval("document.images['imEx" + el+"']");
    whichIm.src = upgif;

    // muestro elemento div
    //-------------------------------------------------
    myElement = document.getElementById(el + 'Child');
    myElement.style.visibility = 'visible';


}
function expandNS(el) {
	
    // Cambio todas las imagenes a down
    //---------------------------------
    for (i=0; i<document.images.length; i++) {    
	if (document.images[i].name.indexOf("imEx") != -1){
	    document.images[i].src = dngif;
	}
    }


       for (i=0; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.id.indexOf("Parent") != -1) {
                whichEl.document.images["imEx"].src = upgif;
            }
            if (whichEl.id.indexOf("Child") != -1) {
                whichEl.visibility =  "hide";
            }
        }

    whichEl = eval("document." + el + "Child");
    if (whichEl.visibility == "hide") {
        whichEl.visibility = "show";
    }
    else {
        whichEl.visibility = "hide";
    }
    whichIm = eval("document.images['imEx" + el+"']");
    whichIm.src = upgif;

}

function expandAll(isBot) {
    newSrc = (isExpanded) ? dngif : upgif;

    if (NS4) {
        document.images["imEx"].src = newSrc;
        for (i=firstInd; i<document.layers.length; i++) {
            whichEl = document.layers[i];
            if (whichEl.id.indexOf("Parent") != -1) {
                whichEl.document.images["imEx"].src = newSrc;
            }
            if (whichEl.id.indexOf("Child") != -1) {
                whichEl.visibility = (isExpanded) ? "hide" : "show";
            }
        }

        arrange();
        if (isBot && isExpanded) scrollTo(0,document.layers[firstInd].pageY);
    }
    else {
        divColl = document.all.tags("DIV");
        for (i=0; i<divColl.length; i++) {
            if (divColl(i).className == "child") {
                divColl(i).style.display = (isExpanded) ? "none" : "block";
            }
        }
        imColl = document.images.item("imEx");
        for (i=0; i<imColl.length; i++) {
            imColl(i).src = newSrc;
        }
    }
    
    isExpanded = !isExpanded;
}

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


if (NS6) {
        firstEl = "elOneParent";
        firstInd = getIndex(firstEl);
        arrange();
	
}
if (NS4) {
        firstEl = "elOneParent";
        firstInd = getIndex(firstEl);
        arrange();
}


//onload = initIt ();



