﻿var photos = [];
photos[photos.length] = {"src": "arches1_i70_near_denver.jpg", "caption": "1:デンバーの近くのI70（ハイウェイ）"};
photos[photos.length] = {"src": "arches2_vail_legendary_back_bowls.jpg", "caption": "2:スキーで有名なベイル"};
photos[photos.length] = {"src": "arches3_rockys_in_beautiful_colorado.jpg", "caption": "3:コロラド川と渓谷と列車（I70から）"};
photos[photos.length] = {"src": "arches4_grenwood_springs_hot_pool.jpg", "caption": "4:グレンウッドスプリングスの温泉プール"};
photos[photos.length] = {"src": "arches5_grenwood_canyion.jpg", "caption": "5:I70から見えるコロラド川の渓谷"};
photos[photos.length] = {"src": "arches6_morning_fog_grand_junction.jpg", "caption": "6:グランドジャンクション付近の朝の霧"};
photos[photos.length] = {"src": "arches7_highway191_8miles_from_i70.jpg", "caption": "7:I70からハイウェイ191に乗り換える"};
photos[photos.length] = {"src": "arches8_delicate_arch.jpg", "caption": "8:アーチーズ国立公園のデリケートアーチ"};
photos[photos.length] = {"src": "arches9_courthouse_towers.jpg", "caption": "9:アーチーズ国立公園のコートハウスタワー"};
photos[photos.length] = {"src": "arches10_landscape_arch.jpg", "caption": "10:アーチーズ国立公園のランドスケープアーチ"};
photos[photos.length] = {"src": "arches11_dark_angel.jpg", "caption": "11:アーチーズ国立公園のダークエンジェル"};
photos[photos.length] = {"src": "arches12_balanced_rock.jpg", "caption": "12:アーチーズ国立公園のバランスドロック"};
photos[photos.length] = {"src": "arches13_double_arch.jpg", "caption": "13:アーチーズ国立公園のダブルアーチ"};
photos[photos.length] = {"src": "arches14_north_devils_garden.jpg", "caption": "14:アーチーズ国立公園の悪魔の庭(北）"};
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;
	}
}

