function _(id) { return document.getElementById(id); }

function openCenteredWindow(url, n, w, h) {
	var l = (screen.availWidth / 2) - (w / 2);
	var t = (screen.availHeight / 2) - (h / 2);
	return openWindow(url, n, w, h, l, t);
}

function openWindow(url, n, w, h, l, t) {
	if(l == undefined) l = 200;
	if(t == undefined) t = 100;

	var params = new Array();

	if(w > 0) params.push('width='  + w);
	if(h > 0) params.push('height=' + h);
	params.push('left=' + l);
	params.push('top='  + t);

	params.push('location=no');
	params.push('statusbar=no');

	return window.open(url, n, params.join(','));
}

function lightbox_swap(img)
	{
	document.getElementById('lightbox_image').setAttribute('src', img);
	}