﻿var photos = [];
photos[photos.length] = {"src": "sh1_baker_st_station.jpg", "caption": "1:最寄の地下鉄「ベーカーストリート駅」"};
photos[photos.length] = {"src": "sh2_sherlock_holmes_statue.jpg", "caption": "2:ベーカー街にあるシャーロックホームズの立像"};
photos[photos.length] = {"src": "sh3_bakerst221b.jpg", "caption": "3:ベーカー街221ｂのアパートメント"};
photos[photos.length] = {"src": "sh4_sherlock_holmes_musium.jpg", "caption": "4:ベーカー街のシャーロックホームズ・ミュージアム"};
photos[photos.length] = {"src": "sh5_reagent_park.jpg", "caption": "5:ベーカー街近くの有名なりージェント公園"};
photos[photos.length] = {"src": "sh6_reagent_park2.jpg", "caption": "6:リージェント公園2"};
photos[photos.length] = {"src": "sh7_dvd_sherlock_holmes.jpg", "caption": "7:DVDからシャーロックホームズのイメージ"};
photos[photos.length] = {"src": "sh8_sherlock_holmes_hotel.jpg", "caption": "8:ベーカー通りにあるシャーロックホームズ・ホテル"};
photos[photos.length] = {"src": "sh9_baker_st_19th.jpg", "caption": "9:ホームズが活躍した頃の古き良き19世紀のベーカー街（ポストカードより）"};
photos[photos.length] = {"src": "sh10_pipe_and.jpg", "caption": "10:ホームズが日ごろ愛用していた小物（シャーロックホームズ博物館より）"};
window.onload = function() {
	var menu = document.createElement("form");
	var menulist = document.createElement("select");
	
	document.body.appendChild(menu);
	menu.appendChild(menulist);
	var options = new Array();
	var caption = document.createTextNode("選んでください");
	options[0] = document.createElement("option");
	options[0].appendChild(caption);
	menulist.appendChild(options[0]);
	for(var i = 0; i<photos.length; i++) {
		var caption = document.createTextNode(photos[i].caption);
		options[i+1] = document.createElement("option");
		options[i+1].appendChild(caption);
		menulist.appendChild(options[i+1]);
	}

	menulist.onchange = function() {
		if(!this.selectedIndex) return false;
		if(document.getElementById("photoframe")) {
			var photoframe = document.getElementById("photoframe");
		} else {
			var photoframe = document.createElement("img");
			photoframe.id = "photoframe";
			photoframe.width = "240";
			photoframe.height = "180";
			document.body.appendChild(photoframe);
		}
		photoframe.src = photos[this.selectedIndex-1].src;
	}
}

