function showIndex () {
	var indexFlash = document.getElementById ('indexFlash');
	var fIndex;
	
	fIndex = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="930" height="265">';
	fIndex += '<param name="movie" value="animations/indexFlash.swf">';
	fIndex += '<param name="quality" value="high">';
	fIndex += '<param name="wmode" value="transparent">';
	fIndex += '<embed src="animations/indexFlash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="930" height="265" wmode="transparent"></embed>';
	
	indexFlash.innerHTML = fIndex;
}

function initPage () {
	if (document.addEventListener) {
		document.getElementById('type').addEventListener ('change', setShipyards, false);
	} else if (document.attachEvent) {
		document.getElementById('type').attachEvent ('onchange', setShipyards);
	}
}

function setShipyards () {
	var typeField = document.getElementById('type');
	var shipyardField = document.getElementById('shipyard');
	var theShipyards;
	if (typeField.value == 1) {
		theShipyards = newShipyards;
	} else {
		theShipyards = usedShipyards;
	}
	shipyardField.options.length = 0;
	for (var i = 0;i < theShipyards.length;i++) {
		shipyardField.options[i] = new Option (theShipyards[i][1], theShipyards[i][0]);
	}
}

if (document.addEventListener) {
	window.addEventListener ('load', initPage, false);
	window.addEventListener ('load', showIndex, false);
	//window.addEventListener ('load', setShipyards, false);
} else if (document.attachEvent) {
	window.attachEvent ('onload', initPage);
	window.attachEvent ('onload', showIndex);
	//window.attachEvent ('onload', setShipyards);
}
