function iniciaAjax(){
   var ajax;
   try{
      ajax = new XMLHttpRequest(); // XMLHttpRequest para browsers decentes, como: Firefox, Safari, dentre outros.
   }
   catch(ee)
   {
      try{
         ajax = new ActiveXObject("Msxml2.XMLHTTP"); // Para o IE da MS
      }
	  catch(e)
	  {
         try{
            ajax = new ActiveXObject("Microsoft.XMLHTTP"); // Para o IE da MS
         }
		 catch(E)
		 {
            ajax = false;
         }
      }
   }
   return ajax;
}

function mantemLogado(){
	     var ajax = iniciaAjax(); // Inicia o Ajax.
		 ajax.open("GET", "mantemLogado.php", true); // Abre a página sem retornar nada, só pra manter a sessão ativa.
		 ajax.send(null); // submete
}

function timer()
{
	mantemLogado();
	setTimeout('timer()',300000);
	//300000  = 5 minutos
	//60000 = 1 minuto
}
timer();
// The -is- object is used to identify the browser.  Every browser edition
// identifies itself, but there is no standard way of doing it, and some of
// the identification is deceptive. This is because the authors of web
// browsers are liars. For example, Microsoft's IE browsers claim to be
// Mozilla 4. Netscape 6 claims to be version 5.

var is = {
    ie:      navigator.appName == 'Microsoft Internet Explorer',
    java:    navigator.javaEnabled(),
    ns:      navigator.appName == 'Netscape',
    ua:      navigator.userAgent.toLowerCase(),
    version: parseFloat(navigator.appVersion.substr(21)) ||
             parseFloat(navigator.appVersion),
    win:     navigator.platform == 'Win32'
}
is.mac = is.ua.indexOf('mac') >= 0;
if (is.ua.indexOf('opera') >= 0) {
    is.ie = is.ns = false;
    is.opera = true;
}
if (is.ua.indexOf('gecko') >= 0) {
    is.ie = is.ns = false;
    is.gecko = true;
}
