
/* simple code to run thumbnails for the weddings galleries */




    function showcase( thumbelement )
    {

        $('LargeImage').src = thumbelement.src.gsub( 'thumb', 'large');
        $('LargeImage').currentThumbElement = thumbelement;
    }


    function nextImage()
    {
        Try.these(
            function(){		showcase( $( 'LargeImage' ).currentThumbElement.next() );    },
            function(){		showcase( $( 'thumbnails').down('img')   );    }
        );					
    }
    
    function previousImage()
    {
        Try.these(
            function(){		showcase( $( 'LargeImage' ).currentThumbElement.previous() );    },
            function(){		showcase( $( 'thumbnails').select('img').last()   );    }
        );					
    }

    Event.observe( window, 'load', function() {

            $$( '#thumbnails img' ).each( 
                function( thumbelement )
                {
                    Event.observe( thumbelement, 'mouseover', function() {						
                        showcase( this );													
                    });
                }
            );
    });
