
function fillCategory()
{ 
	 // this function is used to fill the category list on load
	addOption(document.SearchField.Chihou, "hokkaido", "北海道地方", "");
	addOption(document.SearchField.Chihou, "touhoku", "東北地方", "");
	addOption(document.SearchField.Chihou, "kanto", "関東地方", "");	
	addOption(document.SearchField.Chihou, "chubu", "中部地方", "");
	addOption(document.SearchField.Chihou, "kansai", "関西地方", "");
	addOption(document.SearchField.Chihou, "chugoku", "中国地方", "");
	addOption(document.SearchField.Chihou, "shikoku", "四国地方", "");
	addOption(document.SearchField.Chihou, "kyushu", "九州地方", "");
	addOption(document.SearchField.Chihou, "okinawa", "沖縄地方", "");
}

function SelectSubCat()
{
	// ON selection of category this function will work
	
	removeAllOptions(document.SearchField.State);
	addOption(document.SearchField.State, "all", "全エリア", "all");
	
	if(document.SearchField.Chihou.value == 'hokkaido')
	{
		addOption(document.SearchField.State,"hokkaido", "北海道");
	}
	
	if(document.SearchField.Chihou.value == 'touhoku')
	{
		addOption(document.SearchField.State,"aomori", "青森県");
		addOption(document.SearchField.State,"iwate", "岩手県");
		addOption(document.SearchField.State,"miyagi", "宮城県");
		addOption(document.SearchField.State,"akita", "秋田県");
		addOption(document.SearchField.State,"yamagata", "山形県");
		addOption(document.SearchField.State,"fukushima", "福島県");
	}
	
	if(document.SearchField.Chihou.value == 'kanto')
	{
		addOption(document.SearchField.State,"tochigi", "栃木県");
		addOption(document.SearchField.State,"gunma", "群馬県");
		addOption(document.SearchField.State,"ibaraki", "茨城県");
		addOption(document.SearchField.State,"saitama", "埼玉県");
		addOption(document.SearchField.State,"chiba", "千葉県");
		addOption(document.SearchField.State,"tokyo", "東京都");
		addOption(document.SearchField.State,"kanagawa", "神奈川県");
	}

	if(document.SearchField.Chihou.value == 'chubu')
	{
		addOption(document.SearchField.State,"yamanashi", "山梨県");
		addOption(document.SearchField.State,"nagano", "長野県");
		addOption(document.SearchField.State,"nigata", "新潟県");
		addOption(document.SearchField.State,"toyama", "富山県");
		addOption(document.SearchField.State,"ishikawa", "石川県");
		addOption(document.SearchField.State,"fukui", "福井県");
		addOption(document.SearchField.State,"shizuoka", "静岡県");
		addOption(document.SearchField.State,"gifu", "岐阜県");
		addOption(document.SearchField.State,"aichi", "愛知県");
	}

	if(document.SearchField.Chihou.value == 'kansai')
	{
		addOption(document.SearchField.State,"mie", "三重県");
		addOption(document.SearchField.State,"shiga", "滋賀県");
		addOption(document.SearchField.State,"kyoto", "京都府");
		addOption(document.SearchField.State,"osaka", "大阪府");
		addOption(document.SearchField.State,"hyogo", "兵庫県");
		addOption(document.SearchField.State,"nara", "奈良県");
		addOption(document.SearchField.State,"wakayama", "和歌山県");;
	}
	
	if(document.SearchField.Chihou.value == 'chugoku')
	{
		addOption(document.SearchField.State,"tottori", "鳥取県");
		addOption(document.SearchField.State,"shimane", "島根県");
		addOption(document.SearchField.State,"okayama", "岡山県");
		addOption(document.SearchField.State,"hiroshima", "広島県");
		addOption(document.SearchField.State,"yamaguchi", "山口県");
	}	
	
	if(document.SearchField.Chihou.value == 'shikoku')
	{
		addOption(document.SearchField.State,"tokushima", "徳島県");
		addOption(document.SearchField.State,"kagawa", "香川県");
		addOption(document.SearchField.State,"ehime", "愛媛県");
		addOption(document.SearchField.State,"kochi", "高知県");
	}	

	if(document.SearchField.Chihou.value == 'kyushu')
	{
		addOption(document.SearchField.State,"fukuoka", "福岡県");
		addOption(document.SearchField.State,"saga", "佐賀県");
		addOption(document.SearchField.State,"nagasaki", "長崎県");
		addOption(document.SearchField.State,"kumamoto", "熊本県");
		addOption(document.SearchField.State,"oita", "大分県");
		addOption(document.SearchField.State,"miyazaki", "宮崎県");
		addOption(document.SearchField.State,"kagoshima", "鹿児島県");
	}

	if(document.SearchField.Chihou.value == 'okinawa')
	{
		addOption(document.SearchField.State,"okinawa", "沖縄県");
	}
}
////////////////// 

function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

