
		
// 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 = 59;
var downWidth = 59;
var servWidth = 59;
var suppWidth = 59;
var ptnrWidth = 59;
var newsWidth = 59;
var compWidth = 59;
var commWidth = 59;
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/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");
		};
	};
};
//***************************************************************************


//***************************************************************************
//Start Home page animation

if (document.images) {
animation = new Image(277,60); animation.src = "/images/home/anim.gif";
}

/* Function that swaps images. */

function loadAnimation(page) {
    var page = page;
	var theImage = findImage(document, "animation", 0);
    if (theImage) {
        theImage.src = "/images/home/anim.gif"
    }
	rotateNews(page);
}

/* Functions that track and set toggle group button states. */

function findImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = findImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

//***************************************************************************
// International Site Navigation
var internationalSites = new Array()
	internationalSites["it"] = "../it/index.aspx"
	internationalSites["en"] = "../en/index.aspx"
	internationalSites["fr"] = "work_in_progress.aspx"
	internationalSites["sp"] = "work_in_progress.aspx"
	
function goInternational(country) {
	if (country != "") {
		window.location = internationalSites[country]
	}
}
//***************************************************************************

