
$(document).ready(function() {
	// hover
	
	$('#menu> li > a strong').css({opacity:0})
	
	$('#menu > li').hover(function(){
		$(this).find('> a strong').stop().animate({opacity:1})			   
	}, function(){
		if  (!$(this).hasClass('active')&&!$(this).hasClass('sfHover')) {
			$(this).find('> a strong').stop().animate({opacity:0})			   
		}
	})
	
	$('.list1 .img_act').css({opacity:0, display:'none'})
	
	$('.list1 li').hover(function(){
		$(this).find('.img_act').css({display:'block'}).stop().animate({opacity:1}, function(){$(this).css({opacity:'none'})})						  
	}, function(){
		$(this).find('.img_act').stop().animate({opacity:0}, function(){$(this).css({display:'none'})})						  
	})
	
	$("a[data-type^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'facebook',slideshow:3000, autoplay_slideshow: false});
		$('.lightbox-image').hover(function(){
			$(this).find('.play').stop().animate({width:71, height:71, marginTop:-35, marginLeft:-35})
		}, function(){
			$(this).find('.play').stop().animate({width:51, height:51, marginTop:-25, marginLeft:-25})
		})
	
		
	
	$('ul#menu').superfish({
      delay:       600,
      animation:   {height:'show'},
      speed:       600,
      autoArrows:  false,
      dropShadows: false
    });
	
		//gallery 
	$("#gallery1").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
       		mouseWheel: true,
			visible: 3,
        	vertical: true,
			speed: 600,
			easing: 'easeOutCirc'
	});

	$('#gallery1 a').hover(function(){
		$(this).find('img').stop().animate({opacity:0.7})							
	},function(){
		$(this).find('img').stop().animate({opacity:1})							
	})
	
		
 });
$(window).load(function() {	
	//bg animate
	
	$('#bgStretch').bgStretch({
			align:'leftTop',
			navigs:$('#pagination').navigs()
		})
		.sImg({
			spinner:$('.spinner').css({opacity:.7}).hide()
	})
	
	$('#pagination li').eq(0).addClass('active');
	
	// scroll
	$('.scroll').cScroll({
		duration:700,
		step:63,
		trackCl:'track',
		shuttleCl:'shuttle'
	})
	
	// contact form
	$('#ContactForm').forms({
		ownerEmail:'#'
	})	
	
	//content switch
	var content=$('#content'),
		nav=$('.menu');
	nav.navs({
		useHash:true
	})	
	nav.navs(function(n, _){
		content.cont_sw(n);
		$('#menu > li').not('.sfHover').find('>a strong').stop().animate({opacity:0})
		if (_.n!=-1) {
			$('#menu > li').eq(_.n).find('>a strong').stop().animate({opacity:1})
		}
		if (_.n==0) {
			$('#content').stop().animate({height:310})
		} else {
			$('#content').stop().animate({height:510})
		}
	})
	content.cont_sw({
		showFu:function(){
			var _=this			
			$.when(_.li).then(function(){
				_.next.css({display:'block', left:-1500}).stop().animate({left:0},600, function(){
					
				});	
			});
		},
		hideFu:function(){
			var _=this
			_.li.stop().animate({left:2000},600, function(){
				_.li.css({display:'none'})
			})
		},
		preFu:function(){
			var _=this
			_.li.css({position:'absolute', display:'none'});
		}
	})
	nav.navs(0);
	
	var h_cont=950;
	function centre() {
		var h=$(window).height();
		if (h>h_cont) {
			m_top=~~(h-h_cont)/2+12;
		} else {
			m_top=12;
		}
		$('#content').stop().animate({marginTop:m_top})
	}
	centre();
	$(window).resize(centre);
	
})
