
		
// Shows the Menu for triggering div name
// Due to an occasional bug in IE4 on PC
//	blnTopDiv has been added as a parameter
//	This is true if the top div has triggered the function
//	and false if the nested layer has triggered it.
//	IE4 occationally incorrectly triggers the function from the nested layer!

// INITIALISE VARIABLES
var loaded = false;		// Confirms that page has fully loaded
var centerPoint = 0;	// Middle of the window
var startingPoint = 0;	// Horizontal point at which the document starts within window
var yOffset = 93;		// Vertical distance of drop down menus from top of window
var timer = ""			// Used for menu timeouts

//Finds center of window and left of page content in order to correctly position sub-menus
function findCenter() {
	if (g_strBrowType == "ie")	centerPoint = Math.round((document.body.clientWidth - 1) * 0.5);
	if (g_strBrowType == "net" || g_strBrowType == "ns6")	{
		centerPoint = Math.round((window.innerWidth - 1) * 0.5);
	};
	startingPoint = centerPoint - menuWidth;
	if (startingPoint < 0) {
		startingPoint = 0;
	}
	// Adjust starting point:
	var horizCorrect = 0;
	var pcCorrect = 1;
	// Adjust starting point for Mac NS6
	if (g_blnIsMac) {
		pcCorrect = 0;
	};
	// Adjust starting point for NS6
	if (g_strBrowType == "ns6") {
		// Adjust for scroll bar
		if ((document.height - window.innerHeight) > -12) {
			if (startingPoint > 7 + pcCorrect) {
				horizCorrect = -7 - pcCorrect;
			} else {
				horizCorrect = 0 - startingPoint;
			}
		};
	};
	// Adjust starting point for all other NS
	if (g_strBrowType == "net") {
		if (startingPoint < 18) {
			horizCorrect = 18 - startingPoint;
		} else {
			if (g_blnIsMac && document.height < window.innerHeight) {
				horizCorrect = -1;
			} else {
				horizCorrect = 1;
			}
		}
	};
	startingPoint += horizCorrect;
	//alert(startingPoint);
	// Vertical offset for NS6.0
	if (g_strBrowType == "ns6" && navigator.userAgent.indexOf("6.0") != -1) {
		yOffset = 105;
	};
};

//Set width of menu images
var prodWidth = 100;
var downWidth = 66;
var servWidth = 53;
var suppWidth = 51;
var ptnrWidth = 55;
var newsWidth = 86;
var compWidth = 58;
var commWidth = 69;
var menuWidth = 335;

var unLocked = true;
var menuHdr = "";
function setLock(condition, strDiv) {
	unLocked = condition;
	menuHdr = strDiv + "Menu";
}

//***************************************************************************
// Menu Image Rollovers
function swapImage(imgName, imgState) {
	if (loaded == true) {
 	   var theImage = findImage(document, imgName, 0);
		theImage.src = "/images/nav/btn_" + imgName + "_" + imgState + ".gif";
	};
}
//***************************************************************************


//***************************************************************************
// Highlight Nav According to Site Area
var siteMarker = "";
function whereAmI(itemName) {
	loaded = true;
	if (siteArea != "" && siteArea != "home") {
		siteMarker = siteArea + "Top";
		document.images[siteMarker].src = "/images/nav/blue.gif";
		if (itemName.search(/_/) != -1) {
		  	itemName = itemName.replace(/.*_/, ""); 	
		}
		if (siteArea == itemName || itemName == "products_downloads") {
			swapImage(siteArea, "ON");
		};
	};
};


	