$(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;
	});
	if (document.getElementById("facilityculture")) {//if ($("#facilityculture")) {
		$(".culturefm").click(function(){$(this).next().slideToggle("normal");});
		$(".culturefm").next().css("display","none");
	} else if  (document.getElementById("facilityresort")) {//if ($("#facilityresort")) {
		$(".resortfm").click(function(){$(this).next().slideToggle("normal");});
		$(".resortfm").next().css("display","none");
	}
});
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	= 708;
var thwidth		= 50;
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	= "-" + (i * thwidth) + "px bottom";
				} else {
					if (document.getElementById(btnids[i])) {
						//document.getElementById(btnids[i]).style.backgroundPosition	= "left top";
						document.getElementById(btnids[i]).style.backgroundPosition	= "-" + (i * thwidth) + "px top";
					}
				}
			}
		} else {
			alert(document.getElementById(mainphid)+" , "+document.getElementById(btnid));
		}
	} else {
		alert("no btnid");
	}
	return false;
}

