// ------------------------
// Functions and Variables called by HM_Arrays.js
// ------------------------

var numsidenavOffset = 154; // Side Offset amount for sidenavs
var numsidenavTopOffset = 0; // Top Offset amount for sidenavs

var numtopnavOffset = -1; // Side Offset amount for topnavs
var numtopnavTopOffset = 22; // Top Offset amount for topnavs

var numtoptextOffset = 260; // Side Offset amount for toptext
var numtoptextTopOffset = 6; // Top Offset amount for toptext

function writeRootPath() 								// Called by HM_Arrays.js and rollover.js to dynamically 
{ 														// populate the URL parameters
	var strRootPath										// with the URL path. This allows 
	strRootPath = "http://www.bioware.com"				// dynamic control over the path to the 
	return(strRootPath);								// root of the site. 
}

function getMenuStartPosition(imageName) {				// Called by HM_Arrays, left_position parameter.
	var objImg
	objImg = document.images[imageName]				    // where imageName is the name/id of the image to measure from
	if (HM_NS4){
		return eval(objImg).x
	} else {
		return getXPosition(objImg);
	}
}

function getXPosition(imgElem) {						// Called by getMenuStartPosition.
	xPos = eval(imgElem).offsetLeft;
	tempEl = eval(imgElem).offsetParent;
  	while (tempEl != null) {
  		xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
  	}
	return xPos;
}		


function getMenuStartPositionTop(imageName) {				// Called by HM_Arrays, top_position parameter.
	var objImg
	objImg = document.images[imageName]				    // where imageName is the name/id of the image to measure from
	if (HM_NS4){
		return eval(objImg).y
	} else {
		return getYPosition(objImg);
	}
}

function getYPosition(imgElem) {						// Called by getMenuStartPositionTop.
	yPos = eval(imgElem).offsetTop;
	tempEl = eval(imgElem).offsetParent;
  	while (tempEl != null) {
  		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
  	}
	return yPos;
}

function hideFormLayers() {
	if (!HMBio_NS6) {		// NS6 displays form elements correctly
		// test for each known form layer
		if (typeof frmarchivesearch == "number"){
			// loop through each instance of the layer, and hide it
			for (i = 1; i < (frmarchivesearch +1); i++) { 
				eval("hideLayer(getLayer('frmarchivesearch" + i + "'))");
			}
		}
	}
}

function showFormLayers() {
	if (!HMBio_NS6) {
		// test for each known form layer
		if (typeof frmarchivesearch == "number"){
			// loop through each instance of the layer, and show it
			for (i = 1; i < (frmarchivesearch +1); i++) { 
				eval("showLayer(getLayer('frmarchivesearch" + i + "'))");
			}
		}
	}
}
