function popup(url, height, width, scrollbars, alwaysNewWindow) {

	var top=0;
	var left=0;
	var pageId = 'Reg';
	
	if (height >= screen.height) {
		height = screen.height - 75;
	}
	if (width >= screen.width) {
		width = screen.width - 50;
	}
	
	top = (screen.height - height) / 2;
	left = (screen.width - width) / 2;
	
	if (!scrollbars) {
		scrollbars = 'no';
	}

	if (alwaysNewWindow) {
		pageId = Math.round(Math.random() * 100) % 1000 + 1;
	}
	if (newwindow == null) {
		var pageType = 'resizable=no,hotkeys=no,dependent=yes,toolbar=no,directories=no,scrollbars=' + scrollbars + ',status=no,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left;
		var newwindow = window.open(url,pageId,pageType);
		newwindow.opener = window;
	}
	else {
		newwindow.location = url;
	} // if (newwindow == null)
	newwindow.focus();
	return newwindow;

}

//	A simple image gallery.
//	You'll need a placeholder image with the id "placeholder".
//	You'll also need an element with the id "desc" to hold the descriptive text.
//	Feel free to alter this as you see fit.
//	All I ask is that you drop me a line to let me know where you use it.
//	Email me: jeremy at adactio.com

function showPic (whichpic, uri) {
	if (document.getElementById) { 
		document.getElementById('placeholder').src = uri; 
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}


