



// 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=0";// + bars;
	specs+= ", resizable=0";// + resiz;
	specs+= ", location=no, menubar=0, directories=0 ";

	window.open(file, "_blank", specs);
}
// END










// altalanos popup dialog #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #  #
var PopDialog = new Class
({
	topclose: true,

	ops: {
		wid: 402,
		hei: 248,
		use_cover: true
	},



	//
	initialize: function(ops)
	{
		this.setOptions(ops);

		// dialog elem
		this.dialog = new Element('div', {'class':'popDialog'})

		// fejlec
		headArea = new Element('div', {'class':'topbar'}).injectInside(this.dialog);
		// fejlec gomb
		headCloseBtn = new Element('a', {'href':'#'}).injectInside(headArea).addEvent('click', function(){this.hide()}.bind(this));
		headCloseBtn.addEvent('click', function(e)
		{
			new Event(e).stop();
		});

		// tartalom terulet
		this.contentArea = new Element('span').injectInside(this.dialog);
	},



	// kirakas
	show: function(content)
	{
		// ha kell akkor cover is (bezarasra mindketto zarodik)
		if (this.ops.use_cover)
		{
			this.cover = new Element('div', {'class':'fullCover', 'styles':{'width':window.getWidth(),'height':window.getScrollHeight()}});//document.$('fullCover');
			this.cover.addEvent('click', function(){this.hide()}.bind(this));
			this.cover.injectInside($E('body'));

			// selectek elrejtese ie alatt
			if (window.ie)
			{
				this.selects = $ES('select');
				this.selects.each
				(
					function(s)
					{
						s.setStyle('visibility', 'hidden');
					}
				)
			}

			// flash eltunik
			$('headfl').setStyle('display', 'none');

		}

		// meret
		this.dialog.setStyle('width', this.ops.wid);
		this.dialog.setStyle('height', this.ops.hei);

		// kozepre
		var xpos = (window.getWidth()/2)-this.ops.wid/2;
		this.dialog.setStyle('left', xpos);
		var ypos = window.getScrollTop() + ( (window.getHeight()/2)-this.ops.hei/2 );
		this.dialog.setStyle('top', ypos);

		// tartalom bele
		this.contentArea.setHTML(content);

		// kirakjuk
		this.dialog.injectInside($E('body'));//$('popDialog');

	},
	// END show



	// tartalom valtoztatas
	change: function(content)
	{
		// tartalom
		this.contentArea.setHTML(content);
	},
	// END show



	// eltuntetes
	hide: function()
	{
		this.dialog.remove();
		if (this.cover)
		{
			this.cover.remove();

			// flash eltunik
			$('headfl').setStyle('display', 'block');
		}

		// selectek visszarakasa ie alatt
		if (window.ie)
		{
			this.selects.each
			(
				function(s)
				{
					s.setStyle('visibility', 'visible');
				}
			)
		}
	}
	// END hide

});
PopDialog.implement(new Options);
// END altalanos popup dialog








