// Open photo in popup window
function openPhoto(img, name, w, h) {
	if (screen.width) {
		x = (screen.width - w) / 2 - 15;
		y = (screen.height - h) / 2 - 5;
		if (h > w || h < 400) y -= 20;
	}
	else {
		x = 150;
		y = 100;
	}
	window.open("/photos/view.php?jpeg=" + img + "&name=" + name + "&w=" + w + "&h=" + h, "neavePhoto", "width=" + w + ",height=" + h + ",top=" + y + ",left=" + x);
}

// Photos page Flash-to-JavaScript for status bar links
function photos_DoFSCommand(cmd, args) {
	if (cmd == "statusOn") {
		if (args == "back") {
			var parent = neaveURL.substr(0, neaveURL.lastIndexOf("/"));
			window.status = parent.substr(0, parent.lastIndexOf("/") + 1);
		}
		else window.status = neaveURL + args;
	}
	if (cmd == "statusOff") window.status = "";
}

wlh = unescape(window.location.href);
pos = wlh.indexOf("index.");
neaveURL = (pos == -1) ? wlh : wlh.substr(0, pos);

if (navigator.appName.indexOf("Microsoft") != -1) {
	document.write('<script type="text/vbscript">\n' +
	'Sub photos_FSCommand(ByVal cmd, ByVal args)\n' +
	'Call photos_DoFSCommand(cmd, args)\n' +
	'End Sub\n' +
	'</script>\n');
}

