﻿var Confirm_Callback;
$(document).ready(function()
{
    var pf_dlg = $('#dlgConfirm').dialog({ dialogClass: 'join-now-dialog', modal: true, autoOpen: false, draggable: false, resizable: false, position: 'center', width: 561, height: 'auto' });

    //.NET Postback fix
    var uiDialog = pf_dlg.parent();
    (uiDialog.appendTo((document.forms.item(0) != null) ? document.forms.item(0) : document.body));

}
)

function DisplayConfirm(toggle, callback)
{
    var message;
    var pf_dlg = $('#dlgConfirm');
    if (toggle)
    {
        message = "Marking this retailer as not favorite will remove all available offers from your favorite deals list.";
    }
    else
    {
        message = "Marking this retailer favorite will add all available offers to your favorite deals list.";
    }

    $('#dlgConfirm_Message').html(message);

    Confirm_Callback = callback;

    pf_dlg.dialog('open');
    vCenterDialog(pf_dlg);
}

function Confirm_Ok()
{
    $('#dlgConfirm').dialog('close');
    __doPostBack(Confirm_Callback, '');
}

function Confirm_Cancel()
{
    $('#dlgConfirm').dialog('close');
}