



// popup ablak   #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #
function popwindow(wid, hei, file)
{
	xpos = (window.getWidth()/2) - (wid/2);
	ypos = (window.getHeight()/2) - (hei/2) - 30;

	specs = "toolbar=0";// + bars;
	specs+= ", width=" + wid;
	specs+= ", height=" + hei;
	specs+= ", left=" + xpos;
	specs+= ", top=" + ypos;
	specs+= ", status=0";// + status;
	specs+= ", scrollbars=1";// + bars;
	specs+= ", resizable=0";// + resiz;
	specs+= ", location=no, menubar=0, directories=0 ";

	window.open(file, "_blank", specs);

}
// END










// oldal takaro layer  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #
var FullCover = new Class
({

	//
	initialize: function ()
	{
		this.cover = $('fullCover');
	},


	// kirakas
	show: function(close_on_click)
	{
		this.cover.setStyle('display', 'block');
		this.cover.setStyle('width', window.getWidth());
		this.cover.setStyle('height', window.getScrollHeight());

		if (close_on_click)
			this.cover.addEvent('click', this.hide.bindAsEventListener(this));
	},



	// eltuntetes
	hide: function()
	{
		this.cover.setStyle('width', '0px');
		this.cover.setStyle('height', '0px');
		this.cover.setStyle('display', 'none');
	}

});
// END oldal takaro layer










// altalanos popup dialog #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #
var PopDialog = new Class
({

	initialize: function (with_cover, wid, hei)
	{
		this.dialog = $('popDialog');
		this.topclose = true;
		if (with_cover)
			this.with_cover = true;

		// meretek kivulrol.vagy alap
		if (wid>0)
			this.wid = wid;
		else
			this.wid = 402;
		if (hei>0)
			this.hei = hei;
		else
			this.hei = 252;
	},



	//
	clearbg : function()
	{
		this.dialog.setStyle('background','#ffffff');
	},



	// kirakas
	//show: function(wid, hei, content)
	show: function(content)
	{
		// meret
		this.dialog.setStyle('width', this.wid);
		this.dialog.setStyle('height', this.hei);

		// kozepre
		var xpos = (window.getWidth()/2)-this.wid/2;
		this.dialog.setStyle('left', xpos);
		var ypos = window.getScrollTop() + ( (window.getHeight()/2)-this.hei/2 );
		this.dialog.setStyle('top', ypos);

		// teljes tartalom
		var fullcontent = '';
		// felso close sor
		if (this.topclose)
			fullcontent+= '<div class="topbar"><a href="#" onclick="return false;" id="popDialogClose"></a></div>';
		//
		//fullcontent+= '<dic class="content">' + content + '</div>';
		fullcontent+= content;

		// content bele
		this.dialog.setHTML(fullcontent);

		// kirakjuk
		this.dialog.setStyle('display', 'block');

		// ha kell akkor cover is (bezarasra mindketto zarodik)
		if (this.with_cover)
		{
			this.cover = $('fullCover');
			this.cover.setStyle('width', window.getWidth());
			this.cover.setStyle('height', window.getScrollHeight());
			this.cover.setStyle('display', 'block');
			this.cover.addEvent('click', function(){this.hide()}.bind(this));
		}

		// felso close event
		if (this.topclose)
			$('popDialogClose').addEvent('click', function(){this.hide()}.bind(this));
	},



	// eltuntetes
	hide: function()
	{
		this.dialog.setStyle('width', '0px');
		this.dialog.setStyle('height', '0px');
		this.dialog.setStyle('display', 'none');
		// background visszarakas
		this.dialog.setStyle('background', '#f1eeec url(/img/bgr_popup_kosar.gif) no-repeat 2px 22px');

		// ha van cove, akkor az is
		if (this.cover)
		{
			this.cover.setStyle('width', '0px');
			this.cover.setStyle('height', '0px');
			this.cover.setStyle('display', 'none');
		}
	}

});
// END altalanos popup dialog









