// JavaScript Document
function openId(id) {
	document.getElementById(id).style.display = "block";
}
function closeId(id) {
	document.getElementById(id).style.display = "none";
}


 function ShowHideMenu(id)
 {
   if (document.all)
   {
		 if(document.all[id].style.display == 'none')
		 {
			document.all[id].style.display = '';
		 } 
		 else 
		 {
			document.all[id].style.display = 'none';
		 }
	
		return false;
	} 
	else if (document.getElementById)
	{
		 if(document.getElementById(id).style.display == 'none')
		 {
			document.getElementById(id).style.display = 'block';
		 } 
		 else 
		 {
			document.getElementById(id).style.display = 'none';
		 }

  	return false;
   }
 }

function turnOffMenu(id)
{

	  if (document.all)
	  {
			document.all[id].style.display = 'none';
	  }
	  else if (document.getElementById)
	  {
       		document.getElementById(id).style.display = 'none';
      }
}

function turnOnMenu(id)
{
	  if (document.all)
	  {
      		document.all[id].style.display = '';
      }
	  else if (document.getElementById)
	  {
			document.getElementById(id).style.display = 'block';
      }
}

function turnOffAllMenu()
{
	if (document.all)
	{
		document.all[projects].style.display = 'none';
		alert("hi!")
		document.all[employees].style.display = 'none';
		document.all[reports].style.display = 'none';
		document.all[company].style.display = 'none';
		document.all[clients].style.display = 'none';
		return false;
	}
}

function changeStyleById(id){
if (document.getElementById)
   {
   var nodeObj = document.getElementById(id)
   nodeObj.style.backgroundColor = '#383f8d';
   }
}

function resetchangeStyleById(id){
if (document.getElementById)
   {
   var nodeObj = document.getElementById(id)
   nodeObj.style.backgroundColor = '#6673a0';
   }
}



var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 1
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        //alert("You have just wasted 10 seconds of your life.")
		turnOffMenu('navmenu01')
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}


