/*
* 06/17/2002 - 14:48:29
* version: 1.2
*
* fauxMenu.js - Used in conjuction with corresponding style sheet to present a roll-over effect with out graphics
* Copyright (C) 2002 Mitchell Malloy
* mitch.malloy@dawntreader.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

  var topNavHiliteColor = '#0066C8';
  var topNavProductColor = '#FE6767';
  var topNavMyLabColor = '#7474BA';
  var topNavEventsColor = '#FDD106';
  var topNavAboutUsColor = '#009966';
  var topNavContactUsColor = '#61B1BA';
  var topNavSearchColor = '#D288FB';
  var topNavServicesColor = '#F78B07'
  var topNavNormColor = "#C8C8C8";
  var topNavPrevColor = topNavNormColor;
  var selectedIndicator = '';
  var selectedIndiContainer = '';
  var selectedTopNavDiv = '';
  var selectedTopContainer = '';
  
  /** Changes the background color of the menu item within a container
   */
  function chMenuBgColor(menuDiv, color, containerDiv) {		
  	if(document.all) { // IE && Opera
  		divItem = eval(menuDiv);
  		if(divItem.style.backgroundColor == '') { topNavPrevColor = topNavNormColor; 
  		} else { topNavPrevColor = divItem.style.backgroundColor; }
  		divItem.style.backgroundColor=color;
  	}	
  	else if(document.layers) { // NS 4
  		if(containerDiv != null) { 
  			divItem = eval('document.' + containerDiv + '.document.' + menuDiv);
  		} else { divItem = eval('document.' + menuDiv); }
  		if(divItem.document.bgColor == null) { topNavPrevColor = topNavNormColor; 
  		} else { topNavPrevColor = divItem.document.bgColor; }
  		divItem.document.open();
  		divItem.document.writeln('<html><head></head><body bgcolor="'+color+'"></body></html>');
  		divItem.document.close();
  	}
  	else if(!document.all && document.getElementById){ // NS 6
  		divItem = document.getElementById(menuDiv);
  		topNavPrevColor = divItem.style.backgroundColor;
  		divItem.style.backgroundColor=color;
  	}
  }
  
  /** Changes the style of the sub-menu arrows
   */
  function chArrowStyle(menuDiv, style, containerDiv) {
  	if(selectedIndicator == menuDiv) { style = 'subNavArrowSelected';}
    	var content = "<a class=\"" + style + "\">&nbsp;&gt;&nbsp;</a>&nbsp;";
 
  	if(document.all) { // IE && Opera
  		divItem = eval(menuDiv);
  		divItem.innerHTML=content;
  	}	
  	else if(document.layers) { // NS 4
  		if(containerDiv != null) { 
  			divItem = eval('document.' + containerDiv + '.document.' + menuDiv);
  		} else { divItem = eval('document.' + menuDiv); }
  		divItem.document.writeln('<span id="foo" class="subNavIndicator">'+content+'</span>');
  		divItem.document.close();
  	}
  	else if(!document.all && document.getElementById){ // NS 6
  		divItem = document.getElementById(menuDiv);
  		divItem.innerHTML=content;
  	}
  }
  
   /** Selects the indicator; container name required for NS4
    */
  function selectIndicator(indicatorDiv, containerName) {
  	var tmpInd = selectedIndicator;
  	var tmpCont = selectedIndiContainer;
	
  	selectedIndicator = indicatorDiv;
  	selectedIndiContainer = containerName;
  	if(tmpInd.length > 0) { chArrowStyle(tmpInd,'subNavArrow',tmpCont); }
  	chArrowStyle(indicatorDiv,'subNavArrowSelected',containerName);
  }

   /** Selects the top nav menu item; container name required for NS4
    */
  function selectMenu(menuDiv, containerDiv) {
    var tmpMDiv = selectedTopNavDiv;
    var tmpCDiv = selectedTopContainer;
  
    if(menuDiv != tmpMDiv) {
    	selectedTopNavDiv = menuDiv;
    	selectedTopContainer = containerDiv;
    	if(tmpMDiv.length > 0) {  chMenuBgColor(tmpMDiv,topNavNormColor,tmpCDiv); }
    }
  	chMenuBgColor(menuDiv,topNavHiliteColor,containerDiv);
  }

  /** Changes the message in the Service Box
   */
  function chSvcMsg(menuDiv,msg,url,targetWin,containerDiv) {
    if(url == null) { url = "#"; }
    if(targetWin == null) { targetWin = "_self"; }
    var content = '<a class="svcBoxDescFont"  target="_top" href="';
    content += url+'"  target="'+targetWin+'" onclick="refreshLeftNav();">'+msg+'</a>';
 
  	if(document.all) { // IE && Opera
  		divItem = eval(menuDiv);
  		divItem.innerHTML=content;
  	}	
  	else if(document.layers) { // NS 4
  		if(containerDiv != null) { 
  			divItem = eval('document.' + containerDiv + '.document.' + menuDiv);
  		} else { divItem = eval('document.' + menuDiv); }
  		divItem.document.writeln('&nbsp;&nbsp;&nbsp;'+content);
  		divItem.document.close();
  	}
  	else if(!document.all && document.getElementById){ // NS 6
  		divItem = document.getElementById(menuDiv);
  		divItem.innerHTML=content;
  	}
  }
  
    /** Reloads the left navigation frame
   */
  function refreshLeftNav () { 
    window.top.mlo_bottom.left_nav.location=window.top.mlo_bottom.left_nav.location;
  }
