
function PopupObject(url, name, width, height) {

    this.attributes = new Object();
	this.variables = new Object();

    this.focus = false;

	this.setAttribute('name', name);
	this.setAttribute('url', url);
	this.setAttribute('width', width);
	this.setAttribute('height', height);
};

PopupObject.prototype = {
	
	setAttribute: function(n, v) {
		this.attributes[n] = v;
	},
	
	getAttribute: function(n) {
		return this.attributes[n];
	},

    setFocus: function() {
        this.focus = true;
    },

	popup: function(n) {

        var c = 'width='+this.getAttribute('width')+'px'
        c = c + ',height='+this.getAttribute('height')+'px';

		if ( this.getAttribute('left') )        { c = c + ',left=' + this.getAttribute('left');                 } else { c = c + ',left=0'; }
		if ( this.getAttribute('top') )         { c = c + ',top=' + this.getAttribute('top');                   } else { c = c + ',top=0'; }
		if ( this.getAttribute('menubar') )     { c = c + ',menubar=' + this.getAttribute('menubar');           } else { c = c + ',menubar=0'; }
		if ( this.getAttribute('status') )      { c = c + ',status=' + this.getAttribute('status');             } else { c = c + ',status=0'; }
		if ( this.getAttribute('toolbar') )     { c = c + ',toolbar=' + this.getAttribute('toolbar');           } else { c = c + ',toolbar=0'; }
		if ( this.getAttribute('scrollbars') )  { c = c + ',scrollbars=' + this.getAttribute('scrollbars');     } else { c = c + ',scrollbars=0'; }
		if ( this.getAttribute('resizable') )   { c = c + ',resizable=' + this.getAttribute('resizable');       } else { c = c + ',resizable=0'; }
		if ( this.getAttribute('screenX') )     { c = c + ',screenX=' + this.getAttribute('screenX');           } else { c = c + ',screenX=0'; }
		if ( this.getAttribute('screenY') )     { c = c + ',screenY=' + this.getAttribute('screenY');           } else { c = c + ',screenY=0'; }
		if ( this.getAttribute('directories') ) { c = c + ',directories=' + this.getAttribute('directories');   } else { c = c + ',directories=0'; }
		if ( this.getAttribute('location') )    { c = c + ',location=' + this.getAttribute('location');         } else { c = c + ',location=0'; }

        var popupWin = window.open(this.getAttribute('url'), this.getAttribute('name'), c);

        if ( this.focus ) popupWin.focus();

	}
}

/*
function popup(url,name,width,height,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}
*/

var timeoutID = null;

function loadLytebox(id) 
{
	if (typeof myLytebox != 'undefined') 
	{
		var a = document.createElement("a");
		a.href = "nypopup.php";
		a.rel = "lyteframe";
		a.title = "";
		a.rev = "width: 600px; height: 350px; scrolling: no;";
		myLytebox.start( a, false, true);
	} 
	else 
	{
		// várunk egy kicsit...
		if (timeoutID) { clearTimeout(timeoutID); }
		timeoutID = setTimeout('loadLytebox()', 100);
	}
}
