
$j = jQuery.noConflict();

function TrinetraCustomAlerts(msg) {
   
    // msg = "selectAlarmStatus \n \n select</br>Alarms";
    var divtag = '<div id="dialog-confirm" title="" class="ddd" style="display: none;>  <span class="ui-icon ui-icon-alert"> <div style="float:left"><img class="warning" src="images/warning.png" /> </div> <div style="margin-left: 50px;margin-top: 5px;line-height:15px;" id="msg">@msg  </div> </span></div>'
    // alert(msg);
    divtag = divtag.replace("@msg", msg);
    // $("#.ui1-dialog .ui1-dialog-buttonpane .ui1-dialog-buttonset").css({ "padding-left": "150px;" });
    // $('#msg').html(msg)

    //var id = btn.id;
    //if ($j("#ctl00_MainContent_TextBox1").val() == "") {

    var dlg = $j(divtag).dialog({
        // title: "",
        autoOpen: true,
        width: 'auto',
        modal: true,
        draggable: true,
        closeOnEscape: false,
        buttons: {
            Ok: function () {               
                $j(this).dialog("close");
                return true;
             
            }
        },
        show: {
            effect: "fade",
            duration: 500
        },
        hide: {
            effect: "fade",
            duration: 400
        }

        // dialogClass: 'main-dialog-class'
    })
    //document.getElementById("msg").innerHTML = msg;
    //var text = document.getElementById('msg');
    return false;
    //}
}


function TrinetraConfirm(elementName, msg) {
    var answer;
    answer = elementName.id;
    // msg = "selectAlarmStatus \n \n select</br>Alarms";
    var divtag = '<div id="dialog-confirm" title="" class=" " style="display: none;>  <span class="ui-icon ui-icon-alert"> <div style="float:left"><img class="warning" src="../css/CustomeAlert/themes/images/Confirm.png" /> </div> <div style="margin-left: 50px;margin-top: 5px;line-height:15px;" id="msg">@msg  </div> </span></div>'
    // alert(msg);
    divtag = divtag.replace("@msg", msg);
    //$("#.ui1-dialog .ui1-dialog-buttonpane .ui1-dialog-buttonset").css({ "padding-left": "120px;" });
    // $('#msg').html(msg)
    var dlg = $j(divtag).dialog({
        closeOnEscape: false,
        type: confirm,
        modal: true,
        width: 'auto',
        closeOnEscape: false,
        resizable: true,
        buttons: {
            Ok: function () {               
                ShowPopUp();
                __doPostBack(elementName, null);
                $j(this).dialog("close");
                return false;

            },

            Cancel: function () {

                $j(this).dialog("close");
                return false;
            }
        },
        show: {
            effect: "fade",
            duration: 500
        },
        hide: {
            effect: "fade",
            duration: 400
        }
        // dialogClass: 'main-dialog-class'
    })
    return false;
    //}
}

function TrinetraConfirmKPI(elementName, msg) {
    var divtags = '<div id="dialog-confirm" title="" class=" " style="display: none;>  <span class="ui-icon ui-icon-alert"> <div style="float:left"><img class="warning" src="../css/CustomeAlert/themes/images/Confirm.png" /> </div> <div style="margin-left: 50px;margin-top: 5px;line-height:15px;" id="msg">@msg  </div> </span></div>'
    divtags = divtags.replace("@msg", msg);
    var dlgs = $j(divtags).dialog({
        closeOnEscape: false,
        type: confirm,
        modal: true,
        width: 'auto',
        closeOnEscape: false,
        resizable: true,
        buttons: {

            Ok: function () {

                //                if (elementName != 'btnOk') {
                //                    __doPostBack(elementName, null);
                //                }
                __doPostBack(elementName, null);
                $j(this).dialog("close");
                return false;

            },

            Cancel: function () {

                $j(this).dialog("close");
                return false;
            }
        },
        show: {
            effect: "fade",
            duration: 500
        },
        hide: {
            effect: "fade",
            duration: 400
        }
        // dialogClass: 'main-dialog-class'
    })
    return false;
    //}
}



function TrinetraConfirmNotification(elementName, msg) {
    var answer;
    answer = elementName.id;
    // msg = "selectAlarmStatus \n \n select</br>Alarms";
    var divtag = '<div id="dialog-confirm" title="" class=" " style="display: none;>  <span class="ui-icon ui-icon-alert"> <div style="float:left"><img class="warning" src="../css/CustomeAlert/themes/images/Confirm.png" /> </div> <div style="margin-left: 50px;margin-top: 5px;line-height:15px;" id="msg">@msg  </div> </span></div>'
    // alert(msg);
    divtag = divtag.replace("@msg", msg);
    //$("#.ui1-dialog .ui1-dialog-buttonpane .ui1-dialog-buttonset").css({ "padding-left": "100px;" });
    // $('#msg').html(msg)

    var dlg = $j(divtag).dialog({
        closeOnEscape: false,
        type: confirm,
        modal: true,
        width: 'auto',
        closeOnEscape: false,
        resizable: true,
        buttons: {

            Yes: function () {
                $j(this).dialog("close");
                return false;
            },

            No: function () {
                //__doPostBack(elementName, null);              ///prevent page from posting back for cancel notification alert
                $j(this).dialog("close");
                document.getElementById('pnlNotificationsList').style.display = 'none';     ///closes notification panel when user clicks cancel
                return false;
            }
        },
        show: {
            effect: "fade",
            duration: 500
        },
        hide: {
            effect: "fade",
            duration: 400
        }
        // dialogClass: 'main-dialog-class'
    })
    return false;
    //}
}



