
function getSessionID()
{
	query = window.location.search;
	fund = query.match(/[&\?]?u=[a-z0-9]{32}/);
	if (fund) return(fund);
	return '';
}

function popup()
{
	var app = this;
	app.functions = new ly_functions();
	app.classname = null;
	app.width = 400;
	app.height = 300;
	
	app.setEventHandlers = function(classname)
	{
		var objects;
		var i = 0;

		if(typeof classname != 'undefined')
		{
			if(document.getElementsByTagName)
			{
				app.classname = classname;
				objects = document.getElementsByTagName('A');
				if(objects)
				{
					for(i = 0; i < objects.length; i++)
					{
						if(app.functions.hasClass(app.classname, objects[i].className))
						{
							objects[i].onclick = function() { return(app.openPopup(this.href)) };
						}
					}
				}
			}
		}
	}

	app.reSize = function()
	{
		var width = document.images[0].offsetWidth + 128;
		var height = document.images[0].offsetHeight + 256;
		window.resizeTo(width, height);
	}

	app.openPopup = function(url)
	{
		if (!url) return(true);
		var wintitle = '_blank';
		var width = 400;
		var height = 300;

		var newwin = window.open(url, wintitle, "location=no,resizable=yes,status=yes,menubar=yes,toolbar=no,dependent=yes,scrollbars=yes,width=" + String(width) + ",height=" + String(height));
		if (newwin)
		{
			return(false);
		}

		return(true);
	}
}

var waldeyerPopups = new popup();
waldeyerPopups.functions.addEvent(window, 'load', function() { waldeyerPopups.setEventHandlers('popup'); } );
