/**
  * 機種コンテンツ用JavaScript
  * $Id$
  * $Revision$
  * $Date$
  * $Author$
  * Copyright J.B.Craft 2007
  */

/*
	function doSearchMaker(sKbn){
		if(document.C_MAC01.pm.value == 0 && document.C_MAC01.sm.value == 0){
			return;
		}
		document.C_MAC01.m.value = "";
		document.C_MAC01.o.value = "";
		document.C_MAC01.k.value = "";
		if(sKbn == "P"){
			// パチンコ検索
			document.C_MAC01.action = "/machine/C_MAC02_DoSearchListPAction.php";
			document.C_MAC01.m.value = document.C_MAC01.pm.value;
		}else if(sKbn == "S"){
			// パチスロ検索
			document.C_MAC01.action = "/machine/C_MAC03_DoSearchListSAction.php";
			document.C_MAC01.m.value = document.C_MAC01.sm.value;
		}
		doSearch();
	}
*/
	function doSearchPhonetic(sKbn){
		if(document.C_MAC01.po.value == 0 && document.C_MAC01.so.value == 0){
			return;
		}
		document.C_MAC01.m.value = "";
		document.C_MAC01.o.value = "";
		document.C_MAC01.k.value = "";
		if(sKbn == 'P'){
			// パチンコ検索
			document.C_MAC01.action = "/machine/C_MAC02_DoSearchListPAction.php";
			document.C_MAC01.o.value = document.C_MAC01.po.value;
		}else if(sKbn == 'S'){
			// パチスロ検索
			document.C_MAC01.action = "/machine/C_MAC03_DoSearchListSAction.php";
			document.C_MAC01.o.value = document.C_MAC01.so.value;
		}
		doSearch();
	}
	function doSearchKeyword(sKbn){
		if(sKbn == 'P'){
			// パチンコ検索
			if(document.C_MAC01.pk.value == ""){
				alert('検索したい機種名を入力してください。');
				return;
			}else{
				document.C_MAC01.action = "/machine/C_MAC02_DoSearchListPAction.php";
				document.C_MAC01.k.value = document.C_MAC01.pk.value;
			}
		}else{
			// パチスロ検索
			if(document.C_MAC01.sk.value == ""){
				alert('検索したい機種名を入力してください。');
				return;
			}else{
				document.C_MAC01.action = "/machine/C_MAC03_DoSearchListSAction.php";
				document.C_MAC01.k.value = document.C_MAC01.sk.value;
			}
		}
		doSearch();
	}
	function doSearch(){
//		document.C_MAC01.pm.value = "";
		document.C_MAC01.po.value = "";
		document.C_MAC01.pk.value = "";
//		document.C_MAC01.sm.value = "";
		document.C_MAC01.so.value = "";
		document.C_MAC01.sk.value = "";
		document.C_MAC01.submit();
	}

	function tabset(bpref, id) {
		if (! document.getElementById) return;
		if (document.getElementById(bpref + id).style.visibility == "hidden") {
			document.getElementById(bpref + id).style.visibility = "visible";
			document.getElementById(bpref + id).style.position = "";
		} else {
			document.getElementById(bpref + id).style.visibility = "hidden";
			document.getElementById(bpref + id).style.position = "absolute";
		}
	}

	function tabonoff(bpref, id ,id_max , end_id , flg,hpref) {
	  if (! document.getElementById) return;

		for (i = 1; i <= id_max; i++) {
			if(id == 0){
				document.getElementById(bpref + i).style.visibility = "hidden";
				document.getElementById(bpref + i).style.position = "absolute";
				document.getElementById(hpref + i + "1").style.visibility = "hidden";
				document.getElementById(hpref + i + "1").style.position = "absolute";
				document.getElementById(hpref + i + "2").style.visibility = "hidden";
				document.getElementById(hpref + i + "2").style.position = "absolute";
			}else if(i < id || i > end_id) {
				document.getElementById(bpref + i).style.visibility = "hidden";
				document.getElementById(bpref + i).style.position = "absolute";
				document.getElementById(hpref + i + "1").style.visibility = "hidden";
				document.getElementById(hpref + i + "1").style.position = "absolute";
				document.getElementById(hpref + i + "2").style.visibility = "hidden";
				document.getElementById(hpref + i + "2").style.position = "absolute";
			}else if(i == id){
				document.getElementById(bpref + i).style.visibility = "visible";
				document.getElementById(bpref + i).style.position = "";
				document.getElementById(hpref + i + "1").style.visibility = "visible";
				document.getElementById(hpref + i + "1").style.position = "";
				document.getElementById(hpref + i + "2").style.visibility = "hidden";
				document.getElementById(hpref + i + "2").style.position = "absolute";
			} else {
				document.getElementById(bpref + i).style.visibility = "visible";
				document.getElementById(bpref + i).style.position = "";
				document.getElementById(hpref + i + "1").style.visibility = "visible";
				document.getElementById(hpref + i + "1").style.position = "";
				document.getElementById(hpref + i + "2").style.visibility = "hidden";
				document.getElementById(hpref + i + "2").style.position = "absolute";

			}
		}
		if(flg == true){
			window.location = "#name" + id;
		}
	}

	function seltab(bpref, hpref, id_max, selected) {
		if (! document.getElementById) return;
		for (i = 0; i <= id_max; i++) {
			if (! document.getElementById(bpref + i)) continue;
			if (i == selected) {
				document.getElementById(bpref + i).style.visibility = "visible";
				document.getElementById(bpref + i).style.position = "";
				document.getElementById(hpref + i).style.visibility = "visible";
				document.getElementById(hpref + i).style.position = "";
			} else {
				document.getElementById(bpref + i).style.visibility = "hidden";
				document.getElementById(bpref + i).style.position = "absolute";
				document.getElementById(hpref + i).style.visibility = "hidden";
				document.getElementById(hpref + i).style.position = "absolute";
			}
		}
	}
	function seltitle(bpref, id_max, selected) {
		if (! document.getElementById) return;
		for (i = 0; i <= id_max; i++) {
			if (! document.getElementById(bpref + i)) continue;
			if (i == selected) {
				document.getElementById(bpref + i).style.visibility = "visible";
				document.getElementById(bpref + i).style.position = "";
			} else {
				document.getElementById(bpref + i).style.visibility = "hidden";
				document.getElementById(bpref + i).style.position = "absolute";
			}
		}
	}

