// grab the flash gallery as an object, declare GalleryId
var galleryId
var flashMovie;

$(document).ready(function() {
    
    flashMovie = document.getElementById('Gallery');
    
    $('a.gallery').each(function() {
    	var results = $(this).attr('href').match(/([\d]+)$/);
    	var id = results[0];	
    	$(this).hover(function() {
            flashMovie.rolloverGalleryId(id);
    	}, function() {
            flashMovie.rolloutGalleryId(id);
    	});
    	$(this).click(function(e) {
    	    e.preventDefault();
    		// To my flash pass the ID
    		$('a.gallery').removeClass('selected');
    		$(this).addClass('selected');
            flashMovie.updateGalleryId(id);
    	});
    });
    $('#pageFooter').hide();
});

function resetHeight(height) {
    $('#flashGallery').css({height: height+30});
    $('#flashGallery embed').attr('height', height+30);
}

function goToByScroll(position){
    position = position+102;
    $('html,body').stop(true, true);
    $('html,body').animate({scrollTop: position}, 600, "swing");
}