////////////////////////////////////////////////////////////////////////////////// top menu

try
{
	var topMenu = new PopupMenu('topMenu');
	var lefty = findLeft('bar');
	var toppy = findTop('bar');

	if (toppy == null) { toppy = 79; }			// FOR IE 5.01

	// Calls a function defined in the Top Menu XSL, using the nav structure
	LoadTopMenuStructure(topMenu);
}
catch(e)
{
	window.status = "Top menu not loaded";
}


///////////////////////////////////////////////////////////////////////////  Teknet Menu
//
// CPR - 20030414 - No longer required...
//
//try
//{
//	var teknetMenu = new PopupMenu('teknetMenu');
//	lefty = findLeft('teknetselect');
//	toppy = findTop('teknetselect') + 89;

	// Calls a function defined in the Left Menu XSL, using some horrible logic
//	LoadTeknetMenuStructure(teknetMenu);
//}
//catch(e)
//{
	// window.status = "Teknet menu not loaded";
//}


///////////////////////////////////////////////////////////////////////////  Country Menu
//
//try
//{
//	var countryMenu = new PopupMenu('countryMenu');
//	lefty = findLeft('countryselect');
//	toppy = findTop('countryselect') + 11;
//
//	if (toppy == 111) { toppy = 178; }			// FOR IE 5.01
//
//	// Calls a function defined in the Left Menu XSL, using the generic content
//	LoadCountryMenuStructure(countryMenu);
//}
//catch(e)
//{
//	window.status = "Country menu not loaded";
//}
//
///////////////////////////////////////////////////////////////////////////  Left Menu

try
{
	var leftMenuHeight = 0;
	var leftMenu = new PopupMenu('leftMenu');
	lefty = findLeft('sidebar');
	toppy = findTop('sidebar') + 6;

	if (toppy == 6) { toppy = 235; }			// FOR IE 5.01

	// Calls a function defined in the main page XSL, using category data
	//if (LoadLeftMenuStructure(leftMenu))
	//{
	LoadLeftMenuStructure(leftMenu);
}
catch(e)
{
	// window.status = "Left menu not loaded";
}

if (leftMenuHeight > 0)
{
	var container = findDOM("sidebarContainer",1);
	container.height = leftMenuHeight;
}

///////////////////////////////////////////////////////////////////////////  Display menus

	try {topMenu.update(true);} catch(e){}
// CPR - 20030414 - No longer required...
//	try {teknetMenu.update(true);} catch(e){}
	try {countryMenu.update(true);} catch(e){}
	try {leftMenu.update(true);} catch(e){}
	

	var popOldOR = window.onresize;
	window.onresize = function()
	{
		if (popOldOR) popOldOR();
		try {topMenu.position();} catch(e){}
// CPR - 20030414 - No longer required...
//		try {teknetMenu.position();} catch(e){}
		try {countryMenu.position();} catch(e){}
		try {leftMenu.position();} catch(e){}
	}

	window.onscroll = function()
	{
		try {topMenu.position();} catch(e){}
// CPR - 20030414 - No longer required...
//		try {teknetMenu.position();} catch(e){}
		try {countryMenu.position();} catch(e){}
		try {leftMenu.position();} catch(e){}
	}
