	// sliders
	$(window).load(function() {
	   $('.slider').nivoSlider({
			effect:'fold', //Specify sets like: 'fold,fade,sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft' 
			slices:12,
			animSpeed:500,
			pauseTime: 999999999,		
			startSlide:0, //Set starting Slide (0 index)
			directionNav:false, //Next & Prev
			directionNavHide:false, //Only show on hover
			controlNav:true, //1,2,3...
			controlNavThumbs:false, //Use thumbnails for Control Nav
			controlNavThumbsFromRel:false, //Use image rel for thumbs
			controlNavThumbsSearch: '.jpg', //Replace this with...
			controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
			keyboardNav:true, //Use left & right arrows
			pauseOnHover:true, //Stop animation while hovering
			manualAdvance:false, //Force manual transitions
			captionOpacity:1, //Universal caption opacity
			beforeChange: function(){},
			afterChange: function(){},
			slideshowEnd: function(){} //Triggers after all slides have been shown
		});
	});
$(document).ready(function() {
	
	$('.balls a').hover(function(){
		var top=$(this).data('top')-20;
		$(this).data('top',top);
		$(this).stop().animate({top:top},600);					
	}, function(){
		var top=$(this).data('top')+20;
		$(this).data('top',top);
		$(this).stop().animate({top:top},1000,'easeOutBounce')
	})
	
	//content & menu
	$('ul#menu').superfish({
      delay:       600,
      animation:   {opacity:'show', height:'show'},
      speed:       400,
      autoArrows:  false,
      dropShadows: false
    });
	var content=$('.content'),
		nav=$('.menu');
	nav.navs({
		useHash:true,
		hover:true
	})
	nav.navs(function(n){
			content.cont_sw(n);
	})
	
	content.cont_sw({
		showFu:function(){
			var _=this
			$.when(_.li).then(function(){										   
				_.next.css({visibility:'visible'}).stop().animate({height:'411'},400)
				if (_.next.attr('id')=='page_Portfolio') {$('#content').css({zIndex:'4'});_.next.animate({paddingBottom:'90'})}
			});
		},
		hideFu:function(){
			var _=this
				_.li.not(':hidden').stop().animate({height:'0'},400, function(){$(this).css({visibility:'hidden'})});
				if (_.li.attr('id')=='page_Portfolio') {$('#content').css({zIndex:'1'});}
				$('#page_Portfolio').animate({paddingBottom:'0'})
		},
		preFu:function(){
			var _=this
			_.li.css({position:'absolute', visibility:'hidden', height:'0'});
		}
	})
	nav.navs(0);
	
	//gallery
	
	$("#gallery").jCarouselLite({
		btnNext: ".down",
		btnPrev: ".up",
		visible: 7,
		speed: 400,
		vertical: true,
        circular: false,
		easing: 'easeOutCirc'
	});
	// slideDown
	$('.slideDown dt').data('fl',true);
	
	$('.up, .down').find('.img_act').css({marginTop:'27px', marginLeft:'27px', width:'0', height:'0', zIndex:'2'})
	$('.close').find('.img_act').css({marginTop:'12px', marginLeft:'12px', width:'0', height:'0', zIndex:'2'})
	$('.up, .down').hover(function(){
			$(this).find('.img').stop().animate({marginTop:'27px', marginLeft:'27px', width:'0', height:'0', zIndex:'2'},400, 'easeOutCirc')	
			$(this).find('.img_act').stop().animate({marginTop:'0', marginLeft:'0', width:'100%', height:'100%', zIndex:'1'},400, 'easeOutCirc')				   
		}, function(){
			$(this).find('.img_act').stop().animate({marginTop:'27px', marginLeft:'27px', width:'0', height:'0', zIndex:'2'},400, 'easeOutCirc')	
			$(this).find('.img').stop().animate({marginTop:'0', marginLeft:'0', width:'100%', height:'100%', zIndex:'1'},400, 'easeOutCirc')	
		}
	)
	$('.close').hover(function(){
			$(this).find('.img').stop().animate({marginTop:'12px', marginLeft:'12px', width:'0', height:'0', zIndex:'2'},400, 'easeOutCirc')	
			$(this).find('.img_act').stop().animate({marginTop:'0', marginLeft:'0', width:'100%', height:'100%', zIndex:'1'},400, 'easeOutCirc')				   
		}, function(){
			$(this).find('.img_act').stop().animate({marginTop:'12px', marginLeft:'12px', width:'0', height:'0', zIndex:'2'},400, 'easeOutCirc')	
			$(this).find('.img').stop().animate({marginTop:'0', marginLeft:'0', width:'100%', height:'100%', zIndex:'1'},400, 'easeOutCirc')	
		}
	)
	$('#gallery li').each(function(i){
		$('dt',this).click(function(){
			if ( $(this).hasClass('active') ) {				
				$(this).removeClass("active").parent().find('dd').stop().animate({height:'0'},400);
				$(this).parent().parent().stop().animate({'min-height':'50'})
				$('#gallery ul').animate({top:top1});
				
			} else {
				$(this).addClass("active").parent().find('dd').stop().animate({height:'324'},400);
				$(this).parent().parent().stop().animate({'min-height':'374'});
				top1 = $('#gallery ul').css('top')
				var top=-i*54;
				$('#gallery ul').animate({top:top})
			}
		})
	})
});

function close_trigger(){
	$('.slideDown .active').click();
}

$(window).load(function() {	
	// scroll
	$('.scroll').cScroll({
		duration:700,
		step:100,
		trackCl:'track',
		shuttleCl:'shuttle',
	})					
})



