$.noConflict();

var popupWindow;

jQuery(document).ready(function () {
    popupWindow = new PopupWindowObject();

    tableTheme();


});

function PopupWindowObject() {
    var self = this;
    self.open = function (elemClass) {
        var popup = jQuery(elemClass);

        if (!popup.hasClass("popupWindow")) return false;

        var background = jQuery('<div class="popupBg"></div>');

        background.appendTo("body");

        background.add(popup).fadeIn(200);
    };

    var popups = jQuery("#master > .popupWindowsHolder > .popupWindow");

    popups.each(function(){
        var popup = jQuery(this);
        var close = popup.find(".close");

        close.click(function(){
            popup.fadeOut(200);
            jQuery("body > .popupBg").fadeOut(200, function(){
                jQuery(this).remove();
            });
        });
    });
}

function tableTheme() {
    var tables = jQuery(".blockTable");

    tables.find("tr:gt(0)").each(function () {
        jQuery(this).children(":even").addClass("hl");
    });
}
