
/*  ----------------------------------------------- */

//define a javascript array that contains your images
var slideShow = new Array()
slideShow[0] = "images/500_no1.jpg";
slideShow[1] = "images/500_sit-plank.jpg";
slideShow[2] = "images/driftwood.jpg";
slideShow[3] = "images/lucky.jpg";
slideShow[4] = "images/m_1249_0037.jpg";
slideShow[5] = "images/new-w0060.jpg";
slideShow[6] = "images/sofia.jpg";
slideShow[7] = "images/withdad500.jpg";


        

function startSlideshow()
{
   //processSlideshow("#bgImage", slideShow, 10000, 2000);
   processSlideshow("#bgImage", slideShow, 5000, 500);
}



$(document).ready(function () {

//   startSlideshow();
//    $('#slideshow1').cycle();

$('#s1').cycle({
    fx:     'fade',
    timeout: 4000,
    delay: -2000
});
    


   // open external links in a new window
   $("a[href^='http']").attr('target','_blank');


/*
   // preload the background images of the other pages
   $.preload([ '1', '2', '3', '4', '5' ], {
      base:'images/*',
      ext:'.jpg'
   });
*/



});


/****************************************
    Barebones Lightbox Template
    by Kyle Schaeffer
    kyleschaeffer.com
    * requires jQuery
****************************************/

// display the lightbox
function lightbox(insertContent, ajaxContentUrl){

    // add lightbox/shadow <div/>'s if not previously added
    if($('#lightbox').size() == 0){
        var theLightbox = $('<div id="lightbox"/>');
        var theShadow = $('<div id="lightbox-shadow"/>');
        $(theShadow).click(function(e){
            closeLightbox();
        });
        $('body').append(theShadow);
        $('body').append(theLightbox);
    }

    // remove any previously added content
    $('#lightbox').empty();

    // insert HTML content
    if(insertContent != null){
        $('#lightbox').append(insertContent);
    }

    // insert AJAX content
    if(ajaxContentUrl != null){
        // temporarily add a "Loading..." message in the lightbox
        $('#lightbox').append('<p class="loading">Loading...</p>');

        // request AJAX content
        $.ajax({
            type: 'GET',
            url: ajaxContentUrl,
            success:function(data){
                // remove "Loading..." message and append AJAX content
                $('#lightbox').empty();
                $('#lightbox').append(data);
            },
            error:function(){
                alert('AJAX Failure!');
            }
        });
    }

    // move the lightbox to the current window top + 100px
    $('#lightbox').css('top', $(window).scrollTop() + 100 + 'px');

    // display the lightbox
    $('#lightbox').show();
    $('#lightbox-shadow').show();

}

// close the lightbox
function closeLightbox(){

    // hide lightbox and shadow <div/>'s
    $('#lightbox').hide();
    $('#lightbox-shadow').hide();

    // remove contents of lightbox in case a video or other content is actively playing
    $('#lightbox').empty();
}

