﻿var photos = [];
photos[photos.length] = {"src": "louvre1_lion.jpg", "caption": "1:台車に乗ったライオンと台車に乗ったハリネズミ（紀元前１２世紀））"};
photos[photos.length] = {"src": "louvre2_girl.jpg", "caption": "2:少女のミイラとお棺(少女の絵を描いたお棺の上蓋、BC1295～1186ごろ）"};
photos[photos.length] = {"src": "louvre3_girl.jpg", "caption": "3:少女のミイラとお棺（神々の絵を描いたお棺の側面、BC1295～1186ごろ）"};
photos[photos.length] = {"src": "louvre4_seirei.jpg", "caption": "4:悲しみにくれる精霊"};
photos[photos.length] = {"src": "louvre5_boy.jpg", "caption": "5:少年の肖像"};
photos[photos.length] = {"src": "louvre6_amore.jpg", "caption": "6:短剣を持って座るアモール（フランソワ・ブーシェ）"};
photos[photos.length] = {"src": "louvre7_satulos.jpg", "caption": "7:子供のサテュロス"};
photos[photos.length] = {"src": "louvre8_master_hair.jpg", "caption": "8:マスターヘア（1788、ジョジュア・レノルズ）"};
photos[photos.length] = {"src": "louvre9_tichiano.jpg", "caption": "9:聖母子と聖ステパノ、聖ヒエロニムス、聖マウリティウス（ティツイアーノ）"};
photos[photos.length] = {"src": "louvre10_race.jpg", "caption": "10:レースを編む女（ヨハネス・フェルメール）"};
photos[photos.length] = {"src": "louvre11_luto.jpg", "caption": "11:リュートを持つ道化師（フランス・ハルス）"};
photos[photos.length] = {"src": "louvre12_lenplant.jpg", "caption": "12:縁なし帽をかぶり、金の鎖をつけた自画像（レンプラント・ファン・レイン）"};
photos[photos.length] = {"src": "louvre13_eslan.jpg", "caption": "13:エスランの聖母（シモン・ヴーエ）"};
photos[photos.length] = {"src": "", "caption": ""};
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 = "270";
			photoframe.height = "383";
			document.body.appendChild(photoframe);
		}
		photoframe.src = photos[this.selectedIndex-1].src;
	}
}

