function loadImages(form) {
        var gifIndex = form.cached.selectedIndex
        document.thumbnail.src = imageDB[gifIndex].src
        
}


function checkTimer() {
        if (document.ControlBar.timerBox.value == "1") {
                var newIndex = imageDB.length - 1
                var gifIndex = document.selections.cached.selectedIndex
        if (gifIndex > 0) {
                newIndex = gifIndex - 1
        }
                document.thumbnail.src = imageDB[newIndex].src
                document.selections.cached.selectedIndex = newIndex
        if (newIndex == 0) {
                var timeoutID = setTimeout("checkTimer()",3000)
        }
        else {
                var timeoutID = setTimeout("checkTimer()",1000)
        }

        }
}


        function play()
        {
                document.ControlBar.timerBox.value = "1";
                checkTimer();
        }
        function stop()
        {
                document.ControlBar.timerBox.value = "0";
                checkTimer();
        }
        function next()
        {
                document.ControlBar.timerBox.value = "0";
                checkTimer();
                var newIndex = imageDB.length - 1
                var gifIndex = document.selections.cached.selectedIndex
                if (gifIndex > 0) {
                newIndex = gifIndex - 1
                }
                document.thumbnail.src = imageDB[newIndex].src
                document.selections.cached.selectedIndex = newIndex
        }
        function back()
        {
                document.ControlBar.timerBox.value = "0";
                checkTimer();
                var newIndex = 0
                var gifIndex = document.selections.cached.selectedIndex
                if (gifIndex < imageDB.length - 1) {
                        newIndex = gifIndex + 1
                }
                document.thumbnail.src = imageDB[newIndex].src
                document.selections.cached.selectedIndex = newIndex
        }
        function first()
        {
                document.ControlBar.timerBox.value = "0";
                checkTimer();
                var newIndex = imageDB.length - 1
                document.thumbnail.src = imageDB[newIndex].src
                document.selections.cached.selectedIndex = newIndex
        }
        function last()
        {
                document.ControlBar.timerBox.value = "0";
                checkTimer();
                var newIndex = 0
                document.thumbnail.src = imageDB[newIndex].src
                document.selections.cached.selectedIndex = newIndex
        }

function slidelink(){
var imagesrc=document.thumbnail.src;
//var imgwin=window.open('','img','scrollbars,resizable,width=100,height=100');
//if (parseInt(navigator.appVersion) >= 4) {imgwin.focus();}
//var HTML="<html>\r\n<head>\r\n<title>Asian Aeronantical Meteorology Service</title>\r\n</head>\r\n<body leftmargin=\"0\" topmargin=\"0\">\r\n<img src=\""+imagesrc+"\" onload=\"window.resizeTo(this.width+10,this.height+36);window.moveTo((screen.width-this.width)/2,(screen.height-this.height)/2)\">\r\n</body>\r\n</html>"
//var doc=imgwin.document
//doc.open("text/html","replace") 
//doc.write(HTML)
//doc.close()
top.location.href=imagesrc;
}


