
var MofosPostContestPopup = (function(win, data) {

	var options = {
		 full: 'a:first'
	};

	var params = $.extend(true, options, data);
	this.params = params;

	var pop_ex = this;
	this.win = $(win);
	this.btn_close = this.win.find("a.b_w_close");
	this.overlay = $("div.dark_overlay");
	this.hideLink = this.win.find(this.params.full);
	this.stamp = null;

	this.open = function(){
		$('body').addClass('popup_opened');
		this.overlay.show().fadeTo("fast", "0.9");
		this.win.fadeIn("slow");
	};

	this.close = function(){
		this.overlay.fadeOut("slow");
		this.win.fadeOut("fast");
		$('body').removeClass('popup_opened');
	};

	this.showList = function(){
		this.hideLink.fadeOut(600);
		setTimeout($.proxy(function() {
			this.hideLink.parent().addClass('show_full_list');
		}, this), 600);
		return false;
	};
	this.hideLink.click($.proxy(this.showList, this));

	this.btn_close.click(function(){pop_ex.close();return false;});

	$.cookie('showed_mofos_post_contest', '1', { expires: 7, path: '/' });

	return this;
});