//delay, in seconds
var maxSecondods_int = 1;

//holds value for internal JavaScript delay
var timerID = 0;

//is null when timer is inactive
var tStart  = null;


//function that is being called recursivelly - updates internal timer
function UpdateTimer() 
{
   //if timer is active
   if(timerID) 
   {
      //reset internal JavaScript timer
	  clearTimeout(timerID);
      clockID  = 0;
   }

  //if timer is halted 
  //create a new instance of date object for the starting time
   if(!tStart)
  	 tStart   = new Date();

   //create a new instance of the date object for the current time
   var   tDate = new Date();
   
   //calculate the time difference
   var   tDiff = tDate.getTime() - tStart.getTime();

   //set current time to time difference
   tDate.setTime(tDiff);

   //if current time is greater then the set delay
   if(tDate.getSeconds()>maxSecondods_int)
   {
   		
		//call function that hides drop-down nav
		hideOpen();
		
		//stop and reset clock
		Stop();
		Reset();
		
		//exit function
		return;
   }
   
   timerID = setTimeout("UpdateTimer()", 1000);
}


//start timer
function Start() 
{
   tStart   = new Date();
   timerID  = setTimeout("UpdateTimer()", 1000);
}


//stop timer
function Stop() 
{
   //if timer is on
   if(timerID) 
   {
      //stop it
	  clearTimeout(timerID);
      timerID  = 0;
   }

   //disable clock
   tStart = null;
}


//reset timer
function Reset() 
{
   tStart = null;
}
