var currentPopup;
var currentConfirm;

function showWarningPopup() {
    currentPopup = showPopupWindow("warningPopupWindow");
}

function showPopupWindow(id) {
    var popup = new Popup(id);
    popup.show();
    return popup;
}

function showErrorPopup() {
    currentPopup = showPopupWindow("errorPopupWindow");
}

function showConfirmPopup() {
    currentConfirm = showPopupWindow("confirmPopupWindow");
}

function hidePopup() {
    currentPopup.hide();
    currentPopup = null;
}

function hideConfirm() {
    currentConfirm.hide();
    currentConfirm = null;
}

function Popup(id) {
    this.id = id;

    this.component = $(this.id).component;

    this.show = function() {
        this.component.show();
    }
    this.hide = function() {
        this.component.hide();
    }
}


