/*
 * menuExpandable2.js - implements an expandable menu based on a HTML list
 * Author: Dave Lindquist (dave@gazingus.org)
 */

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    if (window.opera) {
		    var menu = document.all(menuId);
    var actuator = document.all(actuatorId);
	}

    /*actuator.parentNode.style.backgroundImage = "url(/images/plus.gif)";*/
    actuator.onclick = function() {
        var display = menu.style.display;
        /*this.parentNode.style.backgroundImage =
            (display == "block") ? "url(/images/plus.gif)" : "url(/images/minus.gif)";*/
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
}
function initializeMenu2(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    if (window.opera) {
		    var menu = document.all(menuId);
    var actuator = document.all(actuatorId);
	}

    /*actuator.parentNode.style.backgroundImage = "url(/images/plus.gif)";*/
}

	window.onload = function() {
		//Main Menu
			initializeMenu("servicesMenu", "servicesActuator");
			initializeMenu("downloadsMenu", "downloadsActuator");

		//Products Menu
			initializeMenu("computersMenu", "computersActuator");
			initializeMenu("lapaccMenu", "lapaccActuator");	
			initializeMenu("desktopMenu", "desktopActuator");
			initializeMenu("handheldMenu", "handheldActuator");
			initializeMenu2("noteMenu", "noteActuator");
			initializeMenu("workMenu", "workActuator");
			initializeMenu("cbntMenu", "cbntActuator");
			initializeMenu("hubMenu", "hubActuator");
			initializeMenu2("bareMenu", "bareActuator");
			initializeMenu("storeMenu", "storeActuator");
			initializeMenu("TVMenu", "TVActuator");
		    initializeMenu("GameMenu", "GameActuator");
		    initializeMenu("GPSMenu", "GPSActuator");
		    initializeMenu("spkMenu", "spkActuator");
		    initializeMenu("ioMenu", "ioActuator");
			initializeMenu("servMenu", "servActuator");
			initializeMenu("phoneMenu", "phoneActuator");
			initializeMenu("serverMenu", "serverActuator");				
			initializeMenu("componantsMenu1", "componantsActuator1");
			initializeMenu("electronicsMenu", "electronicsActuator");
			initializeMenu("componantsMenu", "componantsActuator");
			initializeMenu("componantsMenu", "IcomponantsActuator");
			initializeMenu("componantsMenu", "VcomponantsActuator");
			initializeMenu("adpMenu", "adpActuator");
			initializeMenu("cabMenu", "cabActuator");
			initializeMenu2("camMenu", "camActuator");
			initializeMenu2("cdvMenu2", "cdvActuator");
			initializeMenu("cdvMenu2", "cdvActuator2");
			initializeMenu2("cpuMenu1", "cpuActuator1");
			initializeMenu("caseMenu1", "caseActuator1");
			initializeMenu("cpuMenu", "cpuActuator");
			initializeMenu2("grphMenu", "gphActuator");
			initializeMenu2("hrdMenu", "hrdActuator");
			initializeMenu2("perMenu", "perActuator");
			initializeMenu("memMenu", "memActuator");
			initializeMenu("mp3Menu", "mp3Actuator");
			initializeMenu2("modMenu", "modActuator");
			initializeMenu2("mobMenu", "mobActuator");
			initializeMenu("prjMenu", "prjActuator");
			initializeMenu("prjMenu2", "prjActuator2");
			initializeMenu("scaMenu", "scaActuator");
			initializeMenu("upsMenu", "upsActuator");
			initializeMenu2("madMenu", "madActuator");
			initializeMenu("swMenu", "swActuator");
			initializeMenu("psfMenu", "psfActuator");
			initializeMenu2("prtMenu", "prtActuator");
			initializeMenu2("netMenu", "netActuator");
			initializeMenu2("nicMenu", "nicActuator");
			initializeMenu2("swhMenu", "swhActuator");
			initializeMenu("nhMenu", "nhActuator");
			initializeMenu("conMenu", "conActuator");
			initializeMenu("uncMenu", "uncActuator");
			initializeMenu("cosMenu", "cosActuator");
			initializeMenu("cmobMenu", "cmobActuator");
			initializeMenu("ccpuMenu", "ccpuActuator");
			initializeMenu("ccaseMenu", "ccaseActuator");
		//Members Menu
	}

<!--
function WAAddError(formElement,errorMsg,focusIt,stopIt)  {
  if (document.WAFV_Error)  {
	  document.WAFV_Error += "\n" + errorMsg;
  }
  else  {
    document.WAFV_Error = errorMsg;
  }
  if (!document.WAFV_InvalidArray)  {
    document.WAFV_InvalidArray = new Array();
  }
  document.WAFV_InvalidArray[document.WAFV_InvalidArray.length] = formElement;
  if (focusIt && !document.WAFV_Focus)  {
	document.WAFV_Focus = focusIt;
  }

  if (stopIt == 1)  {
	document.WAFV_Stop = true;
  }
  else if (stopIt == 2)  {
	formElement.WAFV_Continue = true;
  }
  else if (stopIt == 3)  {
	formElement.WAFV_Stop = true;
	formElement.WAFV_Continue = false;
  }
}

function WAValidateAN(formElement,value,errorMsg,allowUpper,allowLower,allowNumbers,allowSpace,extraChars,focusIt,stopIt,required)  {
  var isValid = true;
  extraChars = extraChars.replace(/&quot;/g,'"');
  if ((!document.WAFV_Stop && !formElement.WAFV_Stop) || formElement.WAFV_Continue)  {
    for (var x=0; x<value.length; x++)  {
	  var charGood = false;
	  var nextChar = value.charAt(x);
	  var charCode = value.charCodeAt(x);
	  if (allowLower)  {
	    if (charCode >= 97 && charCode <= 122)  {
		  charGood = true;
		}
	  }
	  if (allowUpper)  {
	    if (charCode >= 65 && charCode <= 90)  {
		  charGood = true;
		}
	  }
	  if (allowNumbers)  {
	    if (charCode >= 48 && charCode <= 57)  {
		  charGood = true;
		}
	  }
	  if (allowSpace)  {
	    if (nextChar == " ")  {
		  charGood = true;
		}
	  }
	  if (extraChars)  {
	    if (unescape(extraChars).indexOf(nextChar) >= 0)  {
		  charGood = true;
		}
	  }
	  if (!charGood)  {
	    isValid = false;
		x = value.length;
	  }
	}
	if (required && value=="")
	  isValid = false;
  }
  if (!isValid)  {
    WAAddError(formElement,errorMsg,focusIt,stopIt);
  }
}
function WAtrimIt(theString,leaveLeft,leaveRight)  {
  if (!leaveLeft)  {
    while (theString.charAt(0) == " ")
      theString = theString.substring(1);
  }
  if (!leaveRight)  {
    while (theString.charAt(theString.length-1) == " ")
      theString = theString.substring(0,theString.length-1);
  }
  return theString;
}

function WAValidateEL(formElement,value,errorMsg,minLength,maxLength,reformat,focusIt,stopIt,required)  {
  var isValid = true;
  if (document.getElementById(formElement.name+"___Config") && formElement.type.toLowerCase() == "hidden")  {
    var theEditor = FCKeditorAPI.GetInstance(formElement.name);
    value = theEditor.GetXHTML(true);
  }
  if ((!document.WAFV_Stop && !formElement.WAFV_Stop) && !(!required && value==""))  {
	if (reformat)  {
	  if (reformat == "left")  {
	    value = WAtrimIt(value,false,true);
	  }
	  if (reformat == "right")  {
	    value = WAtrimIt(value,true);
	  }
	   if (reformat == "both")  {
	    value = WAtrimIt(value);
	  }
    }
	if ((value.length < minLength) || (value.length > maxLength && maxLength > 0))  {
	  isValid = false;
	}
  }
  if (!isValid)  {
    WAAddError(formElement,errorMsg,focusIt,stopIt);
  }
  else if (reformat)  {
    formElement.value = value;
  }
}
function WAAlertErrors(errorHead,errorFoot,setFocus,submitForm,allowOverride)  { 
  if (!document.WAFV_StopAlert)  { 
	  document.WAFV_StopAlert = true;
	  if (document.WAFV_InvalidArray)  {  
	    document.WAFV_Stop = true;
        var errorMsg = document.WAFV_Error;
	    if (errorHead!="")
		  errorMsg = errorHead + "\n" + errorMsg;
		if (errorFoot!="")
		  errorMsg += "\n" + errorFoot;
		document.MM_returnValue = false;
		if (document.WAFV_Error!="")  {
		  if (allowOverride) {
		    if (confirm(errorMsg.replace(/&quot;/g,'"'))) {
			  document.MM_returnValue = true;
			  return;
			}
		  }
		  else {
		    alert(errorMsg.replace(/&quot;/g,'"'));
		  }
		}
		else if (submitForm)
		  submitForm.submit();
	    if (setFocus && document.WAFV_Focus)  {
		  if (document.getElementById(document.WAFV_Focus.name+"___Config") && document.WAFV_Focus.type.toLowerCase() == "hidden")  {
	        var theEditor = FCKeditorAPI.GetInstance(document.WAFV_Focus.name);
		    theEditor.EditorWindow.focus();
			setTimeout("setTimeout('document.WAFV_Stop = false;document.WAFV_StopAlert = false;',1)",1); 
		  }
		  else  {
		    document.tempFocus = document.WAFV_Focus;
			setTimeout("document.tempFocus.focus();setTimeout('document.WAFV_Stop = false;document.WAFV_StopAlert = false;',1)",1); 
		  }
        }
        else {
          document.WAFV_Stop = false;
          document.WAFV_StopAlert = false;
        }
        for (var x=0; x<document.WAFV_InvalidArray.length; x++)  {
	      document.WAFV_InvalidArray[x].WAFV_Stop = false;
	    }
	  }
	  else  {
        document.WAFV_Stop = false;
        document.WAFV_StopAlert = false;
	    if (submitForm)  {
	      submitForm.submit();
	    }
	    document.MM_returnValue = true;
	  }
      document.WAFV_Focus = false;
	  document.WAFV_Error = false;
	  document.WAFV_InvalidArray = false;
  }
}
//-->

