jQuery(document).ready(function(){
	jQuery('.work-wrap').containedStickyScroll({
        duration: 0,
    });
});

$(document).ready(function() {

	$("a.gallery-images").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'titlePosition' 	: 'inside',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<div id="tip7-title">' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
		}
	});

});

var jump = function(e) {
    //prevent the "normal" behaviour which would be a "hard" jump
    e.preventDefault();
    //Get the target
    var target = $(this).attr("href");
    //perform animated scrolling
    $('html,body').animate({
        //get top-position of target-element and set it as scroll target
        scrollTop: $(target).offset().top
        //scrolldelay: 2 seconds
    }, 400, function() {
        //attach the hash (#jumptarget) to the pageurl
        location.hash = target;
    });

}

$(document).ready(function() {
    $('a[href*=#]').bind("click", jump);
    return false;
});
