
/* T R E E  D R A W I N G  M E T H O D S */

function getTreeColorFromDepth (depth)
{
	switch (depth)
	{
		case 0: return color2;
		default: return color1;
	}
}



function tree_drawItem (idx, depth, name, url, group, selected_state)
{
	var item;
	var size = depth * 6;
    var divid="leaf";
    if (group) divid="tree";
	
	document.write (" \
	<DIV id='"+divid + idx + "' style='position: absolute; z-index: " + (100 - depth) + "'> \
	<TABLE height='20' width='148' cellpadding='0' cellspacing='0' border='0' > \
	<TR height='19' bgcolor='" + getTreeColorFromDepth (depth) + "'> \
	<TD width='" + size + "'><IMG src='"+img_blank+"' width='5' height='1'></TD> ");
	
	if (group)
	{
        document.write ("<TD id='"+divid + idx + "_img' width='14'><IMG id='img"+idx+"' src='"+img_closed+"' border='0'></TD>");
	}
	else
	{
        document.write ("<TD id='"+divid + idx + "_img' width='14'><IMG src='"+img_leaf+"'></TD>");
	}
	
	document.write ("\
	<TD id='"+divid + idx + "_name' width='133' class='menutop'>" + name + "</TD> \
	</TR> \
	<TR><td colspan='3' height='1' bgcolor='#FFFFFF'><IMG src='/extra/img/ligne_white_nav.gif' border='0'></td></TR> \
	</TABLE></DIV> \
	");
	item = document.getElementById (divid + idx);
	//item.url = url;


	item.xsize = 133;
	item.ysize = 20;
	
	return item;
}



/*  M E N U  D R A W I N G   M E T H O D S  */

var compt = 0;
function drawMenuRoot (idx, data)
{
	var item;
	
	var hasUrl = (data[idx][0].length >= 2);
	var color = false;
	try
	{
		color = data[idx][0][2];
	}
	catch(e){}
	
	document.write (" \
	<DIV id='menu" + idx + "' style='position: absolute; z-index: 300'> \
	<TABLE cellspacing='0' cellpadding='0' border='0' height='15'> \
	<TR> \
	");
	
	
	if (compt == 0)
	{
	document.write (" \
	<TD id='menu_" + idx + "' background='/extra/img/nav/fondnav"+idx+".gif' class='fondnav"+idx+"' align='center' width='98' onmouseover='menu_divs_visible();'>" + data[idx][0][0] + "</TD> \
	<TD width='20' height='15'><IMG src='" + img_blank + "' height='15' width='1'></TD> \
	</TR> \
	</TABLE> \
	</DIV> \
	");
	}
	if (compt != 0)
	{
	document.write (" \
	<TD id='menu_" + idx + "' background='/extra/img/nav/fondnav"+idx+".gif' class='fondnav"+idx+"' align='center' width='98' onmouseover='menu_divs_hidden ();'>" + data[idx][0][0] + "</TD> \
	<TD width='20' height='15'><IMG src='" + img_blank + "' height='15' width='1'></TD> \
	</TR> \
	</TABLE> \
	</DIV> \
	");
	}
	
	
	
	item = document.getElementById ("menu" + idx);
	
	if (hasUrl)
	{
		item.url = data[idx][0][1];
		item.onclick = menu_click;
	}
	item2 = document.getElementById ("menu_" + idx);
	
	/*
	if( color )
	{
		if( menu_color )
		item2.bgColor = menu_color (true);
	}
	
	
	else
	{
		item2.onmouseover = menu_setActive;
		item2.onmouseout = menu_setInactive;	
	}
	*/
	compt = 1;
	return item;
}


function drawMenuContent (idx, data)
{
	var content;
	
	document.write (" \
	<DIV id='menu" + idx + "_content' style='position: absolute; z-index: 300'> \
	<TABLE cellspacing='0' cellpadding='0' border='0' bgcolor='"+color2+"' height='18'> \
	");
	
	for (var i = 1; i < data[idx].length; i++)
	{
		document.write (" \
		<TR height='18'> \
		<TD id='menu"+idx+"_"+i+"' class='menutop'>&nbsp;&nbsp;" + data[idx][i][0] + "&nbsp;&nbsp;</TD> \
		</TR> \
		<tr><td height='1' bgcolor='#FFFFFF'><img src='/extra/img/00.gif' height='1' width='1' border='0'></td></tr> \
		");

		var td = document.getElementById ("menu"+idx+"_"+i);
		
		td.url = data[idx][i][1];
		td.onmouseover = menu_setActive;
		td.onmouseout = menu_setInactive;
		td.onclick = menu_click;
		
	}
	
	document.write (" \
	</TABLE> \
	</DIV> \
	");
	
	content = document.getElementById ("menu" + idx + "_content");
	
	return content;
	
	

	
	
	
}

