﻿var Notification = {
    closeNotification: function() {
        (function($) {
            (jQuery)(document).ready(function() {
                (jQuery)('#notify-container').hide();
            }); //document.ready
        })(jQuery);
    },
    drawOwnerUpgradeNotification: function(Notificationtext) {
        (function($) {
            (jQuery)(document).ready(function() {
                (jQuery)('.page:first').append('<div   style="width:100%; ">    <div class="divcenter">   <div style="text-align:center;"> ' + Notificationtext + '   <img alt="OK" title="Success" src="/Themes/Public/img/notification_done.png" /> </div>               <div class="clear"></div>                  </div>      <div class="right" style="margin-top:-60px;"> <a title="dismiss this notification" onclick="Notification.closeSuccessNotification()">                 <img alt="Close" title="Close" src="/Themes/Public/img/bdelete-48.png" style="border:0px;" />      </a></div>    <div> <div class="divpx"></div>');
                (jQuery)('#notify-container').slideToggle("slow");
            }); //document.ready
        })(jQuery);
    },

    closeSuccessNotification: function() {
        (function($) {
            (jQuery)(document).ready(function() {
                (jQuery)('#notify-success-container').hide();
            }); //document.ready
        })(jQuery);
    },
    drawSuccessNotification: function(Notificationtext, requireMargin, isSuccess) {
        (function($) {
            (jQuery)(document).ready(function() {
                if (requireMargin) {
                    if ((jQuery)('#notify-success-container').length > 0)
                        (jQuery)('#notify-success-container').remove();
                    if (isSuccess)

                        (jQuery)('.notifyDiv:first').append('<div id="notify-success-container" class="notify-table fixedbar" style="display:none;"><div   style="width:100%; ">    <div class="divcenter" >   <div style="text-align:center;font-size:20;"> ' + Notificationtext + '   <img alt="OK" title="Success" src="/images/notification_done.png" /> </div>               <div class="clear"></div>                  </div>      <div class="right" style="margin-top:-50px;"> <a title="dismiss this notification" onclick="Notification.closeSuccessNotification()" style="cursor:pointer;">                 <img alt="Close" title="Close" src="/images/bdelete-48.png" style="border:0px;" />      </a></div> </div>    </div> <div class="divpx"></div>');
                    else
                        (jQuery)('.notifyDiv:first').append('<div id="notify-success-container" class="notify-table fixedbar" style="display:none;"><div   style="width:100%; ">    <div class="divcenter">   <div style="text-align:center;font-size:20;"> ' + Notificationtext + '   <img alt="OK" title="Success" src="/images/notification_error.png" /> </div>               <div class="clear"></div>                  </div>      <div class="right" style="margin-top:-50px;"> <a title="dismiss this notification" onclick="Notification.closeSuccessNotification()" style="cursor:pointer;">                 <img alt="Close" title="Close" src="/images/bdelete-48.png" style="border:0px;" />      </a></div>  </div>   </div> <div class="divpx"></div>');
                    if (document.all)
                    {
                    $(".fixedbar").fixedPosition({
        debug: false,
        fixedTo: "top",
        effect: "slideDown",
        effectSpeed: 200
     });
                    }
                    else
                    (jQuery)('#notify-success-container').fadeIn("slow");
                }
                else {
                    if ((jQuery)('#notify-success-container').length > 0)
                        (jQuery)('#notify-success-container').remove();
                    if (isSuccess)
                        (jQuery)('.notifyDiv:first').append('<div id="notify-success-container" class="notify-table fixedbar" style="display:none;"><div   style="width:100%; ">    <div class="divcenter">   <div style="text-align:center;font-size:20;"> ' + Notificationtext + '   <img alt="OK" title="Success" src="/images/notification_done.png" /> </div>               <div class="clear"></div>                  </div>      <div class="right" style="margin-top:-50px;"> <a title="dismiss this notification" onclick="Notification.closeSuccessNotification()" style="cursor:pointer;">                 <img alt="Close" title="Close" src="/images/bdelete-48.png" style="border:0px;" />      </a></div>  </div>   </div> <div class="divpx"></div>');
                    else
                        (jQuery)('.notifyDiv:first').append('<div id="notify-success-container" class="notify-table fixedbar" style="display:none;"><div   style="width:100%; ">    <div class="divcenter">   <div style="text-align:center;font-size:20;"> ' + Notificationtext + '   <img alt="OK" title="Success" src="/images/notification_error.png" /> </div>               <div class="clear"></div>                  </div>      <div class="right" style="margin-top:-50px;"> <a title="dismiss this notification" onclick="Notification.closeSuccessNotification()" style="cursor:pointer;">                 <img alt="Close" title="Close" src="/images/bdelete-48.png" style="border:0px;" />      </a></div> </div>    </div> <div class="divpx"></div>');
                    if (document.all)
                    {
                    $(".fixedbar").fixedPosition({
        debug: false,
        fixedTo: "top",
        effect: "slideDown",
        effectSpeed: 200
     });
                    }
                    else
                    (jQuery)('#notify-success-container').fadeIn("slow");
                }
                
            }); //document.ready
        })(jQuery);
    }
};
