//*********************************************************************************
//* Dynamic browser include
var pinc1 = "<script language=\"javascript\" src=\"plugins\/MenuTop\/mnut";
var pinc2 = ".js\"><\/script>";

if (is_ie4)
	document.write(pinc1 + "ie4" + pinc2);
else if (is_ie5up)
	document.write(pinc1 + "ie5" + pinc2);
else if (is_nav4)
	document.write(pinc1 + "ns4" + pinc2);
else if (is_nav5up){
	document.write(pinc1 + "ns6" + pinc2);
}
	
//else
//	alert("Your browser will not work with this website");

// Call backs
var OnMenuStart     = 0;
var OnMenuEnd       = 0;
var OnBarCreate     = 0;
var OnBarItemCreate = 0;
var OnBarItemOver   = 0;
var OnBarItemOut    = 0;
var OnBlockCreate   = 0;
var OnItemCreate    = 0;
var OnItemOver      = 0;
var OnItemOut       = 0;
var OnLink          = 0;

// Import customisations

	document.write("<script language=\"javascript\" src=\"plugins\/MenuTop\/config\/mnutcust.js\"><\/script>");
	

// Common Variables
var wW, wH;			// Window Width and Window Height
var mA;             // The array to build the menu from
var pmnuWidth = 0;  // Minimum width of the menu after all the items have been added
var pResize =0;        // User defined resize event
var pLen = 0;       // Length of the array
var tli = new Array();
var tliLen = 0;
var hideThis = 0;

// Timers
var blockTimer;
var mTimer;

var mTitleRE  = /%TITLE/ig;
var mChildRE  = /%CHILD/ig;

// Common Functions
function DoLink()
{
	window.clearTimeout(blockTimer);
	if (!OnLink || OnLink(this))
	{
		mTimer = window.setTimeout("Go(" + this.idx + ")", 0);
	}
}

function topMouseOut()
{
	hideThis = this;
	blockTimer = window.setTimeout("hideAll()", 500)
}

function BlockMouseOver()
{
	window.clearTimeout(blockTimer);
}

function BlockMouseOut()
{
	blockTimer = window.setTimeout("hideAll()",500)	
}

function ItmMouseOver()
{
	//alert("in ItmMouseOver");
	this.parent.selectitem(this);
	if (this.childBlock == -1)
		this.childBlock = buildBlock(this.idx + 1);		

	if (this.childBlock)
	{
		if (!this.childBlock.isVisible) this.parent.hide(false);
		//alert("about to call setPosition");
		this.childBlock.setPosition(this);
		this.childBlock.show();
	}
	else
		this.parent.hide(false);
}

// starts the Menu
function startTopMenu()
{
	pmnuWidth = 0;  // Minimum width of the menu after all the items have been added
	pResize = 0;        // User defined resize event
	pLen = 0;       // Length of the array
	tli = new Array();
	tliLen = 0;
	hideThis = 0;
	if (OnMenuStart) OnMenuStart();
	pLen = mA.length;
	buildBar();
	buildMenu(mnuPreBuild);
	if (OnMenuEnd) OnMenuEnd();
	getDocSize();
}
