
function ddLst()
{
var msg = '';
msg += '<form name="picsForm">';
msg += '<select size="1" name="picsSelect" onChange="addDescription()">';
for (var i=1;i<pics.length;i++)
{
msg += '<option value="' + pics[i].ImageHtmlName + '">' + pics[i].ImageName + '</option>';
}
msg += '</select>';
msg += '<input type=button value=" go " onClick="javascript:location.href=document.picsForm.picsSelect.options[document.picsForm.picsSelect.selectedIndex].value">';
msg += '&nbsp;&nbsp;&nbsp;&nbsp;';
msg += '<input type=text name="finder">';
msg += '<input type=button value=" search " onClick="javascript:findPic()">';
msg += '</form>';
document.write(msg);
}

function addDescription()
{
var idx = document.picsForm.picsSelect.options[document.picsForm.picsSelect.selectedIndex].index
}

function findPic()
{
var report = '';
report += '<html>\n<head>\n<title>Find Report</title>\n'
report += '</head><body><h1>Your Search Results Report</h1>\n'
var htext = '';
var linkIt = '';
var text = document.picsForm.finder.value.toLowerCase();
//the string to find
var textStr = new RegExp(text);
for (var i = 1;i < pics.length;i++)
	{
	var testAgainst = pics[i].ImageInfo
  if (textStr.test(testAgainst.toLowerCase()))
    {
		htext = pics[i].ImageName;
	  linkIt = htext.link(pics[i].ImageHtmlName);
		report += '<p>' + linkIt + '</p>\n';
		report += '<blockquote>'+ pics[i].ImageInfo +'</blockquote>'
    }
	}
report += '\n</body></html'>
window.document.write(report)
}

function picsRec(ImageHtmlName,ImageName,ImageInfo,PageKeywords)
{
this.ImageHtmlName = ImageHtmlName;
this.ImageName = ImageName;
this.ImageInfo = ImageInfo;
this.PageKeywords = PageKeywords;
}

pics = new Array();
//populate first record with Names
pics[0] = new picsRec('ImageHtmlName','ImageName','ImageInfo','PageKeywords');

pics[1] = new picsRec('finland.html','Finland','Huge motorbike gathering in front of Helsinki cathedral. Helsinki is the capital of Finland, with a population of 1.2 million inhabitants in the city and surrounding areas.','photography, photo, pictures, travel, landscapes, nature, Europe');
pics[2] = new picsRec('lapland.html','Finnish Lapland','Late evening sunset (11:20 PM) in May over the Ounasjoki river near the town of Rovaniemi. This area is just a couple of kilometers south of the Arctic Circle.','photography, photo, pictures, travel, landscapes, nature, Europe');
pics[3] = new picsRec('norway.html','Norway','Two boats in the harbor of Røst#039s main island. This island is nearly flat, rising at most 12 meters above sea level; the mountain in the distance is on another island. Røst is the southernmost part of the Lofoten islands, which is about 115 km to the north of the Arctic Circle.','photography, photo, pictures, travel, landscapes, nature, Europe');
pics[4] = new picsRec('scotland.html','Scotland','Stormy weather developing over Loch Earn near the village of Lochearnhead (Perthshire). Lochearnhead is a center for both fishing and water sports.','photography, photo, pictures, travel, landscapes, nature, Europe');
pics[5] = new picsRec('sweden.html','Sweden','Winter sunset over the city of Stockholm with the silhouette of AF Chapman. This sailing ship was built around 1888 and is now a youth hostel. AF Chapman is permanently moored in Stockholm Harbor just across from the Royal Palace.','photography, photo, pictures, travel, landscapes, nature, Europe');
pics[6] = new picsRec('switzerland.html','Switzerland','The Dent-de-Jaman mountain overtowering a small farm house. This tooth-like mountain is 1825 meters above sea level and offers a spectacular view over lake Léman.','photography, photo, pictures, travel, landscapes, nature, Europe');



