﻿var count=0;
var max = 32; // max 8 hours
function Reconnect()
{
    count++;
    if (count < max)
    {
	$.get("/StaticPages/reconnect.aspx");
    }
}
window.setInterval('Reconnect()', 900000); // every 15 minutes

function openCenteredWindow(url, width, height) {
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + ",_blank,status=no,toolbar=no,menubar=no,location=no,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);
}

function OpenFile( fileUrl )
{        
    window.opener.SetUrl( encodeURI( fileUrl ) ) ;
    window.close() ;
	window.opener.focus() ;
}

function PressEnter (obj, event) 
{        
    var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;        
    if (keyCode == 13) 
    {                    
        document.getElementById(obj).click();
        return false;        
    }        
    else
    {
        return true;   
    }   
}