$(document).ready(function(){
	
$("a[rel='external']").click(function() {
window.open(this.getAttribute("href"), "popup", "");
return false;
});

if ($('body').attr('id')=="gallery-series") {
	var scrollCall;
	var ScrollEnd = 0;
	var viewCan;
	var upScroll = $('#product-info .prev span');
	var downScroll = $('#product-info .next span');
	var newCan;
	var currentCan;
	var scrollAmount;
	var initMove = 0;
	
	$.easing.custom = function (x, t, b, c, d) { 
	    var s = 1.70158;  
	    if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
	    return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
	}
	
	if ($('body').hasClass('productInfo')) {
		scrollCall = $("div.scrollable").scrollable({
					api: true,
					vertical:true,
					size: 2,
					clickable:false,
					easing: 'custom'
				});
				
		$('.scrollable').css('opacity', 1);
	}
	else
	{
		scrollCall = $("div.scrollable").scrollable({
			vertical:true,
			size: 2,
			clickable:false,
			easing: 'custom'
		}).circular({api: true});
		initMove = 4;
	
	}
		scrollCall.move(initMove, 0, function() { 
			this.getConf().easing = 'linear'; 
			$('.scrollable').animate({opacity: '0'}, 1200, function() { 
				$('.scrollable').animate({opacity: '1'}, 600, function() { 
					scrollCall.move(-4, 750);
					scrollCall.getConf().easing = 'custom';
				});
			});
		
		});
	
		$('#gallery-series #statement a').click(function (event){
			event.preventDefault();
			newCan = parseInt($(this).attr('href').slice(-1));
			currentCan = parseInt(scrollCall.getPageIndex()*2);
			viewCan = newCan - currentCan;
			scrollCall.move(viewCan, 350);
		});
}

$('#internatnav').css('height', '20px');

$('#internatnav').hover(function(){			
	$(this).stop().animate({height: '72px'}, 70);
}, function(){
	$(this).stop().animate({height: '20px'}, 70);
});
	
}); //doc ready
