

var pop_win = null;
// opens a popup window to see image details
function openthis(id) {
	var w = 800;
	var h = 700;
	if (screen.height == 600)
		h = 550;
	var l = Math.round((screen.width / 2) - (w / 2));
	var t = 0;
	attribs = 'resizable=1,scrollbars=1,width='+w+',height='+h+',left='+l+',top='+t+',screenX='+l+',screenY='+t;
	if (pop_win)
		pop_win.close();
	pop_win = window.open('detail.php?id='+id,'',attribs);
	return false;
}

function pop_biog(id) {
	var w = 800;
	var h = 700;
	if (screen.height == 600)
		h = 550;
	var l = Math.round((screen.width / 2) - (w / 2));
	var t = 0;
	attribs = 'resizable=1,scrollbars=1,width='+w+',height='+h+',left='+l+',top='+t+',screenX='+l+',screenY='+t;
	if (pop_win)
		pop_win.close();
	pop_win = window.open('biography.php?id='+id,'',attribs);
	return false;
}

function showfilename(path) {
	li = path.lastIndexOf('\\') + 1;
	fn = path.substr(li);
	document.getElementById('preview').innerHTML = fn;
}

function goback() {
	history.go(-1);
	return false;
}

// set all " new window " links
function externalLinks() {
	if (!document.getElementsByTagName) 
		return;
	var anchors = document.getElementsByTagName("a");
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
			anchor.title += ' (opens in a new window)';
		}
	}
}
window.onload = externalLinks;