﻿//同じファイル内の画像の入れ替え関数
function change_image(img, imagefile) {
	var image = document.images[img];
	image.src = imagefile;
}

//インラインフレーム内から親ファイルの画像を入れ替える関数
function change_parent_image(img, imagefile) {
	with (parent.window) {
		change_image(img, imagefile);
	}
}

//検索フォームのリストの表示・非表示を設定する関数
function Form_list_display( id ){
	if ( document.getElementById(id).style.display == "block" ) {
		DelElement( id );
	} else {
		on_cAry.push( id );
	}

	//検索フォーム内にあるIDがidのリストの表示・非表示を設定する。
	document.getElementById(id).style.display = ((document.getElementById(id).style.display == "block")?"none":"block");
}

//検索フォームのチェックボックスの左側の符号を変更する関数
function Change_list_sign( id ) {
	if ( document.all == true) {
		with(document.all(id)) {
			innerText = ((innerText == "＋")?"－":"＋");
			return;
		}
	}
	if (document.getElementById) {
		with(document.getElementById(id)) {
			firstChild.nodeValue = ((firstChild.nodeValue=="＋")?"－":"＋");
			return;
		}
	}
}

//フォームのチェックボックスに入力後、画像を入れ替える関数
function input_img(formname, checkname, index, imgname, imgfile_true, imgfile_false) {
	var image = document.images[imgname];
	with (document.forms[formname]) {
		with (elements[checkname + "["+ index + "]"]) {
			image.src = ((checked == true)?imgfile_true:imgfile_false);
			return;
		}
	}
}

function mouseout_map(formname, checkname, index, imgname, imgfile_true, imgfile_false) {
	input_img(formname, checkname, index, imgname, imgfile_true, imgfile_false);
}

function click_map(formname, checkname, index, imgname, imgfile_true, imgfile_false) {
	with (document.forms[formname]) {
		with (elements[checkname + "["+ index + "]"]) {
			checked = ((checked==true)?false:true);
			input_img(formname, checkname, index, imgname, imgfile_true, imgfile_false);
		}
	}
}

function mouseout_parent_map(formname, checkname, index, imgname, imgfile_true, imgfile_false) {
	with (parent.window) {
		input_img(formname, checkname, index, imgname, imgfile_true, imgfile_false);
	}
}

function mouseout_item(formname, checkname, index, imgname, imgfile_true, imgfile_false) {
	input_img(formname, checkname, index, imgname, imgfile_true, imgfile_false);
}

function checked_load() {
	var array_length = 6;
	for (i=1; i<=array_length; i++) {
		var image_true = "./img/"+ "map"+ i+ "_2.gif";
		var image_false = "./img/"+ "toumeimap.gif";
		input_img("search", "area1", i, "map_area" + i, image_true, image_false);
	}
}
