// ============
//
// File: menufunctions.js
// Company: Code 2 Interactive
// Last Modified: March 07, 2006
//
// Purpose: This file contains the functions necessary for the drop-down menu on the current Code 2 Interactive website to work properly.
//
// ============


// This function changes the visibility property of the object specified to the value specified
function setVisibility(objID, visValue) {
  if (document.getElementById) {
    var theObject = document.getElementById(objID);
  }
  if ( (theObject.style) && (theObject.style.visibility || theObject.style.visibility == "") ) {
    theObject.style.visibility = visValue;
  }
}

// This function changes the color property of the object specified to the value specified
function setColor(objID, colorValue) {
  if (document.getElementById) {
    var theObject = document.getElementById(objID);
  }
  if (theObject.style) {
    theObject.style.color = colorValue;
  }
}

// This function closes a menu by making it invisible
function closeMenu(menuID) {
  setVisibility(menuID, "hidden");
}

// This function opens a menu by making it visible
function openMenu(menuID) {
  setVisibility(menuID, "visible");
}

// This function sets up the drop-down navigation for the page
function initMenus() {

  // Set up the "WHO IS CODE 2?" menu
  setVisibility("whoiscode2", "visible");
  setVisibility("whoiscode2sub", "hidden");
  setVisibility("whoiscode2opt1", "inherit");
  setVisibility("whoiscode2opt2", "inherit");
  setVisibility("whoiscode2opt3", "inherit");

  // Set up the "WHAT WE DO" menu
  setVisibility("whatwedo", "visible");
  setVisibility("whatwedosub", "hidden");
  setVisibility("whatwedoopt1", "inherit");
  setVisibility("whatwedoopt2", "inherit");
  setVisibility("whatwedoopt3", "inherit");
  setVisibility("whatwedoopt4", "inherit");
  setVisibility("whatwedoopt5", "inherit");

  // Set up the "WHAT WE'VE DONE" menu
  setVisibility("whatwevedone", "visible");
  setVisibility("whatwevedonesub", "hidden");
  setVisibility("whatwevedoneopt1", "inherit");
  setVisibility("whatwevedoneopt2", "inherit");
  setVisibility("whatwevedoneopt3", "inherit");

  // Set up the "WHY CHOOSE US?" menu
  setVisibility("whychooseus", "visible");
  setVisibility("whychooseussub", "hidden");

  // Set up the "HOW MUCH?" menu
  setVisibility("howmuch", "visible");
  setVisibility("howmuchsub", "hidden");
  setVisibility("howmuchopt1", "inherit");
  setVisibility("howmuchopt2", "inherit");
  setVisibility("howmuchopt3", "inherit");

  // Set up the "CONTACT C2" menu
  setVisibility("contactc2", "visible");
  setVisibility("contactc2sub", "hidden");
}