function viewer(showImageNum) {
	w = 880;
	h = 680;

	var leftPos = (screen.width - w) / 2;
	if (leftPos < 0)
		leftPos = 0;

	var topPos = ((screen.height - h) / 2) - 20;
	if (topPos < 0)
		topPos = 0;

	var url ="";
	if ( showImageNum ) {
		url = "viewer.html?showImageNum=" + showImageNum;
	} else {
		url = "viewer.html";
	}

	viewerWindow = window.open(url, "viewerWindow", "width=" + w + ",height=" + h + ",left=" + leftPos + ",top=" + topPos);

	if (window.focus)
		viewerWindow.focus();
}

function fenykepalbum(showImageNum) {
	w = 880;
	h = 740;

	var leftPos = (screen.width - w) / 2;
	if (leftPos < 0)
		leftPos = 0;

	var topPos = ((screen.height - h) / 2) - 20;
	if (topPos < 0)
		topPos = 0;

	var url ="";
	if ( showImageNum ) {
		url = "fenykepalbum.html?showImageNum=" + showImageNum;
	} else {
		url = "fenykepalbum.html";
	}

	fenykepalbumWindow = window.open(url, "fenykepalbumWindow", "width=" + w + ",height=" + h + ",left=" + leftPos + ",top=" + topPos);

	if (window.focus)
		fenykepalbumWindow.focus();
}

function writeExternalLinks()
{
	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";
		}
	}
}

function topMenuList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("topmenulist");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

function externalPageLoad()
{
	writeExternalLinks();
	topMenuList();
}

window.onload = externalPageLoad;

