// JavaScript Document

var targetList = ["top_a02", "top_a03"];
var topaList = ["top_sl01_a1", "top_sl01_a2", "top_sl01_a3", "top_sl01_a4", "top_sl01_a5"];

window.onload = function()
{
	dispDetail(targetList[1]);
	setTimeout("dispDetail(targetList[0])",100);
}

function dispDetail(dispName) {
	for(var i in targetList) {
		var targetName = targetList[i];
		var target = getElementById(targetName);
			
		if(targetName == dispName) {
			target.style.display = "block";
		}
		else {
			target.style.display = "none";
		}
	}

return false;
}

function getElementById(name) {
	return document.getElementById(name);
}

function switchSchMode(aname)
{
	var formObj = getElementById("topkeyword");
	if (formObj)
	{
		var i = 0;
		var targetName = "";
		var scopeObj = null;
		for (i = 0; i < topaList.length; i++)
		{
			targetName = topaList[i];
			scopeObj = getElementById(targetName);
			if (scopeObj)
			{
				if (scopeObj.id === aname)
				{
					//選択タグの場合
					formObj.action = scopeObj.href;
					//スタイルの更新
					scopeObj.style.color = "#FFFFFF";
					scopeObj.style.backgroundColor = "#56001d";
					scopeObj.style.fontWeight = "bold";
				}
				else
				{
					//スタイルの更新
					scopeObj.style.color = "#56001d";
					scopeObj.style.backgroundColor = "transparent";
					scopeObj.style.fontWeight = "normal";
				}
			}
		}

		if ("" !== formObj.searchword.value)
		{
			//値が入力済みなら送信する
			formObj.submit();
		}
	}
	
	return false;
}

function sendKeyWord(formObj)
{
	var rVal = false;
	if (formObj.searchword)
	{
		if("" !== formObj.searchword.value)
		{
			rVal = true;
		}
	}
	return rVal;
}
