function selectSort(sort){
	var select1 = document.forms.awssearch.SearchIndex; //変数select1を宣言
	var select2 = document.forms.awssearch.Sort; //変数select2を宣言
	var selected = 0;
	
	select2.options.length = 0; // 選択肢の数がそれぞれに異なる場合、これが重要
	
	if((sort == "pricerank") || (sort == "price")){
		selected = 1;
	}else if((sort == "-pricerank") || (sort == "inverse-pricerank") || (sort == "-price")){
		selected = 2;
	}else if(sort == "titlerank"){
		selected = 3;
	}else if(sort == "-titlerank"){
		selected = 4;
	}else if((sort == "daterank") || (sort == "-release-date") || (sort == "-releasedate") || (sort == "-orig-rel-date")){
		selected = 5;
	}else if((sort == "release-date") || (sort == "releasedate") || (sort == "orig-rel-date")){
		selected = 6;
	}else if(sort == "mfg-age-min"){
		selected = 7;
	}else if(sort == "-mfg-age-min"){
		selected = 8;
	}
	
	if (select1.options[select1.selectedIndex].value == "Books"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","pricerank");
			select2.options[2] = new Option("価格の高い順番","inverse-pricerank");
			select2.options[3] = new Option("タイトル名の順番：A-Z","titlerank");
			select2.options[4] = new Option("タイトル名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("出版年月の順番：新-旧","daterank");
	}
	
	else if (select1.options[select1.selectedIndex].value == "ForeignBooks"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","pricerank");
			select2.options[2] = new Option("価格の高い順番","inverse-pricerank");
			select2.options[3] = new Option("タイトル名の順番：A-Z","titlerank");
			select2.options[4] = new Option("タイトル名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("出版年月の順番：新-旧","daterank");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Electronics"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","pricerank");
			select2.options[2] = new Option("価格の高い順番","-pricerank");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "DVD"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","pricerank");
			select2.options[2] = new Option("価格の高い順番","-pricerank");
			select2.options[3] = new Option("タイトル名の順番：A-Z","titlerank");
			select2.options[4] = new Option("タイトル名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-orig-rel-date");
			select2.options[6] = new Option("発売日の順番：旧-新","orig-rel-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Music"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","pricerank");
			select2.options[2] = new Option("価格の高い順番","-pricerank");
			select2.options[3] = new Option("タイトル名の順番：A-Z","titlerank");
			select2.options[4] = new Option("タイトル名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-orig-rel-date");
			select2.options[6] = new Option("発売日の順番：旧-新","orig-rel-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Classical"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","pricerank");
			select2.options[2] = new Option("価格の高い順番","-pricerank");
			select2.options[3] = new Option("タイトル名の順番：A-Z","titlerank");
			select2.options[4] = new Option("タイトル名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-orig-rel-date");
			select2.options[6] = new Option("発売日の順番：旧-新","orig-rel-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "VideoGames"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("タイトル名の順番：A-Z","titlerank");
			select2.options[4] = new Option("タイトル名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Toys"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Hobbies"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
			select2.options[7] = new Option("推奨年齢の順番：低-高","mfg-age-min");
			select2.options[8] = new Option("推奨年齢の順番：高-低","-mfg-age-min");
	}
	
	else if (select1.options[select1.selectedIndex].value == "SportingGoods"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-releasedate");
			select2.options[6] = new Option("発売日の順番：旧-新","releasedate");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Software"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "Kitchen"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
	}
	
	else if (select1.options[select1.selectedIndex].value == "HealthPersonalCare"){
			select2.options[0] = new Option("売れている順番","salesrank");
			select2.options[1] = new Option("価格の安い順番","price");
			select2.options[2] = new Option("価格の高い順番","-price");
			select2.options[3] = new Option("商品名の順番：A-Z","titlerank");
			select2.options[4] = new Option("商品名の順番：Z-A","-titlerank");
			select2.options[5] = new Option("発売日の順番：新-旧","-release-date");
			select2.options[6] = new Option("発売日の順番：旧-新","release-date");
	}
	
	select2.selectedIndex = selected;
}

