﻿// In the case one of the ASPx controls has an error it will run this
function SessionEnded(s, e)
{
    if (e.message == "Response.Redirect cannot be called in a Page callback.")
    {
	    e.handled = true;
	    window.location.href="login.aspx?logout=1&error=session_end";    
    }

}

function EditRow(s, e)
{
    if ( s.IsDataRow(e.visibleIndex) )
    {
        s.StartEditRow(e.visibleIndex);
    }    
}   

// Generic popupwindow function
function PopUpWindow(url, name, height, width)
{
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    
	newwindow=window.open(url, name, 'resizable,height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + 'screenX=' + left + ',screenY=' + top);
	if (window.focus) {newwindow.focus();}
}

function PopUpWindowPrint(url, name, height, width) 
{ 
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    
    winId=window.open(url, name,'resizable,height=' + height + ',width=' + width + ',left=' + left + ',top=' + top + 'screenX=' + left + ',screenY=' + top);

    if (window.focus) {winId.focus();}
    if (window.print) {winId.print();}
    if (window.focus) {winId.focus();}
} 

var UploadLocation = 'uploads/';

        
