function IOkno(containerId, backgroundId, params) {
    var h = 0, w = 0, hI = 0, wI = 0, scrollH = 0;
    var cId = '#' + containerId;
    var bgId = '#' + backgroundId;
    var posTopFromCenter = (params != undefined && typeof (params.top) != 'undefined') ? params.top : 0;

    var _show = function() {
        $(cId).width($(cId).width());
        $(bgId).css({ display: "block" });
        $(cId).css({ display: "block" });
        $(cId).find("a").css({ display: "block" });
        $(bgId).blur();

        iOknoPosition();
    }
    this.Show = _show;

    var _showWithoutCancel = function () {
        $(cId).width($(cId).width());
        $(bgId).css({ display: "block" });
        $(cId).css({ display: "block" });
        $(cId).find("a").css({ display: "none" });
        $(bgId).blur();

        iOknoPosition();
    }
    this.ShowWithoutCancel = _showWithoutCancel;

    var _hide = function() {
        $(bgId).css({ display: "none" });
        $(cId).css({ display: "none" });
        return false;
    }
    this.Hide = _hide;

    var iOknoPosition = function() {
        var de = document.documentElement;
        h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
        w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
        wI = (w - $(cId).width()) / 2;
        if (isIE6()) {
            scrollH = document.documentElement.scrollTop;
            hI = ((h - $(cId).height()) / 2 + scrollH) + posTopFromCenter;
            if (document.body.clientHeight > h) { h = document.body.clientHeight; }
            $(bgId).css({ height: h });
        }
        else {
            hI = (h - $(cId).height()) / 2 + posTopFromCenter;
        }

        if (wI < 0) { wI = 0; }
        if (hI < 0) { hI = 0; }

        $(cId).css({ left: wI, top: hI });
    }

    $(document).ready(function() {
        if ($(this.bgId).width()) {
            if (isIE6()) {
                $(bgId).css({ opacity: 0.4 });
            }

            $(window).resize(function() {
                iOknoPosition();
            });

            if (isIE6()) {
                $(window).scroll(function() {
                    var de = document.documentElement;
                    h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight;
                    scrollH = document.documentElement.scrollTop;
                    hI = (h - $(cId).height()) / 2 + scrollH + posTopFromCenter;
                    $(cId).css({ left: wI, top: hI });
                });
            }
        }
    });
}
