﻿/* object */var cctvWindow;

/**
 * Click handler for logout linkbutton. Confirms with user before proceeding
 * with logout.
 */
/* void */function LogoutButton_click()
{
    if (typeof(logoutConfirmMessage) != "string")
    {
        logoutConfirmMessage = "Are you sure you want to log out?";
    }
    
    return confirm(logoutConfirmMessage);
}

/**
 * Click handler for profile deletion button. Confirms with user before proceeding with account deletion.
 */
/* void */function DeleteProfileButton_click()
{
    if (typeof(deleteProfileConfirmMessage) != "string")
    {
        deleteProfileConfirmMessage = "Are you sure you want to delete this account?";
    }
    return confirm(deleteProfileConfirmMessage);
}

/**
 * Launches the stream of a CCTV object in a popup window.
 */
/* void */var launchCctvStream = function(/* string */networkID, /* string */cameraID)
{
    // console.log("launchCctvStream");
    // console.log(arguments);

    if (typeof(networkID) == "string" && typeof(cameraID) == "string")
    {
        if (cctvWindow != null)
        {
            cctvWindow.close();
            cctvWindow = null;
        }

        cctvWindow = window.open("CameraStream.aspx?networkID=" + networkID + "&cameraID=" + cameraID, "cctvWindow", "width=350,height=300,scrollbars=1,resizable=1");
    }
}