$(document).ready(function(){
	$("a[rel='external']").click(function(){
		if ($(this).attr("href") != "") {
			if ((! $(this).attr("id")) && ($(this).attr("id") != "")) {
				window.open($(this).attr("href"), $(this).attr("id"));
			} else {
				window.open($(this).attr("href"));
			}
		}
		return false;
	});
});
function extWin (url, title, w, h) {
	if ((url != "") && (title != "")) {
		if ((w == 0) && (h == 0)) {
			window.open(url, title);
		} else {
			window.open(url, title, "width=" + w + ", height=" + h + ", scrollbars=yes, resizable=yes");
		}
	}
	return false;
}
function blankWin (url) {
	if (url != "") {
		window.open(url);
	}
	return false;
}

var btnids		= ["mph1","mph2","mph3","mph4"];
var mainphid	= "mainphoto";
var mphwidth	= 960;
var i			= 0;
function chPhoto (btnid) {
	if (btnid != "") {
		if ((document.getElementById(mainphid)) && (document.getElementById(btnid))) {
			for (i = 0; i < btnids.length; i++) {
				if (btnid == btnids[i]) {
					document.getElementById(mainphid).style.backgroundPosition	= "-" + (i * mphwidth) + "px top";
					document.getElementById(btnids[i]).style.backgroundPosition	= "left bottom";
				} else {
					if (document.getElementById(btnids[i])) {
						document.getElementById(btnids[i]).style.backgroundPosition	= "left top";
					}
				}
			}
		}
	}
	return false;
}

function closeWin(){
	window.close();
}
