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;
}


function chbkgpos (status, id) {
	if (((status == "ovr") || (status == "out")) && (id != "") && (document.getElementById(id))) {
		if (status == "ovr") {
			document.getElementById(id).style.backgroundPosition = "center top";
			if (document.getElementById((id+"ttl"))) document.getElementById((id+"ttl")).style.backgroundPosition = "-172px 0px";
		} else if (status == "out") {
			document.getElementById(id).style.backgroundPosition = "left top";
			if (document.getElementById((id+"ttl"))) document.getElementById((id+"ttl")).style.backgroundPosition = "-8px 0px";
		}
	}
}

// index
function showPlans (type) {
	if ((type == "stay") || (type == "day")) {
		if (type == "stay") {
			document.getElementById("idxstayplan").style.display	= "block";
			document.getElementById("idxdayplan").style.display	= "none";
			document.getElementById("idxstaytab").style.backgroundPosition	= "0px 0px";
			document.getElementById("idxdaytab").style.backgroundPosition	= "-233px 0px";
		} else {
			document.getElementById("idxstayplan").style.display	= "none";
			document.getElementById("idxdayplan").style.display	= "block";
			document.getElementById("idxstaytab").style.backgroundPosition	= "0px -47px";
			document.getElementById("idxdaytab").style.backgroundPosition	= "-233px -47px";
		}
	}
	return false;
}


// page
function setMainPh (id, num, type) {
	var mainphw	= 720;
	var thw	= 30;
	var thh	= 30;
	if (type > 1) {
		var thw	= 62;
		var thh	= 74;
	}
	var maxph	= 6;
	if ((id != "") && (document.getElementById(id)) && (eval(num) >= 0)) {
		document.getElementById(id).style.backgroundPosition	= "-" + eval(num * mainphw) + "px 8px";
		if (document.getElementById(id+(num+1))) {
			for (var i = 0; i < maxph; i++) {
				if (document.getElementById(id+(i+1))) {
					if (i == num) {
						document.getElementById(id+(i+1)).style.backgroundPosition	= "-" + eval(i * thw) + "px -" + thh + "px";
					} else {
						document.getElementById(id+(i+1)).style.backgroundPosition	= "-" + eval(i * thw) + "px 0px";
					}
				} else {
					break;
				}
			}
		}
	}
	return false;
}

var npname	= "";
function showPcmName (name) {
	if (name != "") {
		if (npname == "") {
			npname	= document.getElementById("pcmname").innerHTML;
		}
		document.getElementById("pcmname").innerHTML	= name;
	} else {
		document.getElementById("pcmname").innerHTML	= npname;
	}
	return false;
}

