var preFrame="";
var timer = null;
var timerOn = false;

	   function statbar(txt) {
  		 window.status=txt;
	   }

	   function killSession()
	   {
		window.location="index.php?s=yes";
 	   }

	   function ask_delete(formName, desc)
	   {
		if(confirm("Do you really want to delete the user '" + desc + "'?")==true)
		{
		document [formName].submit();
		}
	   }



function show(ID) {
   stopTimer();
   //document.getElementById("debug").value=preFrame;
   //document.getElementById("debug_ID").value=ID;


   if ((preFrame!="") && (preFrame!=ID)) { 
      document.getElementById(preFrame).style.display="none";
      stopTimer();	
   }

   if (document.getElementById(ID))
   {
      preFrame=ID;
      var e = document.getElementById(ID);
      e.style.display="block";
      startTimer();
   }

}

function hide(ID)
{
   stopTimer();
   if (document.getElementById(ID))
   {
      preFrame=ID;
      var e = document.getElementById(ID);
      e.style.display="none";
   }
}

function stopTimer() {
   if (timer) {
      clearInterval(timer);
      timer = null;
      timerOn = false;
   }
} 

function startTimer() {
   if (!timerOn) {
	timer = setInterval("show('')", 9000);
	timerOn = true;
   }
}

function fun_confirm(form,file)
{
	var choice=confirm("Are you sure you want to delete?: " + file);
	if (choice==true)
   	{
   		document [form].submit();
   	}
}
