﻿function OnClientLoad(editor, args)
{
   args = ["#A21148", "#76A190", "#004C79", "#FCB917", "#B6BCBD", "#7D7E00", "#9ACFEE", "#6C4100", "#E2732C", "#786C54", "red","green","blue","#ffcccc","#ffcc99","#ffff99","#ffffcc","#99ff99","#99ffff","#ccffff","#ccccff","#ffccff","#cccccc","#ff6666","#ff9966","#ffff66","#ffff33","#66ff99","#33ffff","#66ffff","#9999ff","#ff99ff","#c0c0c0","#ff0000","#ff9900","#ffcc66","#ffff00","#33ff33","#66cccc","#33ccff","#6666cc","#cc66cc","#999999","#cc0000","#FF6600","#FFCC33","#FFCC00","#33CC00","#3366FF","#00CCCC","#6633FF","#CC33CC","#666666","#990000","#cc6600","#cc9933","#999900","#009900","#339999","#3333ff","#6600cc","#993399","#333333","#660000","#993300","#996633","#666600","#006600","#336666","#000099","#333399","#663366","#000000","#330000","#663300","#663333","#333300","#003300","#003333","#000066","#330099","#330033"];  
   editor.set_colors(args);
}


//alert Function to delete all records from Grid

function grid_deleteAll() {

    if (confirm("Are you sure to delete the selected records?") == true)
        return true;
    else
        return false;

}

//  Function : confirm cancel the form
function confirm_CancelForm() {
    if (confirm("The data you entered will be losing by clicking 'OK' and 'Cancel' will resume updating information. Are you sure to continue?") == true)
        return true;
    else
        return false;
}

function closeRadwindow() {
    GetRadWindow().Close();
}
function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)
    return oWindow;
}

function getEmailPopUpWindow(page) {
    //alert(page);
    wid = 800;
    hei = 800;
    //    var left = 330;
    //    var top = 50;

    //Get window manager
    var oManager = GetRadWindowManager();

    //Get window by userId - if it does not exist - create it!, else show it and set it as active

    // var wndName =;
    var oMailWnd = oManager.GetWindowByName(page);

    if (oMailWnd) {
        oMailWnd.Show();
        oMailWnd.SetActive(true);
    }
    else {
        var oMailWnd = window.radopen(page);
        //        left += 30;
        //        top += 30;
        //oMailWnd.SetSize(600, 346);
        //oMailWnd.MoveTo(_left, _top);
        oMailWnd.SetSize(wid, hei);
        oMailWnd.MoveTo(200, 10);
    }
    return false;
}


