/* document */

$(document).ready(function(){

	$('a[href^="http"]').attr('target', '_blank');

	

	$('#content').attr({scrollTop:0, scrollLeft:0});
	$.localScroll.hash({
		target: '#content',
		axis: 'xy',
		queue: true,
		duration: 2000
	});
	var $last=$([]);
	$.localScroll({
		target: '#content',
		axis: 'xy',
		queue: true,
		duration: 1500,
		hash: true,
		onBefore:function(e, anchor, $target ){
			$last.removeClass('scrolling');
			$last=$(this).addClass('scrolling');
			if(this.blur)
				this.blur();
		},
		onAfter:function(anchor){
			$last.removeClass('scrolling');
		}
	});
	$.easing.backout=function(x, t, b, c, d){
		var s=1.70158;
		return(c*((t=t/d-1)*t*((s+1)*t+s)+1)+b);
	};
	$('#carousel').scrollShow({
		itemSize:{
			height:250,
			width:250
		},
		view: '#view',
		content: '#images',
		easing: 'backout',
		navigators: 'a[id]',
		navigationMode: 'sr',
		circular:true,
		start:0
	});

	var images=0;
	$('#images li').each(function(index){
		images=images+$(this).outerWidth();
		$('#images').width(images);
	});

	$('#star').star();

});