var newLineChar = String.fromCharCode(10);
var char34 = String.fromCharCode(34);
var NavBarMenu;
var NavBarActive = false;
var NavBar = new Array();
var NavBarCount = 0;
var SiteRoot = "";
var NavBar_Supported = false;
var GlobalMenuWidth=0;
var Frame_Supported = false;
var GlobalMenuIsDropDown = false;
var SubMenuWidth = 300; // pixels
var x,y,x2,y2,x3,y3;
var MSIE = navigator.appVersion.indexOf("MSIE")!=-1;

/*
* MAIN
*/
/*
if (navigator.userAgent.indexOf("MSIE")    != -1 && 
	navigator.userAgent.indexOf("Windows") != -1 && 
	navigator.appVersion.substring(0,1) > 3)
*/
if (true)
	{
	NavBar_Supported = true;
	AddNavBar("NavBar1","background-color:white;width:100%;",400);
	if (document.URL.indexOf("\\Sites\\Phenix") != -1)
		{
		SiteRoot = "/Sites/Phenix";
		}
	}

function RootedLink(str)
{
	if (str.indexOf("http:") == 0)
		return(str);
	return(SiteRoot + str);
}

function NavigationBar(name, style, min_width)
{
	this.nvb_name = name;
	this.nvb_min_width = min_width;
	this.nvb_divs_count = 0;
	this.nvb_html_beg = newLineChar +
		"<span id='NoMenu' style='display:none;'></span>" + newLineChar +
		"<div id='NVB_" + name + "' style='" + style + "'>" + newLineChar;
	this.nvb_html_end = 
		"</div><!-- End : NVB_" + name + " -->" + newLineChar + newLineChar +
		"<script for=NVB_"+name+" event=onresize>NavBar." + name +".nvb_resize();</script>" + newLineChar +
		"<script for=NVB_"+name+" event=onmouseover>HideMenu(window.event||event,'onmouseover_navbar');</script>\n" + 
		"<script for=NVB_"+name+" event=onmouseout>HideMenu(window.event||event,'onmouseout_navbar');</script>\n" + 
		"<script type='text/javascript'>\n" + 
		"   var NavBarMenu = document.getElementById('NoMenu');\n" +
		"</script>\n" +
		"<div style='width:100%;'></div>\n";
	
	this.nvb_html_str = "";
 	this.nvb_divs = new Array();
	// methods
	this.nvb_add_div = NVB_AddDivision;
 	this.nvb_build = BuildNavBar;
	this.nvb_resize = ResizeNavBar;
	this.nvb_hide_menu = HideMenu;
	this.nvb_do_menu = DrawMenu;
}

function AddNavBar(name, style, min_width)	// For now, only one instance is allowed
{
	if (NavBarCount > 0)
		return;
	NavBar[name] = new NavigationBar(name,style, min_width);
	NavBarCount++;
}

function NVB_AddDivision(name, style)
{
	var d = new Object();
	this.nvb_divs[name] = d;
	this.nvb_divs_count++;
	
	d.div_name = name;
	if (style == "")
		d.div_beg = newLineChar + "<div id='DIV_" + name + "' style='position:relative;height:20px;border-width:0;padding:0'>\n";
	else 
		d.div_beg = newLineChar + "<div id='DIV_" + name + "' style='" + style + "'>\n";
	d.div_end = "</div><!-- End : DIV_" + name + " -->\n";
	d.div_html_str = "";
	d.div_instruments = new Array();
	d.div_instruments_count = 0;
	// methods
	d.div_add_menu_pane = NVB_AddMenuPane;
	d.div_add_picture = NVB_AddPicture;
	d.div_add_text = NVB_AddText;
	d.div_build = BuildDivision;
	return(d);
}

function NVB_AddPicture(name, image, url, help_str, target_window, style)
{
	var i = new Object();
	this.div_instruments[name] = i;
	this.div_instruments_count++;
	
	i.inst_name = name;
	i.inst_type = "picture";
	var pic = new Object();
	i.inst_picture = pic;

	pic.pic_name = name;
	pic.pic_image = image;
	pic.pic_url = url;
	pic.pic_help_str = help_str;
	pic.pic_target_window = target_window;
	pic.pic_style = style;
	pic.pic_html_str = "";
	/* methods */
	pic.pic_build = BuildPicture;
	return(pic);
}

function NVB_AddText(name, text, url, help_str, target_window, style)
{
	var i = new Object();
	this.div_instruments[name] = i;
	this.div_instruments_count++;
	
	i.inst_name = name;
	i.inst_type = "text";
	var txt = new Object();
	i.inst_text = txt;

	txt.txt_name = name;
	txt.txt_text = text;
	txt.txt_url = url;
	txt.txt_help_str = help_str;
	txt.txt_target_window = target_window;
	txt.txt_style = style;
	txt.txt_html_str = "";
	/* methods */
	txt.txt_build = BuildText;
	return(txt);
}

function NVB_AddMenuPane(name, text_font, text_bg_color, text_color, mouseover_color, pane_style)
{
	var i = new Object();
	this.div_instruments[name] = i;
	this.div_instruments_count++;
	
	i.inst_name = name;
	i.inst_type = "menu_pane";
	var mp = new Object();
	i.inst_menu_pane = mp;
	mp.mp_name = name;
	if (pane_style == "")
		{
		mp.mp_html_beg = "<div id='" + name + "_MenuPane' style='position:absolute;top:0;left:250px;height:20px;width:10px;"
			+ "color:white;background-color:black;float:right;border-width:0;padding:0;' nowrap='nowrap'>" + newLineChar; 
		}	
		else
		{
		mp.mp_html_beg = "<div id='" + name + "_MenuPane' style='" + pane_style + "' nowrap='nowrap'>" + newLineChar;
		}
	mp.mp_html_end = newLineChar + "</div><!-- End : " + name + "_MenuPane -->" + newLineChar;
	mp.mp_html_str = "";
	if (text_font == "")
		mp.mp_text_font = "bold xx-small Verdana";
	else
		mp.mp_text_font = text_font;
	if (text_bg_color == "")
		mp.mp_text_bg_color = "#009933";
	else
		mp.mp_text_bg_color = text_bg_color;
	if (text_color == "")
		mp.mp_text_color = "white";
	else
		mp.mp_text_color = text_color;
	if (mouseover_color == "")
		mp.mp_mouseover_color = "yellow";
	else
		mp.mp_mouseover_color = mouseover_color;
	mp.mp_menus = new Array();
	mp.mp_menu_count = 0;
	// methods
	mp.mp_add_menu = NVB_AddMenu;
	mp.mp_build = BuildMenuPane;
	return(mp);
}

function NVB_AddMenu(menu_id, menu_name, help_str, url, target_window)
{
	var m = new Object();
	this.mp_menus[menu_id] = m;
	this.mp_menu_count++;
	
	m.menu_id = menu_id;
	m.menu_name = menu_name;
	m.menu_help = help_str;
	m.menu_target_window = target_window;
	if (target_window = "")
		m.menu_target_window = "_top";
	m.menu_url = url;
	m.menu_html_str = "";
	m.menu_items = new Array();
	m.menu_item_count = 0;
	m.menu_char_width = 2; 
	// methods
	m.menu_add_item = NVB_AddMenuItem;
	m.menu_add_line = NVB_AddMenuLine;
	m.menu_build_submenu = BuildSubMenu; // (takes menu_pane as parameter)
}

function NVB_AddMenuItem(name, url, target_window)
{
	var mi = new Object();
	this.menu_items[this.menu_item_count] = mi;
//	this.menu_items[name] = mi;
	this.menu_item_count++;
	
	mi.mi_name = name;
	mi.mi_type = "menu_item";
	mi.mi_url = url;
	mi.mi_target_window = target_window;
	if (target_window == "")
		mi.mi_target_window = "_top";
	mi.mi_width = name.length;
	this.menu_char_width = Math.max(this.menu_char_width,name.length + 2);
	// methods
}

function NVB_AddMenuLine()
{
	var mi = new Object();
	this.menu_items[this.menu_item_count] = mi;
	this.menu_item_count++;
	
	mi.mi_name = "line_" + this.menu_item_count;
	mi.mi_type = "line";
	mi.mi_url = "";
	mi.mi_target_window = "_top";
	mi.mi_width = 1;
	// methods
}

function BuildNavBar()
{
	var d;
	with (this)
	{
	nvb_html_str = nvb_html_beg;
	for (d in nvb_divs)
		{
		nvb_html_str += nvb_divs[d].div_build();
		}
	nvb_html_str += nvb_html_end;
	return(nvb_html_str);
	}
}

function BuildDivision()
{
	var i;
	with (this)
	{
	div_html_str = div_beg;
	for (i in div_instruments)
		{
		switch (div_instruments[i].inst_type)
			{
			case "menu_pane" :
				div_html_str += div_instruments[i].inst_menu_pane.mp_build();
				break;
			case "picture" :
				div_html_str += div_instruments[i].inst_picture.pic_build();
				break;
			case "text" :
				div_html_str += div_instruments[i].inst_text.txt_build();
				break;
			default :
				break;
			}
		}
	div_html_str += div_end;
	return(div_html_str);
	}
}

function BuildMenuPane()
{	
	var m;
	var m_index;
	var MenuIDStr;
	
	with (this)
	{
	var text_style = "font:" + mp_text_font + ";background-color:" + mp_text_bg_color + ";color:" + mp_text_color 
		+ ";border-width:0;padding:0;";
	/*
		<div ...>
		<table>
		<tbody>
		<tr>
		<td id='AM_LOCAL_Profile' style='font:bold xx-small Verdana;background-color:#009933;color:white;' nowrap='nowrap'>
		<a style='text-decoration:none;cursor:auto;font:bold xx-small Verdana;color:white;' 
			target='_top' 
	 		TITLE="Profile of Org" href='/profile/index.html'
			onmouseout="mouseMenu('out','LOCAL_Profile'); HideMenu('out_of_menu_pane');"
			onmouseover="mouseMenu('over','LOCAL_Profile'); DrawMenu('LOCAL_Profile');">
			&nbsp;Profile&nbsp;
		</a>
		&nbsp;</td>
		<td style='font:bold xx-small Verdana;background-color:#009933;color:white;'>|</td>
		<tr>
		</tbody>
		</table>
		...
		</div>
	*/

	/*
	* Build menu pane itself
	*/	
	mp_html_str = mp_html_beg;
	for (m_index in mp_menus)
		{
		m = mp_menus[m_index];
		MenuIDStr = mp_name + "_" + m.menu_id;
		mp_html_str += "<td id='AM_" + MenuIDStr + "' style='" + text_style + "' nowrap='nowrap'>" + newLineChar;
		mp_html_str += "<a style='text-decoration:none;cursor:auto;vertical-align:middle;font:" + mp_text_font + ";color:" + mp_text_color + ";'";
		mp_html_str += " target='" + m.menu_target_window + "'" + newLineChar + " TITLE=" + char34 + m.menu_help + char34;
		if (m.menu_url != "")
			mp_html_str += " href='" + RootedLink(m.menu_url) + "'";
		else
			mp_html_str += " href='' onclick='var evt=window.event||event; evt.returnValue=false;'";
		mp_html_str += newLineChar + " onmouseout="  + char34 + "var evt=window.event||event; var targ=evt.srcElement||evt.target; targ.style.color ='" + mp_text_color + "';" +
			" HideMenu(evt,'out_of_menu_pane');" + char34 + newLineChar +
			" onmouseover=" + char34 + "var evt=window.event||event; var targ=evt.srcElement||evt.target; targ.style.color ='" + mp_mouseover_color + "';" + 
			" DrawMenu(evt,'"+ MenuIDStr + "');" + char34 + ">" + newLineChar +
			"&nbsp;" + m.menu_name + "&nbsp;</a>&nbsp;" + newLineChar;
		mp_html_str += "</td><td style='vertical-align:middle;" + text_style + "'>|</td>\n";
		}
	mp_html_str += mp_html_end;
	
	/*
	* Build Submenu blocks
	*/	
	mp_html_str += newLineChar + "<div id='" + mp_name + "_Submenus' style='position:relative;left:0px;height:inherit;'>\n";
	
	for (m_index in mp_menus)
		{
		m = mp_menus[m_index];
		mp_html_str += m.menu_build_submenu(this);
		}
	mp_html_str += "</div><!-- End : " + mp_name + "_Submenus -->" + newLineChar;
	
	return(mp_html_str);
	}
}

function BuildSubMenu(menu_pane) // method of menu object
{
	var mp = menu_pane;
	var mi;
	
	/*
	newLineChar + newLineChar +
	<span id='LOCAL_Profile'
		style='display:none;position:absolute;width:240;background-color:#009933;padding-top:0;padding-left:0;
			padding-bottom:20;z-index:9;' onmouseout='HideMenu("out_of_submenu");'>
		<hr style='position:absolute;left:0;top:0;color:white' SIZE=1>
		<div style='position:relative;left:0;top:8;'>
		
			<a id='AS_LOCAL_Profile'
			style='text-decoration:none;cursor:auto;font:bold xx-small Verdana;color:white'
			href='/fr/app/profile/index.htm' target='_top'
			onmouseout="mouseMenu('out' ,'LOCAL_Profile');"
			onmouseover="mouseMenu('over','LOCAL_Profile');" >
			&nbsp;L'opportunité d'une vie</a><br>
			
			<a id='AS_LOCAL_Profile'
			style='text-decoration:none;cursor:auto;font:bold xx-small Verdana;color:white'
			href='/fr/app/profile/index.htm' target='_top'
			onmouseout="mouseMenu('out' ,'LOCAL_Profile');"
			onmouseover="mouseMenu('over','LOCAL_Profile');" >
			&nbsp;L'opportunité d'une vie</a><br>

			<hr style='color:white' SIZE=1>		<-- To divide the menu items in groups with a line -->
			
			...
			
		</div>
	</span>;
	*/
	with (this)
	{
	var MenuIDStr =  mp.mp_name + "_" + menu_id;
	menu_html_str = newLineChar + 
		"<div id='" + MenuIDStr + "'" +
		" style='display:none;position:absolute;width:" + SubMenuWidth +"px;background-color:" + mp.mp_text_bg_color + ";" +
		"padding-top:0;padding-left:0;padding-bottom:20px;z-index:9;'" + " onmouseout='HideMenu(window.event||event,\"out_of_submenu\");'>\n";
	if (MSIE)
		menu_html_str += "<hr  style='position:absolute;left:0;top:0;color:" + mp.mp_text_color + ";' size='1' />" + newLineChar;
	else
		menu_html_str += "<hr  style='position:absolute;left:0;top:-8px;width:300px;color:" + mp.mp_text_color + "; ' size='1' />" + newLineChar;
	
	menu_html_str += "<div style='position:relative;left:0;top:8px;'>\n";
	var i = 0;
	for (mi in menu_items) with (menu_items[mi]) 
		{
		switch (mi_type)
			{
			case "line":
				menu_html_str += "<hr style='color:" + mp.mp_text_color + ";' size='1' />\n";
				break;
			case "menu_item":
				menu_html_str +=
					"<a id='AS_" + MenuIDStr + "_" + i++ + "'" +
					" style='text-decoration:none;cursor:auto;font:" + mp.mp_text_font + ";color:" + mp.mp_text_color + "'" +
					" href='" + RootedLink(mi_url) + "' target='" + mi_target_window + "'\n" +
					" onmouseout="  + char34 + "var evt=window.event||event; var targ=evt.srcElement||evt.target; targ.style.color ='" + mp.mp_text_color + "';\"\n" + 
					" onmouseover=\"var evt=window.event||event; var targ=evt.srcElement||evt.target; targ.style.color ='" + mp.mp_mouseover_color + "';\">\n" +
					" &nbsp;" + mi_name + "</a><br>\n";
				break;
			default:
				break;
			}
		}
	menu_html_str += "</div></div>" + newLineChar;
	return(menu_html_str);
	}
}

function BuildPicture()
{
	with (this) 
	{
	pic_html_str = "<div id='PIC_" + pic_name + "' style='" + pic_style + "'>" + newLineChar;
	if (pic_url != "")
		pic_html_str += "<a target='" + pic_target_window + "' href='" + RootedLink(pic_url) + "'>";
	pic_html_str += "<img src='" + RootedLink(pic_image) + "' alt='" + pic_help_str + "' border=0>";
	if (pic_url != "")
		pic_html_str += "</a>";
	pic_html_str += newLineChar + "</div><!-- End : PIC_" + pic_name + " -->" + newLineChar;
	return(pic_html_str);
	}
}

function BuildText()
{
	with (this) 
	{
	txt_html_str = "<div id='TXT_" + txt_name + "' style='" + txt_style + "'>" + newLineChar;
//	txt_html_str += "<table height=100% width=100% border=0 bgcolor=#ffffff><tr><td nowrap='nowrap' align=center valign=center>";
	txt_html_str += "<p>";
	if (txt_url != "")
		txt_html_str += "<a style='text-decoration:none;cursor:auto;color:black;font-size:14px;font-weight:bolder;' target='" + txt_target_window + "'" +
		" href='" + RootedLink(txt_url) + "'>";
	txt_html_str +=  txt_text;
	if (txt_url != "")
		txt_html_str += "</a>";
	txt_html_str += "</p>";
//	txt_html_str += "</b></font></td></tr></table>";
	txt_html_str += newLineChar + "</div><!-- End: TXT_" + txt_name + " -->" + newLineChar;
	return(txt_html_str);
	}
}

function ResizeNavBar()
{
	if (NavBar_Supported == false) 
		return;
		
	w = Math.max(this.nvb_min_width, document.body.clientWidth) - GlobalMenuWidth -16;
//	document.getElementById("Global_MenuPane").style.width  = (GlobalMenuWidth + w - 250) + "px";
//	document.getElementById("PIC_LocalBanner").style.left =  (GlobalMenuWidth + w - 250 - 100) + "px";
//	document.getElementById("TXT_LocalTextBanner").style.width = (GlobalMenuWidth + w - 250 - 100) + "px";
//	document.getElementById("Local_MenuPane").style.width = (Math.max(this.nvb_min_width, document.body.clientWidth) - 100) + "px";	
}

function DrawMenu(evt,menu_id)
{
	var targ=evt.srcElement||evt.target;
	var m = document.getElementById(menu_id);
	

	evt.cancelBubble = true;
	if (evt.stopPropagation) evt.stopPropagation();
			
	if (NavBarMenu == null || m == null || m == NavBarMenu) 
		return(false);
		
	// Reset dropdown menu
	NavBarMenu.style.display = "none";
	NavBarMenu = m;
	
	if (MSIE)
		x = targ.offsetLeft + targ.offsetParent.offsetLeft;
	else
		x = targ.offsetLeft + targ.offsetParent.offsetLeft;
		
	IsGlobalMenu = (menu_id.toUpperCase().indexOf("GLOBAL_") == 0);
	y = (IsGlobalMenu) ? (document.getElementById("DIV_Section1").offsetHeight) :
		 	(document.getElementById("DIV_Section1").offsetHeight 
			+ document.getElementById("DIV_Section2").offsetHeight + 
			document.getElementById("DIV_Section3").offsetHeight);
		 
	m.style.left = x + "px"; // It wants a string, otherwise Google Chrome doestn' take it !
	m.style.top = 20 + "px";
	m.style.clip = "rect(auto auto auto auto)";
	m.style.display = "block";
	
	// Get main menu title width
	x2 = x + targ.offsetWidth;
	y3 = y - targ.offsetHeight;
	
	// Get dropdown menu width
	x3 = x + SubMenuWidth;

	// Get drop	 down menu height
	y2 = y + m.offsetHeight;
	
	return(true);
}

function HideMenu(evt,str_event)
{
	var targ=evt.srcElement||evt.target;

	if (NavBarMenu != null && NavBarMenu.id != "NoMenu") 
		{
		var cX = evt.clientX + document.body.scrollLeft;
		var cY = evt.clientY + document.body.scrollTop;
		var bHideMenu = true;

		if (cY >= y3 && cY < y)
			{
			if (cX >= (x+5) && cX <= x2) 
				bHideMenu = false;
			}
		else if (cY >= y && cY <= (y2-5))
			{
			if (cX >= (x+5) && cX <= (x3-5)) 
				bHideMenu = false;
			}
	
		if (! bHideMenu) 
			{
			evt.cancelBubble = true;
			if (evt.stopPropagation) evt.stopPropagation();
			return; 
			}

		NavBarMenu.style.display = "none";
		NavBarMenu = document.getElementById("NoMenu");
		evt.cancelBubble = true;
		if (evt.stopPropagation) evt.stopPropagation();
		}
}

/*
* ====================== DEBUG FUNCTIONS
*/
function TestNavBar()
{
	AddDivision("Section1","position:relative;height:20px;z-index:2;");
		AddPicture("Section1","GlobalBanner","/images/montage_menu.gif","/index.htm","","_top",
			"position:absolute;top:0;left:0;height:62px;width:250px;overflow:hidden;vertical-align:top;");
		AddMenuPane("Section1","Global","bold xx-small Verdana", "#FFFFCC", "#009933", "red", 
			"position:absolute;top:0;left:250px;height:20px;width:10px;background-color:#FFFFCC;color:#009933;");
			AddMenu("Section1","Global","Accueil", "Accueil", "", "/test/index.htm", "_top");
				AddMenuItem("Section1","Global","Accueil","Groupe d'éducation Phénix", "/test/test1.htm", "_top");
				AddMenuLine("Section1","Global","Accueil");
				AddMenuItem("Section1","Global","Accueil","Académie Phénix", "/test/test1.htm", "_top");
				AddMenuItem("Section1","Global","Accueil","Académie des petits Phénix", "/test/test1.htm", "_top");
			AddMenu("Section1","Global","Affiliations", "Affiliations", "", "/test/index.htm", "_top");
				AddMenuItem("Section1","Global","Affiliations","Applied Scholastics", "/test/test1.htm", "_top");
				AddMenuItem("Section1","Global","Affiliations","Ministère de l'éducation du Québec","/test/test1.htm","_top");
				AddMenuItem("Section1","Global","Affiliations","Emploi Québec", "/test/test1.htm", "_top");
				
	AddDivision("Section2","position:relative;left:250px;height:42px;width:100%;");	
		AddTextBanner("Section2","LocalTextBanner","INCSRIPTIONS EN TOUT TEMPS","/index.htm","","_top",
			"position:absolute;top:0;left:0;height:42px;width:200px;vertical-align:middle;text-align:center;overflow:hidden;");	
		AddPicture("Section2","LocalBanner","/images/logoap.gif","/index.htm","","_top",
				"position:absolute;top:0;left:0;height:100px;width:100px;vertical-align:top;overflow:hidden;align:right;");

	AddDivision("Section3","position:relative;height:20px;width:100%;z-index:1;");
		AddMenuPane("Section3","Local","bold xx-small Verdana", "#009933", "white", "yellow", 
				"position:absolute;top:0;left:0;height:20px;background-color:#009933;color:white;");
			AddMenu("Section3","Local","Profile", "Profile", "", "/test/index.htm", "_top");
				AddMenuItem("Section3","Local","Profile","L'opportunité d'une vie", "/test/test1.htm", "_top");
				AddMenuLine("Section3","Local","Profile");
				AddMenuItem("Section3","Local","Profile","Une éducation complète", "/test/test1.htm", "_top");
			AddMenu("Section3","Local","Services", "Services", "", "/test/index.htm", "_top");
				AddMenuItem("Section3","Local","Services","Procédure d'admission", "/test/test1.htm", "_top");
				AddMenuItem("Section3","Local","Services","Tests académiques", "/test/test1.htm", "_top");
		
	AddDivision("Section4","position:relative;height:38px;width:100%");
	return;
}

function DebugNavBar()
{
	document.write("<p>This is a test</p><br />");
	document.write("<p>This is test line 2</p>");
	document.write("<p><xmp>" + NavBar["NavBar1"].nvb_build() + "</xmp></p>");
}


/*
* ================ PUBLIC FUNCTIONS
*/
function DrawNavBar()
{
	with (NavBar["NavBar1"])
		{
		document.write(nvb_build());
		var txt_w = Math.max(document.getElementById("TXT_LocalTextBanner").offsetWidth,110);
//		GlobalMenuWidth = Math.max(document.getElementById("Global_MenuPane").offsetWidth, (200 + txt_w));
		GlobalMenuWidth = 200;
		nvb_min_width = 250 + GlobalMenuWidth;
		nvb_resize();
		}
	return;
}

function AddDivision(name, style)
{
	with (NavBar["NavBar1"])
		{
		nvb_add_div(name,style)
		}
}

function AddPicture(div_name,pic_name,pic_file,url,help_txt,target_window,style)
{
	with (NavBar["NavBar1"])
		{
		with (nvb_divs[div_name])
			{
			div_add_picture(pic_name,pic_file,url,help_txt,target_window,style);
			}
		}
}

function AddTextBanner(div_name,banner_name,banner_text,url,help_txt,target_window,style)
{
	with (NavBar["NavBar1"])
		{
		with (nvb_divs[div_name])
			{
			div_add_text(banner_name,banner_text,url,help_txt,target_window,style);
			}
		}
}

function AddMenuPane(div_name,menu_pane_name,font,bg_color,color,mouseover_color,style)
{
	with (NavBar["NavBar1"])
		{
		with (nvb_divs[div_name])
			{
			div_add_menu_pane(menu_pane_name,font,bg_color,color,mouseover_color,style);
			}
		}
}

function AddMenu(div_name,menu_pane_name,menu_name,menu_txt,help_txt,url,target_window)
{
	with (NavBar["NavBar1"])
		{
		with (nvb_divs[div_name])
			{
			with (div_instruments[menu_pane_name].inst_menu_pane)
				{
				mp_add_menu(menu_name,menu_txt,help_txt,url,target_window);
				}
			}
		}
}

function AddMenuItem(div_name,menu_pane_name,menu_name,item_txt,url,target_window)
{
	with (NavBar["NavBar1"])
		{
		with (nvb_divs[div_name])
			{
			with (div_instruments[menu_pane_name].inst_menu_pane)
				{
				with (mp_menus[menu_name])
					{
					menu_add_item(item_txt,url,target_window);
					}
				}
			}
		}
}

function AddMenuLine(div_name,menu_pane_name,menu_name)
{
	with (NavBar["NavBar1"])
		{
		with (nvb_divs[div_name])
			{
			with (div_instruments[menu_pane_name].inst_menu_pane)
				{
				with (mp_menus[menu_name])
					{
					menu_add_line();
					}
				}
			}
		}
}




