        /*  JS Code file: itnix_menus.js */
        /*  Description: calls the style object of an HTML element and changes it to none/block */
        /*  Version: 1.0 */
        /*  All source code & concepts (c) copyright 2008, 2009 by ItNix, LLC. */
        /*  All rights reserved worldwide. */
        /*  Last change: 28jul09 */
        /*  Changed by: Ivan Carrazco */


/**
  * openMenu: opens the specified menu, menuId.
  * param: e - the event that calls this function
  * param: menuId - the name of the menu to be opened
  */
 function openMenu(e, menuId) {
    //cancelEventOrder( e );
    if( menuId != null ) {
      var menu = document.getElementById( menuId );
      menu.style.display = "block";
    }
  }



/**
  * closeMenu: closes the specified menu, menuId.
  * param: e - the event that calls this function
  * param: menuId - the name of the menu to be opened
  */
  function closeMenu(e, menuId) {
    if( menuId != null ) {
     var menu = document.getElementById(menuId);
     menu.style.display = "none";
    }
  }


/**
  * NOT WORKING
  */
  function startClosing(e) {
    //cancelEventOrder( e );

    if( counter > 0 ) {
      counter -= 100;
      var per = counter/1000;
      timer = setTimeout( "startClosing();", 100);
    }
    else {
      closeMenu(null, menuId);
    }
  }


/**
  * NOT WORKING
  */
  function cancelClosing(e) {
    cancelEventOrder( e );
    clearTimeout( timer );
    counter = 1000;
  }


/**
  * NOT WORKING
  */
  function cancelEventOrder(e) {

    var evt = e;
    if( !evt ) {
      evt = window.event;
    }
    else {

      if( evt != null &&  evt.stopPropagation ){
        evt.stopPropagation();
      }
        evt.cancelBubble = true;
      }
  }


