var disappearDelay = 450;

var currentMenu = null;

if(!document.getElementById) {
	document.getElementById = function() {
		return null;
	} // document.getElementById()
} // if


function initializeMenu(menuId, actuatorId) {
	var menu = document.getElementById(menuId);
	var actuator = document.getElementById(actuatorId);

	if(menu == null || actuator == null) {
		return;
	} // if

	menu.onmouseover = function() {
		resetMenuCloseTimeout();
	} // menu.onmouseover()

	menu.onmouseout = function() {
		startMenuCloseTimeout();
	} // menu.onmouseout

    actuator.onmouseover = function() {
		if(currentMenu) {
			currentMenu.style.visibility = "hidden";
		} // if

        this.showMenu();
    } // actuator.onMouseOver()

    actuator.onclick = function() {
        if(currentMenu == null) {
            this.showMenu();
        } // if
        else {
        	closeMenubar();
        } // else

        return false;
    } // actuator.onClick()

    actuator.showMenu = function() {
        menu.style.left = 200 + this.offsetLeft + "px";
        menu.style.top = 51 + this.offsetTop + this.offsetHeight + "px";
        menu.style.visibility = "visible";
        currentMenu = menu;

		resetMenuCloseTimeout();
    } // actuator.showMenu()
} // initializeMenu


function startMenuCloseTimeout() {
	resetMenuCloseTimeout();
	closeTimer = setTimeout('closeMenubar()', disappearDelay);
} // startMenuCloseTimeout()


function resetMenuCloseTimeout() {
	if(closeTimer) {
		clearTimeout(closeTimer);
	} // if
} // resetMenuCloseTimeout()


function closeMenubar() {
	if(currentMenu) {
		currentMenu.style.visibility = "hidden";
		currentMenu = null;
	} // if
} // closeMenubar()

window.onload = function() {
	initializeMenu("servicesMenu", "servicesActuator");
	initializeMenu("supportMenu", "supportActuator");
	initializeMenu("companyMenu", "companyActuator");
	initializeMenu("contactMenu", "contactActuator");
}


// Adapted from script by
// by Nannette Thacker
// http://www.shiningstar.net
// This script checks and unchecks boxes on a form
// Checks and unchecks unlimited number in the group...
// Pass the Checkbox group name...
// call buttons as so:



function checkAll()
{
        document.myform.adddel.checked = true ;
        document.myform.upgrchange.checked = true ;
        document.myform.setupinst.checked = true ;
        document.myform.info.checked = true ;
        document.myform.cancel.checked = true ;
        document.myform.chgbill.checked = true ;
        document.myform.reg.checked = true ;
        document.myform.mailings.checked = true ;
}

function uncheckAll()
{
        document.myform.adddel.checked = false ;
        document.myform.upgrchange.checked = false ;
        document.myform.setupinst.checked = false ;
        document.myform.info.checked = false ;
        document.myform.cancel.checked = false ;
        document.myform.chgbill.checked = false ;
        document.myform.reg.checked = false ;
        document.myform.mailings.checked = false ;

}



