﻿function RegisterContactPopups() {

    jQuery('div[id^=popup_window_]').each(function(index) {
        var windowClass = $(this).attr('id');

        var linkClass = '#popup_link_' + windowClass.replace('popup_window_', '');

        $(this).jqm({
            trigger: linkClass,
            
            onShow: function(h) {
                /* callback executed when a trigger click. Show notice */
                h.w.css('opacity', 0.92).slideDown();
            },
            onHide: function(h) {
                /* callback executed on window hide. Hide notice, overlay. */
                h.w.slideUp("slow", function() { if (h.o) h.o.remove(); });
            }
        });
    });
}

function SendMessageToSeller(moduleId, tabId, sellerId, messageEl, message) {

    var result = CodingStaff.Modules.CollectorsMarketPlace.Actions.Actions.SendMessageToSeller(moduleId, tabId, sellerId, message,
        function(result) { messageEl.text(result.Message);  });
    
}

