﻿
/*
* Display alert window when the main default page is loaded using Telerik rad window api.
*/
function DisplayAlertWindow(win, ht, open) {
    
    try {
        if (open) {
            var oManager = GetRadWindowManager();
            oWin = oManager.GetWindowByName(win);
            var theUrl;
            
            //ht = _ie ? ht : ht - _winHAF;
            
            switch (win.toLowerCase()) {
                case "alertwindow":
                    theUrl = null;
                    oWin.Show();
                    oWin.SetHeight(ht);
                    break;
                default:
                    break;
            }
        }
        else {
            try {
                var oManager = GetRadWindowManager();
                var oWnd = oManager.GetWindowByName(win);
                oWnd.Close();
            }
            catch (e) { }
        }
    }
    catch (e) { alert(e.message); }
}

/*
* Returns true if alert window is visible, false otherwise.
*/
function IsAlertWindowOpen(win) {
    
    try {
        var oManager = GetRadWindowManager();
        var oWnd = oManager.GetWindowByName(win);
        if (oWnd.IsVisible()) return true;
    }
    catch (e) { alert(e.message); }
    return false;
}

/*
* Reload alert window if it has been displayed before preferably with the new data.
*/
function ReloadAlertWindow(win) {
    
    try {
        var oManager = GetRadWindowManager();
        var oWnd = oManager.GetWindowByName(win);
        oWnd.Reload();
    }
    catch (e) { }
}