
// last edited 03-13-2008 by Frank Maskus
 
 // Set the number of images and size here
 var numImages = 7;    
 var width = 704;
 var height = 480;
 var index = 1;
 var count = numImages;
 var slide = new Array();
 
 // Create the image data structures
 for(var i=1; i<=count; i++)
 {
    slide[i] = new Image(width, height);
 }
 
//  Cache these images

   slide[1].src = "http://www.kgw.com/live/livecams_external/pioneersquare.jpg"
   slide[2].src = "http://www.kgw.com/live/livecams_external/vancouver.jpg"
   slide[3].src = "http://www.kgw.com/live/livecams_external/rosecity.jpg" 
   slide[4].src = "http://www.kgw.com/live/livecams_external/wellsfargo.jpg"
   slide[5].src = "http://www.kgw.com/live/livecams_external/pdx.jpg"
   slide[6].src = "http://www.kgw.com/live/livecams_external/kgwcontrol.jpg"
   slide[7].src = "http://www.kgw.com/live/livecams_external/popup_tline.jpg"
 
 // Display image description & count in Form boxes
 var caption = [
       '',
       ' Downtown Portland, Pioneer Square Camera.',
       ' View of Vancouver, Washington From Camera in Vancouver.',
       ' Downtown Portland From East Side Of Willamette, River',  
       ' Camera Downtown Portland, The Wells Fargo Center.',
       ' Portland International Airport Web Camera.',
       ' Pacific Ocean from Camera at Pacific City Oregon.',
       ' Timberline Lodge (6,600ft) on Mt.Hood.(Crest 11,240ft)'
        ];
    
    function loadHandler()
 {
    // Get a reference to our text container
    var textNode = document.getElementById('text');
    
    // Set the text containers value to Temp
    textNode.firstChild.nodeValue = caption[index];
 }
 

 function newslide(direction)
 {
    if(document.images)
    {
    index = index + direction;
 
    // Check index range
    if(index < 1) index = 1;
    if(index > count) index = count;
 
    // Swap the image
    document.slider.src = slide[index].src;
    
    // Fetch the next image
    if(direction > 0 && index < count)
    {
      next = index + 1;
    }
    
    // Get a reference to our text container
    var textNode = document.getElementById('text');
    
    // Set the text containers value to Temp
    textNode.firstChild.nodeValue = caption[index];
    
    // Set the count button values
    document.frm2.left.value = "Image "+ index +" of "+ numImages; 
    }
 }   
