// JavaScript Document

//リモコン挙動管理
//カラーボタン指定ページ・ジャンプ
function switchProg(color) {
	var jumpUrl;
	switch(color){
		case "blue":
		jumpUrl = gColorAry[0];
		break;
		case "red":
		jumpUrl = gColorAry[1];
		break;
		case "green":
		jumpUrl = gColorAry[2];
		break;
		case "yellow":
		jumpUrl = gColorAry[3];
		break;
		case "orange":
		jumpUrl = gColorAry[4];
		break;
		case "purple":
		jumpUrl = gColorAry[5];
		break;
	}
	if(jumpUrl != null){
	location.href = jumpUrl;
	}
}
//チャンネルボタン、電源ボタン(トップ)
function channelBtn(channelNum){
	switch(channelNum){
		case "top":
		jumpUrl = "http://www.i-nagano.com/ipc/index.php";
		location.href = jumpUrl;
		break;
//		case "01":break;
//		case "02":break;
//		case "03":break;
//		case "04":break;
		case "05":
		jumpUrl = "http://www.i-nagano.com";
		location.href = jumpUrl;
		break;
		case "06":
		jumpUrl = "http://www.i-nagano.com";
		location.href = jumpUrl;
		break;
		case "07":
		jumpUrl = "http://www.i-nagano.com/ipc2/7ch/";
		location.href = jumpUrl;
		break;
//		case "08":
//		window.open("http://www.nbs-tv.co.jp/","newWindow");
//		break;
//		case "09":break;
		case "10":
		jumpUrl = "http://www.i-nagano.com/ipc2/5ch/";
		location.href = jumpUrl;
		break;
		case "11":
		jumpUrl = "http://www.i-nagano.com/ipc2/11ch/";
		location.href = jumpUrl;
		break;
//		case "12":break;
		default:
		jumpUrl = "http://www.i-nagano.com/ipc/ch"+channelNum+"/";
		location.href = jumpUrl;
	}
}

//選局ボタン(市町村選択)
function switchCity(flag) {
	url = location.href;
	cityNum = eval(url.substring(33,35));
//	alert(cityNum);
	switch (flag){
		case "next": cityNum ++ ;
		if (cityNum == "82" ){cityNum = "1"; }
		break;
		case "prev": cityNum -- ;
		if (cityNum == "0" ){cityNum = "81"; }
		break;
	}
	if (cityNum < 10){
		cityNum = "0" + cityNum + "";
	}
	jumpUrl = "http://www.i-nagano.com/ipc/ch02/" + cityNum + "/";
	location.href = jumpUrl;
}

//選局ボタン(チャンネル選択)
function switchCh(flag) {
	url = location.href;
	chNum = eval(url.substring(30,32));
	switch (flag){
		case 'next': chNum ++ ;
			switch (chNum){
				case 13:chNum = 1;break;
//				case 08:chNum ++;window.open("http://www.nbs-tv.co.jp/","newWindow");break;
			}
		break;
		case 'prev': chNum -- ;
			switch (chNum){
				case 00:chNum = 12;break;
				case 0:chNum = 12;break;
//				case 08:chNum --;window.open("http://www.nbs-tv.co.jp/","newWindow");break;
			}
		break;
	}
	if (chNum < 10){
		chNum = "0" + chNum + "";
	}
	jumpUrl = "http://www.i-nagano.com/ipc/ch" + chNum + "/";
	location.href = jumpUrl;
}

//ムービー・映画館リスト・エリア切り替え
function listSwitch(targetArea){
	document.getElementById("listHokushin").style.display = "none";
	document.getElementById("listToushin").style.display = "none";
	document.getElementById("listChushin").style.display = "none";
	document.getElementById("listNanshin").style.display = "none";
	document.getElementById(targetArea).style.display = "block";
}


function switchEventList(targetClass){
	document.getElementById("hanabiList").style.display = "none";
	document.getElementById("fesList").style.display = "none";
	document.getElementById("hint").style.display = "none";
	document.getElementById(targetClass).style.display = "block";
}