//================================================================================
//== Menu Functions - functions for the new MiniMenu.
//==  Also, functions and globals from V2 Menu.php and MenuBuild.php while transitioning
//================================================================================

var mm_SubMenu = 0;
var GLOBALTIMEOUT = 240;
var intervalEvent = setInterval('decrementTimer()', 60000);//if this timer doesn't get set, no timeout will happen
var mm_logonUID = '';

function mm_Open()
{
	mm_Close();
	mm_SubMenu = $(this).find('ul').eq(0).css('visibility', 'visible');
}

function mm_Close()
{
	if( mm_SubMenu ) $(mm_SubMenu).css('visibility', 'hidden');
}


$(document).ready(function ()
{
	ResetGlobalTimeOut();
   //== Bind MiniMenu actions
   $('#MiniMenu > li').bind('mouseover', mm_Open);
   $('#MiniMenu > li').bind('mouseout',  mm_Close);
});

document.onclick =  mm_Close;
//== Only close on left click, not right as well.
//== Sadly normal event si njot being processed ??
//==  1-left, 2=middle, 3=right
//$(document).mousedown(function(event) {
//	alert (event.which);
//	if (event.which == 1)
//	{
//		mm_Close();
//	}
//});

//== End MiniMenu functions
//================================================================================

//Utility functions (These are pretty useless due to the single-threaded nature of javascript...re-design to maybe use events?)
//== These remain useful for AJAX calls and page-load indicators
function beginWait() 
{ 
	document.documentElement.className = 'waitCursor'; 
}
function endWait() 
{ 
	document.documentElement.className =  ''; 
}

//===================================================
//== TEMP Stuff for launching Dave's Budget Grid :-((
//===================================================

  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
  {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } 
  else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
  {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//== RCM Adjusting because bottom navigation bar is not in the right place
myHeight += 150;
