﻿var photos = [];
photos[photos.length] = {"src": "modi1_junnu_evi_bighat.jpg", "caption": "1:大きな帽子をかぶったジャンヌ・エヴュテルヌ（1918/個人蔵）"};
photos[photos.length] = {"src": "modi2_junnu_evi.jpg", "caption": "2:ジャンヌ・エヴュテルヌ　(1918/個人蔵）"};
photos[photos.length] = {"src": "modi3_young_lady.jpg", "caption": "3:若い婦人の肖像　（1919/ラ・ショー・ド・フォン美術館）"};
photos[photos.length] = {"src": "modi4_young_girl_redhair.jpg", "caption": "4:赤毛の若い娘（1918/個人蔵）"};
photos[photos.length] = {"src": "modi5_woman_black_dress.jpg", "caption": "5:黒いドレスの女　（1918/個人蔵）"};
photos[photos.length] = {"src": "modi6_cariated.jpg", "caption": "6:カリアテッド　(1913/ジャネット＆ジョナサン・ローゼン蔵）"};
photos[photos.length] = {"src": "modi7_raimond.jpg", "caption": "7:ライモンド　(1915/シカゴ、アルスドルフ・コレクション）"};
photos[photos.length] = {"src": "modi8_big_red_bust.jpg", "caption": "8：大きな赤い胸像　(1913/個人蔵）"};


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 = "250";
			photoframe.height = "400";
			document.body.appendChild(photoframe);
		}
		photoframe.src = photos[this.selectedIndex-1].src;
	}
}

