var openId = new Array();
checkOpenBrothers()

function checkOpenBrothers()
{
	for (var i=0; i<openId.length; i++)
	{
		if (openId[i]=='2')
		{
			LevelID='id'+i;
			document.getElementById(LevelID).style.visibility = "hidden";
			openId[i]=='1'
		}
	}
	flag=0;
	
//	setTimeout("checkOpenBrothers()",1000);
//	document.write('.');
}

function openBrothers(open,i)
{
	var LevelID='id'+i;
	var CellID='cell'+i;

	document.getElementById(CellID).className = "brotherInit";

        if (open == '1')
        {
		openId[i]='1';
		document.getElementById(LevelID).style.visibility = "visible";
		document.getElementById(CellID).className = "brotherInAct";
	}
	else 
	{
		openId[i]='2';
		setTimeout("checkOpenBrothers()",1000);
	}
}

function active_node(url,node)
{
	if (url!='') str='<td class="normNode" onMouseOver="className=\'actionNode\'" onMouseOut="className=\'normNode\'" onClick="location=\''+url+'\'">'+node+'</a></td>';
	else str='<td class="normNode_empty" onMouseOver="className=\'actionNode_empty\'" onMouseOut="className=\'normNode_empty\'">'+node+'</td>';
	return str;
}

function create_brothers(brotherNode, id, dynamicNode)
{
	var str='';
	str='<td onMouseOver="openBrothers(1,'+id+')" onMouseOut="openBrothers(0,'+id+')"><img id="cell'+id+'" class="brotherInit" src="img/nav_skins/1x1.gif" /><br/>';
	str+='<table cellpadding="0" cellspacing="0" id="id'+id+'" class="navPopUp">';
        for(var i=0; i<brotherNode.length; i=i+3)
        {
		str+='<tr>'+active_node(brotherNode[i+1],brotherNode[i])+'</tr>';
	}

	str+='<tr>'+active_node(dynamicNode,'...')+'</tr>';
	
	str+='</table>';
	return str;
}

function create_nav()
{
	var arg = create_nav.arguments;
	var str = '<table cellpadding="0" cellspacing="0"><tr>';
	
        for(var i=0; i<arg.length; i=i+1)
        {
		nameLabel=arg[i++];
		urlLabel=arg[i++];
		descriptionLabel=arg[i++];
		brotherNodes=arg[i++];
		dynamicNode=arg[i++];

		
		if (brotherNodes!='')
		{
			str+='<td class="decoration"><img src="img/nav_skins/1x1.gif" /></td>';
			str+=create_brothers(brotherNodes, i, dynamicNode);
			str+='<td class="decoration"><img src="img/nav_skins/1x1.gif" /></td>';
		}
		else
		str+='<td><img class="seporate" src="img/nav_skins/1x1.gif" /></td>';
		
		if (urlLabel!='') {str+='<td class="label"  onMouseOver="className=\'actionLabel\'" onMouseOut="className=\'Label\'" onClick="location=\''+urlLabel+'\'">'+nameLabel+'</td>';}
		else {str+='<td class="label">'+nameLabel+'</td>';}
        }
	
	str+='</tr></table>';
	document.write(str);

}

