// JavaScript Document

	function changeClassH(Colum)
	{
		cellOld = document.getElementById(Colum);
		cellOld.className = "BkMenuH";
	}
	function changeClass(Colum)
	{
		cellOld = document.getElementById(Colum);
		cellOld.className = "BkMenu";
	}
	
function MM_showLayers(nome) {
obj = document.getElementById(nome);
if (obj.style.display == 'block');
	obj.style.display = 'block';
}

function MM_hideLayers(nome) {
obj = document.getElementById(nome);
if (obj.style.display == 'none');
}

function showHideLayer(layer, option) { 
	styleObj = document.getElementById(layer).style; 
		if (option == 1) styleObj.display = 'block'; 
		else if (option == 0) styleObj.display = 'none' }

function changeTab(index){

	if (index != startIndex){
	
		imgLeft = document.getElementById("leftCorner"+index);
		imgRight = document.getElementById("rightCorner"+index);
		cell = document.getElementById("tdTab"+index);
		
		if (startIndex != ""){
			imgLeftOld = document.getElementById("leftCorner"+startIndex);
			imgRightOld = document.getElementById("rightCorner"+startIndex);
			cellOld = document.getElementById("tdTab"+startIndex);
			
			imgLeftOld.src = 'images/cornerL_off.gif';
			imgRightOld.src = 'images/cornerR_off.gif';
			cellOld.className = "tbTab";
			
			showHideLayer('layerTab'+startIndex, '0');
		}
		startIndex = index;
		
		imgLeft.src = 'images/cornerL.gif';
		imgRight.src = 'images/cornerR.gif';
		cell.className = "tbTab_on";
		
		showHideLayer('layerTab'+index, '1'); 	
	}
}


function toggleLeafs(strDivName, strImgName, strExpandImgSource, strCollapseImgSource)
{
    //Unfold the branch if it isn't visible
    if (eval (document.getElementById(strDivName)).style.display == 'none')
    {
        expand(strImgName, strExpandImgSource, strDivName);
    }
    else //Collapse the branch if it IS visible
    {
        collapse(strImgName, strCollapseImgSource, strDivName);
    }
}


function collapse(strImgName, strImgSource, strDivName)
{
    //Collapse the branch
    eval (document.getElementById(strDivName)).style.display = 'none';

    //Change the image
    document.images[strImgName].src = strImgSource
}

//***********************************************************************************
//Function  : expand
//Purpose   : Expand the leafs defined in the document.
//Parameters: strImgName -> The image name used in the html.
//            strImgSource -> The FQN of the image file name used for showing the
//                              expanded leafs.
//            strDivName -> The name/id of div which builds the leaf struture in HTML
//***********************************************************************************
function expand(strImgName, strImgSource, strDivName)
{
    //Expand the branch
    eval(document.getElementById(strDivName)).style.display = 'block';

    //Change the image
    document.images[strImgName].src = strImgSource;

}