//PORTFOLIO SLIDER
$(function() {
//vars
var conveyor = $(".content-conveyor", $("#sliderContent")),
item = $(".item", $("#sliderContent"));

//set length of conveyor
conveyor.css("width", item.length * parseInt(item.css("width")));

//config
var sliderOpts = {
max: (item.length * parseInt(item.css("width"))) - parseInt($(".viewer", $("#sliderContent")).css("width")),
     slide: function(e, ui) { 
     conveyor.css("left", "-" + ui.value + "px");
    }
 };

//create slider
$("#slider").slider(sliderOpts);

});

//LIGHTBOX
$(function() {
    $('#gallery a').lightBox();
});

//CAPTION
$(document).ready(function(){
	//To switch directions up/down and left/right just place a "-" in front of the top/left attribute
	//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({left:'0px'},{queue:false,duration:250});
	}, function() {
		$(".cover", this).stop().animate({left:'209px'},{queue:false,duration:200});
	});
});

//BACK TO TOP SCROLL
$(document).ready(function(){
$('a[href*=#header]').click(function() {
if (location.pathname.replace(/^\//,") == this.pathname.replace(/^\//,")
&& location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target
|| $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body')
.animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
})