// <![CDATA[// -----------------------------------------------------------------------------------// // This page coded by Scott Upton// http://www.uptonic.com | http://www.couloir.org//// This work is licensed under a Creative Commons License// Attribution-ShareAlike 2.0// http://creativecommons.org/licenses/by-sa/2.0///// Associated API copyright 2002, Travis Beckham (www.squidfingers.com)//// -----------------------------------------------------------------------------------// --- version date: 12/14/04 ------------------------------------------------------//var photoId = 0;var photoDir = "photos/";var borderSize = 20// get current photo id from URLvar thisURL = document.location.href;var splitURL = thisURL.split("#");var photoId = splitURL[1] - 1;// if no id in query string then set i=1photoId = (!photoId)? 0:photoId;// List of photos in this galleryphotoArray = new Array(    "IMG_1363.jpg",    "IMG_1367.jpg",    "IMG_1368.jpg",    "IMG_1369.jpg",    "IMG_1371.jpg",    "IMG_1375.jpg",    "IMG_1377.jpg",    "IMG_1378.jpg",    "IMG_1380.jpg",    "IMG_1381.jpg",    "IMG_1382.jpg",    "IMG_1383.jpg",    "IMG_1384.jpg",    "IMG_1391.jpg",    "IMG_1393.jpg",
    "IMG_1394.jpg",    "IMG_1396.jpg",    "IMG_1397.jpg",    "IMG_1399.jpg",    "IMG_1404.jpg",    "IMG_1410.jpg",    "IMG_1414.jpg");var photoNum = photoArray.length;// Pixel width of each photo in this galleryphotoWidthArray = new Array(    "375",    "500",    "500",    "500",    "500",    "500",    "500",    "500",    "500",    "500",    "375",    "500",    "375",    "375",    "375",
    "500",    "500",    "500",    "500",    "500",    "375",    "375");// Pixel height of each photo in this galleryphotoHeightArray = new Array(    "500",    "375",    "375",    "375",    "375",    "375",    "375",    "375",    "375",    "375",    "500",    "375",    "500",    "500",    "500",    "375",    "375",    "375",    "375",    "375",    "500",    "500");// Captions for photoscaptionArray = new Array(    "July 1 &rsaquo; Meet Grace, my cousin Matt&rsquo;s two year old daughter",    "July 2 &rsaquo; Grace and her mom Erin wave goodbye (sort of) as we get ready to leave",    "July 2 &rsaquo; Apparently, she can be a little sassy when she wants to be",    "July 3 &rsaquo; Ben, my five year old cousin, wants to go swimming. I cannot blame him",    "July 3 &rsaquo; Uncle Jack, my mom, and Grammy float in Lake Avalon as Aunt Jenean drifts away in the background",    "July 3 &rsaquo; My cousin Tony borrows his girlfriend&rsquo;s sunglasses as we go for a boat ride",    "July 3 &rsaquo; There is nothing like a boat ride on a hot, sunny day on the lake",    "July 3 &rsaquo; A sailboater enjoys the weather directly across the lake from the cottage",    "July 3 &rsaquo; More sailboaters float on the water as we cruise by",    "July 3 &rsaquo; We drift back into &ldquo;port&rdquo; as the cottage keeps watch up the hill",    "July 3 &rsaquo; A view from the end of the dock",    "July 3 &rsaquo; In my highly-biased opinion, there isn&rsquo;t a nicer place on earth than this little log cabin",    "July 3 &rsaquo; The view back toward the lake from the front porch",    "July 4 &rsaquo; My three year old cousin Sam (Ben&rsquo;s little brother) tests out my sandals",
    "July 6 &rsaquo; The sun starts to set slowly over the lake",    "July 6 &rsaquo; Clean, clear, shiny water glistens in the sunshine",    "July 6 &rsaquo; Grammy&rsquo;s flowers glow in silhouette against the late afternoon sun",    "July 6 &rsaquo; While I lounge in a deck chair, I cannot help but enjoy the view",    "July 6 &rsaquo; The calm evening water is too nice to not ski. My brother shows off his slalom form",    "July 6 &rsaquo; Swinging outside the wake over the calm water, I can see straight to the bottom as I glide over on skis",    "July 7 &rsaquo; As the time came to leave, I snapped a pic looking back at the cottage from the parking area up the hill",    "July 7 &rsaquo; The best way back to Minnesota is via the Mackinac Bridge between the lower and upper peninsulas of Michigan");// Create access to 'Detect' object and a place to put instances of 'HTMLobj'API = new Detect();// CREATE INSTANCES & LOADloadAPI = function(){    // Instantiate HTMLobj    API.Container = new HTMLobj('Container');    API.PhotoContainer = new HTMLobj('PhotoContainer');    API.Photo = new HTMLobj('Photo');        nextPhoto();}onload = loadAPI;// Fade in photo when it is loaded from the server// Called by the image.onload eventinitFade = function(){    // Be certain the tween is complete before fading, too    var fade_timer = setInterval('startFade()', 1000);        // Fade photo in when ready and clear listener    startFade = function(){        if(API.Container._tweenRunning == false){            clearInterval(fade_timer);            API.PhotoContainer.fadeIn(0,15,33);        } else {            return;        }    }}// Advance Photo ID by oneadvancePhoto = function(){    // Cycle through to end, then repeat    if(photoId == (photoArray.length - 1)){        photoId = 0;    } else {        photoId++;    }    return photoId;}// Function to load subsequent photos in gallerynextPhoto = function(){		    // Hide photo container temporarily    API.PhotoContainer.hide();    API.PhotoContainer.setOpacity(0);                // Get dimensions of photo    var wNew = photoWidthArray[photoId];    var hNew = photoHeightArray[photoId];        // Start tween on a delay    setTimeout('API.Container.tweenTo(easeInQuad, [API.Container.getWidth()-borderSize, API.Container.getHeight()-borderSize], ['+wNew+','+hNew+'], 7)',500);        // Set source, width, and height of new photo    document.getElementById('Photo').src = photoDir + photoArray[photoId];    document.getElementById('Photo').width = wNew;    document.getElementById('Photo').height = hNew;    document.getElementById('NextLink').href = "#" + (photoId+1);    document.getElementById('NextLink2').href = "#" + (photoId+1);    document.getElementById('Caption').innerHTML = captionArray[photoId];    document.getElementById('Counter').innerHTML = (photoId+1)+' of '+photoNum;        // Advance counter to next photo    advancePhoto();}// Reverse Photo ID by onereversePhoto = function(){    // Cycle through to end, then repeat    if(photoId == 0){        photoId = (photoArray.length - 1);    } else {        photoId--;    }    return photoId;}// Function to load subsequent photos in galleryprevPhoto = function(){	    // Hide photo container temporarily    API.PhotoContainer.hide();    API.PhotoContainer.setOpacity(0);                // Get dimensions of photo    var wNew = photoWidthArray[photoId];    var hNew = photoHeightArray[photoId];        // Start tween on a delay    setTimeout('API.Container.tweenTo(easeInQuad, [API.Container.getWidth()-borderSize, API.Container.getHeight()-borderSize], ['+wNew+','+hNew+'], 7)',500);        // Set source, width, and height of new photo    document.getElementById('Photo').src = photoDir + photoArray[photoId];    document.getElementById('Photo').width = wNew;    document.getElementById('Photo').height = hNew;    document.getElementById('PrevLink').href = "#" + (photoId+1);    document.getElementById('Caption').innerHTML = captionArray[photoId];    document.getElementById('Counter').innerHTML = (photoId+1)+' of '+photoNum;        // Advance counter to next photo    reversePhoto();}// ]]>