var timeOutId=null;
function autoRefresh()
{            
      window.location=location.href;     
}
function timeOut(maxInactiveInterval)
{            
   timeOutId = setTimeout('autoRefresh()', (maxInactiveInterval-60)*1000);
}

function sessionRefresh(basePath, maxInactiveInterval)
{
    clearTimeout(timeOutId);
    var func = "sendRequest('" + basePath + "/ajaxRequest.do?p=t')";
    setInterval(func, (maxInactiveInterval-50)*1000);
}

function sendRequest(url) {
    url += "&rid=" + Math.random();
    var xmlHttp=GetXmlHttpObject();
    if( !xmlHttp ) return;
    if (xmlHttp.overrideMimeType) {
        xmlHttp.overrideMimeType('application/text');
    }

    //xmlHttp.onreadystatechange=function() { onStateChanged(xmlHttp,postProcess); };
    try {
        xmlHttp.open("GET",url,true);
        var req = xmlHttp.send(null);
    } catch(e) {
    }
}

function GetXmlHttpObject(){
    var xmlHttp=null;
    try{
        // Firefox, Opera 8.0+, Safari
        xmlHttp=new XMLHttpRequest();
    }catch (e){
    // Internet Explorer
    try{
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
    try{
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }catch (e){
    return null;
}
}
}
return xmlHttp;
}
