$(document).ready(function() {
	$('a.thumb').hover(
		function(){
			$(this).find('span').show();
		},
		function(){
			$(this).find('span').hide();
		});
	$('.client-login').click(function(e) { e.preventDefault();});
	$('.client-login').colorbox({width:"auto", inline: true, href: "#client-login", opacity: .7});
	$('#client-login-submit').click(function(){
		$(this).closest('div').find('.error').css('visibility', 'visible');
	});

	$('.director-bio-link').colorbox({width:"auto", inline: true, href: "#director-bio", opacity: .7});

	$(".strip-container").scrollable({
		items: $(this).find('.strip li'),
		keyboard: false
	});

	$('.strip-container').each(function(){
		var api = $(this).data('scrollable');
		if (api.getSize() > 5) {
			$(this).closest('li').find('.nextPage').show();
		}
	});

	$('.nextPage').click(function() {
		var api = $(this).parent().find('.strip-container').data('scrollable');
		api.move(5);
		if ((api.getIndex()+5) >= api.getSize()) {
			$(this).hide();
		}
		if (api.getIndex() >0) {
			$(this).closest('li').find('.prevPage').show();
		}
	});

        $('.prevPage').click(function() {
                var api = $(this).parent().find('.strip-container').data('scrollable');
		api.move(-5);
                if ((api.getIndex()) == 0) {
                        $(this).hide();
                }
		if ((api.getIndex()+5) < api.getSize()) {
			$(this).closest('li').find('.nextPage').show();
		}
        });
});

