function PageEffects(simple,bg) {
    // cache common selectors
    this._jBody;
    this._jCountries;
    this._jMapAll;
    this._jMapcontainer;
    this._simple = simple;
    this._cookieKey = "bg";
    this.init(bg);
}

PageEffects.prototype = {
    init: function(bg) {
        this._jBody = $("body");
        this._jCountries = $("#countryList");
        this._jMapAll = $("#map_all");
        this._jMapcontainer = $("div.mapContainer");

        this._clearModuleClasses();

        // FF on a mac has skipping issues with titles on anchors, keep them in for the bots
        $('#countryList a').attr('title', '');

        // disable Access to world markets click
        $('#worldMarketsModule div.moduleContent a').click(function(e) {
            e.preventDefault();
            this.blur();
        });

        $(document).bind('mousemove', this, function(e) {
            e.data._clearModuleClasses();
        });

        $("div.module").mousemove(function(e) {
            return false;
        });

        if (this._simple != 'true') {
            $("#worldMarketsModule").bind('mouseenter', this, function(e) {
                var ctx = e.data;
                ctx._clearModuleClasses();

                ctx._jBody.addClass("dull");

                $(this).addClass("active");

                ctx._jCountries.show();
                ctx._jMapAll.show();
                ctx._changeMap("all");
            });

            $("#partnersModule, #groupModule").bind('mouseenter', this, function(e) {
                e.data._clearModuleClasses();
                $(this).addClass("active");
            });
        }

        $("li", this._jCountries).bind('mouseenter', this, function(e) {
            e.data._changeMap($(this).attr("id"));
        });

        $("ol", this._jCountries).bind('mouseleave', this, function(e) {
            e.data._changeMap("all");
        });

        this._setCookie(bg);
    },
    _setCookie: function(bg) {
        if (document.cookie.length > 0 && document.cookie.indexOf(this._cookieKey + "=") != -1) {
            return;
        }
        document.cookie = this._cookieKey + "=" + escape(bg) + "; path=/";
    },
    _clearModuleClasses: function() {
        if (this._simple === 'true') return;

        $("div.module").each(function() {
            $(this).removeClass("active");
        });

        this._jBody.removeClass("dull");

        this._jCountries.hide();
        this._jMapAll.hide();
    },
    _changeMap: function(map) {
        this._jMapcontainer.hide();
        if ($.browser.msie && $.browser.version) {
            $("div#map_" + map).show().css({ 'visibility': 'visible', 'position': 'absolute', 'left': 'auto' });
        } else {
            $("div#map_" + map).show();
        }
    }
}
