function loadit(theUrl)
{
    self.location.href=theUrl;
}
function displayInfo()
{
    movie = getMovie(document.movieForm.movieList.selectedIndex);
    document.movieForm.mediaType.value = movie.mediaType;
    document.movieForm.longDesc.value = movie.longDesc;
}
function playSelection()
{
    movie = getMovie(document.movieForm.movieList.selectedIndex);
    loadit(movie.url);
}
createList();
document.write("<center><form name='movieForm'>" +
               "<table width=90% cellpadding=5>" +
               "<tr><td valign=top>" +
               "<select name='movieList' size=1 onChange='displayInfo()'>");
j = getMovies();
playing = "";
for (var i = 0; i < j; i++) 
{
    selected = "";
    movie = getMovie(i);
    if (self.location.href.indexOf(movie.url) != -1) 
        {
        selected = " selected";
        if (movie.shortDesc != " ")
            {
             playing = movie.shortDesc;
            }
        }
    document.write("<option" + selected + ">" + movie.shortDesc + "</option>");
}
document.write("</select>");
document.write("</td><td valign=top align=middle>" +
               '<input type="button" value="Play" onClick="playSelection()">' +
               "</td><td valign=top align=middle>" +
               '<input type="text" name="mediaType" size=40>' +
               "</td></tr><tr><td colspan=3 valign=top>" +
               '<textarea name="longDesc" rows=2 cols=75 wrap=virtual></textarea>' +
               "</td></tr>" +
               "<tr><td colspan=3 align=middle valign=top>")
if (playing != "") 
{
    document.write("Now playing: " + playing);
}
else document.write("&nbsp;");
document.write("</td></tr></table></center>");
document.write("</form>");
displayInfo();

