<!-- ;
var newwindow;
var wheight = 0, wwidth = 0;

/* routine to create an html document on the fly and use to open 
   a new window to contain an image
*/
function popitup(localPathToImageFile, title, iwidth, iheight, colour) {

    /*When, if, I ever move this to a web server this will have to be changed to 
     the appropriate http://.... path
    */
    //var pathToFishingSpotsDir = "file:///C:/Documents%20and%20Settings/Don/workspace/SGFFWEbSite/WebContent";
    var pathToFishingSpotsDir = "http://www.sgflyfishers.com";

    url = pathToFishingSpotsDir + "//" + localPathToImageFile ;

    var pwidth, pheight;

   
  
    if ( !newwindow || newwindow.closed ) {
    pwidth=iwidth+30;
    pheight=iheight+30;
    newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10');
    wheight=iheight;
    wwidth=iwidth;
    }

    if (wheight!=iheight || wwidth!=iwidth ) {
    pwidth=iwidth+30;
    pheight=iheight+90; 
    newwindow.resizeTo(pwidth, pheight);
    wheight=iheight;
    wwidth=iwidth;
    }


    newwindow.document.clear();
    newwindow.focus();

    newwindow.document.clear();
    newwindow.focus();
   
    newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>');
    newwindow.document.writeln('<img src=' + url + ' title=\"' + title + '\" alt=\"' + title + '\" >');
    newwindow.document.writeln('<\/center> <\/body> <\/html>');
    
    /*
    newwindow.document.writeln("iheight=" + iheight + " iwidth=" + iwidth + " pheight=" + pheight
 + " pwidth=" + pwidth)    
   */
    
    
    newwindow.document.close();
    newwindow.focus();
}


function addImage(imageName, title, imageWidth, imageHeight,  thumbNailWidth, thumbNailHeight){


    document.writeln(" <IMG SRC=" + "\"" + imageName + "\" " )
    document.write("WIDTH=" + "\"" + thumbNailWidth + "\" ")
    document.write("HEIGHT=" + "\"" + thumbNailHeight + "\" ")
    document.write("HSPACE=" + "\"" + 0 + "\" ")
    document.writeln("VSPACE=" + "\"" + 0 + "\" ")
    document.write("ALT="+ "\"" + title + "\" ")
    document.write("TITLE=" + "\"" + title + "\" ")
    document.writeln(">")
}


function addConstantHeightImage(imageName, title,imageWidth, imageHeight, thumbNailHeight){
  
    thumbNailWidth = ((thumbNailHeight) * (imageWidth)) /  imageHeight 
    addImage(imageName, title, imageWidth, imageHeight,  thumbNailWidth, thumbNailHeight)
} 

function addConstantWidthImage(imageName, title, imageWidth, imageHeight, thumbNailWidth){
  
    thumbNailHeight = ((thumbNailWidth) * (imageHeight)) / imageWidth
    addImage(imageName, title, imageWidth, imageHeight,  thumbNailWidth, thumbNailHeight)
}



// Routines to tidy up popup windows when page is left
// Call with an onUnload="tidy()" in body tag

function tidy() {
if (newwindow && !newwindow.closed) { newwindow.close(); }
}
// Based on JavaScript provided by Peter Curtis at www.pcurtis.com -->


// functions for putting random pictures into the header
headerPhotos = new Array(new Array("PresidentsLetters/Aug2006/theCleanupCrew_w240h160.JPG", "Cleanup crew", 240, 160),
                         new Array("PhotoGallery/Keith-Lovin_w243h320.jpg", "Keith with Shanto Ranch trout", 243, 320),
                         new Array("PhotoGallery/Hillary-and-Brooks_w240h211.jpg", "Hillary and Brooks", 240, 211),
                         new Array("Outings/conservationElectrofishingOuting/Bruce-Electro-Fishing_w240h160.jpg", "electo fishing", 240, 160), 
                         new Array("CommunityOutreach/Bob-Bruner_w240h180.jpg", "Bob Bruner sets targets for Boy Scouts", 240, 180),
                         new Array("FishingSpots/BullCreekAtLakeAustin/LookingUpstreamOnLakeAustinfromBullCreek_w240h181.jpg", "Lake Austin from Bull Creek", 240, 181),
                         new Array("FishingSpots/BullCreekAtLakeAustin/OneOfMyFish_w240h169.jpg", "A Bull Creek sunfish", 240 ,169),
                         new Array("FishingSpots/BullCreekAtLakeAustin/UpstreamTowardCountyLineResturant_w240h178.jpg", "Bull Creek toward County Line's deck", 240, 178 ), 
                         new Array("FishingSpots/MeadowLake/fromNorthWestEndOfDamLookingNorth_w240h181.jpg", "Meadow Lake", 240, 181),
                         new Array("FishingSpots/NorthForkAtCountryClubRoad/upFromNearDam_NorthSide_w240h181.jpg", "North San Gabriel at Chandler Park", 240, 181),
                         new Array("FishingSpots/NorthForkAtRiverRoad/lookingUpStreamFromMiddleOfDownStreamPool_w240h181.jpg", "North San Gabriel near River Road", 240,181),                           
                         new Array("FishingSpots/NorthForkOfSanGabrielAtTejasPark/downStreamFromBridge_w240h181.jpg","Downsteam from Tejas Park", 240, 181),
                         new Array("FishingSpots/SanGabAtPark/downStreamFromDam_w240h181.jpg", "Downsteam from San Gabriel Park", 240, 181),
                         new Array("FishingSpots/SouthGuadalupe/trout_2_w240h180.jpg", "A Guadalupe trout", 240, 181), 
                         new Array("FishingSpots/SouthGuadalupe/trout_12_w240h180.jpg", "A Guadalupe trout", 240, 180),
                         new Array("Outings/conservationElectrofishingOuting/Chris-and-Dallas_w240h160.jpg", "Electrofishing", 240, 160),            
                         new Array("PresidentsLetters/Aug2006/keithLooksForTrash_w240h160.JPG", "Cleaning up the San Gabriel", 240, 160),
                         new Array("FishingSpots/BerrySpringsParkAndPreserve/FromEastSideLookingWest_w159h120.JPG", "Looking west across Berry Springs", 159, 120),
                         new Array("Outings/DevilsRiver2007/BirdsEyeofDolanFalls_w200h150.jpg", "Bird's eye view of Dolan Falls", 200, 150),
                         new Array("Outings/DevilsRiver2007/TheFalls_2_w200h176.jpg", "Dolan Falls", 200, 176),
                         new Array("Outings/DevilsRiver2007/ClintWithFish_1_w200h301.jpg", "Clint at Devil's River", 200,301),
                         new Array("Outings/August2007/TheCrew_w200h126.jpg", "September outing crew", 200, 126),
                         new Array("FishingSpots/SouthSanGabAtRiverDownRoad/NiceBass_w200h96.jpg", "A San Gabriel bass", 200, 96),
                         new Array("FishingSpots/LlanoAtLlano/BridgeFromBelow_w200h122.jpg", "Llano bridge at Llano", 200, 122),
                         new Array("Conservation/TheGroupAtTheDedication_w200h136.jpg", "The group at the Adopt-a-stream dedication", 200, 136),
                         new Array("Outings/ShontoRanch2008/TheGroup_w200h145.jpg", "The Shonto Ranch 2008 outing group", 200, 145),
                         new Array("Outings/ShontoRanch2008/DougCornWellWithGoldenTrout_w200h262.jpg", "Doug with golden trout", 200, 262),
                         new Array("Outings/ShontoRanch2008/PeteWithBigTrout_w200h254.jpg", "Pete with big trout", 200, 254),
                         new Array("FishingReportsNotOnTheMap/KeithLovinBonefishJan2008/KeithWithBonefish_2_w200h181.jpg", "Keith with bonefish", 200, 181),
                         new Array("FishingReportsNotOnTheMap/LakeCharlesLA/BrooksAndBruceWithRedFish_w200h150.jpg", "Bruce and Brooks with fish", 200, 151),
                         new Array("FishingReportsNotOnTheMap/LakeCharlesLA/BrooksFightsARedfish_w200h150.jpg", "Brooks fights a red fish", 200, 151),
                         new Array("Conservation/2008MayRiverCleanup/TheGroup_w200h124.jpg", "2008 river cleanup crew", 200, 124),
                         new Array("Outings/2008DevilsRiverOuting/photos/fish/John_2008_0621DFPSGFFish0026_w200h267.JPG", "Clint at the Devil&rsquo;s River", 200, 267),
                         new Array("Outings/2008DevilsRiverOuting/photos/fish/John_2008_0621DFPSGFFish0079_w200h150.JPG", "Ken at the Devil&rsquo;s River", 200, 150),
                         new Array("Outings/2008DevilsRiverOuting/photos/people/Keith_IMGP5522_w200h139.JPG", "2008 Devil&rsquo;s River crew", 200, 139),
                         new Array("GeneralImages/headerPhotosWithNoOtherHome/BerrySprings BlueGillBruce2008_w200h150.jpg", "Berry Springs bluegill", 200, 150),
                         new Array("GeneralImages/headerPhotosWithNoOtherHome/BrushyCreekSunfishBruceNumber2_2008_w200h150.jpg", "Brushy Creek sunfish", 200, 150),
                         new Array("PhotoGallery/BruceWilks2008/BobBrooksStillHouseHollowCasting_w200h160.jpg", "Bob Brooks at Stillhouse Hollow", 200, 160),
                         new Array("slideShowImages/BrushyChampionFalls_w300h225.jpg", "Brushy Creek", 300, 225 ),
                         new Array("Conservation/2009MayRiverCleanu/TheCleanupCrew_w200h121.jpg", "2009 river cleanup crew", 200, 121 ),
                         new Array("Outings/2009May15GulfCoastConclave/BrooksWithFish_w200h150.jpg", "Brooks with redfish", 200, 150 ),
                         new Array("FishingSpots/NorthForkOfSanGabrielAtTejasPark/Dec24ClintAndSonAtTejas/catfish1_w200h267.jpg", "Clint&rsquo;s son&rsquo; catfish", 200, 267 )
                         
    
    )
function randomInt() {
        return Math.floor(Math.random()* headerPhotos.length);
}

function displayRandomHeaderPhoto(pathToRoot){
        allowedHeight = 100
            
        index = randomInt();
        image = headerPhotos[index][0]
        alt =   headerPhotos[index][1]
        width = headerPhotos[index][2]
        height = headerPhotos[index][3]
        
        pathToImage = pathToRoot + "/" + image 
        addConstantHeightImage(pathToImage, alt, width, height, allowedHeight)

}