function populateSelect(selectobj){
for (var i=0; i<img.length; i++)
selectobj.options[selectobj.options.length]=new Option(img[i]+"  -  "+imgTime[i], img[i])
if (selectobj.options.length>1){
selectobj.selectedIndex=0
showpicture(document.getElementById("picsform").picslist)
}
}

function showpicture(selectobj){
piccontainerobj=document.getElementById("picturearea")
piclinkobj=document.getElementById("link")
resetfade(10)
piccontainerobj.innerHTML='<img src="'+locationstring+selectobj.options[selectobj.selectedIndex].value+'.jpg">'
fadepictoview=setInterval("gradualfade(piccontainerobj)",50)
piclinkobj.innerHTML='<a href="Originals/'+selectobj.options[selectobj.selectedIndex].value+'.JPG">Right click HERE and choose "Save Target As" to download a high resolution image of this picture</a>'
}

function resetfade(degree){
if (window.fadepictoview)
clearInterval(fadepictoview)
if (typeof piccontainerobj.style.MozOpacity=="string")
piccontainerobj.style.MozOpacity=degree/100
else if (piccontainerobj.filters)
piccontainerobj.filters.alpha.opacity=degree
}

function gradualfade(){
if (typeof piccontainerobj.style.MozOpacity=="string" && piccontainerobj.style.MozOpacity<1)
piccontainerobj.style.MozOpacity=Math.min(parseFloat(piccontainerobj.style.MozOpacity)+0.2, 0.99)
else if (piccontainerobj.filters && piccontainerobj.filters.alpha.opacity<100)
piccontainerobj.filters.alpha.opacity+=5
else //if not IE or Moz
clearInterval(fadepictoview)
}

window.onload=function(){
populateSelect(document.getElementById("picsform").picslist)
}
