/*
 modification of dropdown menu example from 536 class
*/
/* define variables for "if n4 (Netscape 4), if IE (IE 4.x), 
and if n6 (if Netscape 6/W3C-DOM compliant)" */

var n4, ie, n6;

/* detecting browser support for certain key objects/methods and 
assembling a custom document object */


var doc,sty;

//build generic objects!!!
if (document.layers) {
  n4 = true;
  //Should send them somewhere else to load a browser... 
  //window.location="NN4.html";
}else if (document.all) {
  doc = "document.all.";
  sty = ".style";
  ie = true;
}else if (document.getElementById) {
  doc = "document.getElementById('";
  sty = "').style";
  n6 = "true";
 } 


//________________________________________________________________________
// mouse over (on) and mouseoff(off) color values
var oncolor = "#C8D9EC";
var offcolor = "#E8EFF7";

function changecolor(divname,colorname) {
  stopall();
  if (!n4) {
    menuObj = eval(doc + divname + sty);
    menuObj.backgroundColor = colorname;
    menuObj.cursor='pointer';
  }
}


//________________________________________________________________________
// show or hide DIV element
function showhide(divname,state) {
  divObj = eval (doc + divname + sty);
  divObj.visibility = state;
}

//________________________________________________________________________
// variables that hold the value of the currently active (open) menu
var active_submenu1 = null;
var active_submenu2 = null;
var active_menuelem = null;
var active_topelem = null;
var active_change = null;
// function closes all active menus and turns back to 'off' state
function closeallmenus() {
  if(active_submenu1 != null) {
    showhide(active_submenu1,'hidden');
  }
  if(active_submenu2 != null) {
    showhide(active_submenu2,'hidden');
  }
  if(active_menuelem != null) {
    changecolor(active_menuelem,offcolor);
  }
}

//________________________________________________________________________
// the menu close timeout variable
var menu_close_timeout = 0;

// delay in miliseconds until the open menus are closed
var delay = 500;

// function calls the closeallmenus() function after a delay
function closeall() {
  menu_close_timeout = setTimeout('closeallmenus()',delay);
}


//________________________________________________________________________
// stop all timeout functions (stops menus from closing)
function stopall() {
  clearTimeout(menu_close_timeout);
}


//________________________________________________________________________
// function controls submenus 
function controlsubmenu(submenu1,submenu2,menuelem,topelem, change) {
  stopall();
  closeallmenus();
  if (submenu1 != null) {
    showhide(submenu1,'visible');
    active_submenu1 = submenu1;
  }
  if (submenu2 != null) {
    showhide(submenu2,'visible');
    active_submenu2 = submenu2;
  }
  if (menuelem != null) {
    changecolor(menuelem,oncolor);
    active_menuelem = menuelem;
  }
}

//________________________________________________________________________
// function to send me to next page
function sendMe(where){
  //Just in case I want to do something special later...
  window.location=where;
  
}


//________________________________________________________________________
function initialize() {
  closeallmenus();
  stopall();
  adjustDiv();
}

function adjustDiv()
{
	if (n6)
	{
		var obj= eval(doc+"windows32"+sty);
		obj.top = parseInt(obj.top)-15+"px";
		obj= eval(doc+"linux32"+sty);
		obj.top = parseInt(obj.top)-15+"px";
		obj= eval(doc+"linux64"+sty);
		obj.top = parseInt(obj.top)-15+"px";
		obj= eval(doc+"faqColumn"+sty);
		obj.top = parseInt(obj.top)-15+"px";
		obj= eval(doc+"Layer1"+sty);
		obj.top = parseInt(obj.top)-45+"px";
	}
}