/**********************************************************************
	BioWare Javascript File
	
	File: HMBio_Other.js
	
	Description: Functions and Variables called by HMBio_Arrays.js, and other misc code
	
	Created: Robin Mayne, April 11, 2002 Copyright 2002 BioWare Corp.
***********************************************************************	
	Version: 0.0.1
	
	Version History:
		0.0.1 / 11.04.02 / Created / RM

***********************************************************************/

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://nwn.bioware.com"				// dynamic control over the path to the 
	return(strRootPath);								// root of the site. 
}


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 + "'))");
			}
		}
	}
}


// BEGIN COOKIE TEST function -- Added Duleepa Wijayawardhana 03/01/02
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
 
//If cookie has been enabled in Forums stop the menus from even forming.
//if (getCookie("menus")!="1") {
//HM_IsMenu = !HM_Opera && !HM_Konqueror && !HM_IE4M && (HM_DOM || HM_NS4 || HM_IE4);
//} else {
//HM_IsMenu ="";
//}
//END COOKIE CUSTOMIZATION
