console.log("Photos.js by Alex Macmillan");

$(function(){
    $("#forward").click(function() {
          
        photo = $("#photos>a:first");
        $("#photos").animate({left: "-"+photo.outerWidth()}, 200, function() {
            photo.detach().appendTo("#photos");
            $(this).css({left: 0});
        });
        
    });
    
    $("#back").click(function() {

        photo = $("#photos>a:last");
        width = photo.outerWidth();
        photo.detach().prependTo("#photos");
        $("#photos").css({left: "-"+width+"px"});
        $("#photos").animate({left: 0}, 200);
                
    });
    
    // Lightbox
    $(function() {
        $('#photos a').lightBox();
    });
    
    console.log("Attached events.");
})
