$(document).ready(function(){
	//gallery 1
	$("#gallery1").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
        
        //gallery 2
	$("#gallery2").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
        
        //gallery 3
	$("#gallery3").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
        
        //gallery 4
	$("#gallery4").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
        
        //gallery 5
	$("#gallery5").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
        
        //gallery 6
	$("#gallery6").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
        
        //gallery 7
	$("#gallery7").jCarouselLite({
			btnNext: ".next",
		 	btnPrev: ".prev",
			visible: 2,
			speed: 300,
			easing: 'easeOutCirc'
	});
	Cufon.now(); 
});
$(document).ready(function() {
	
	// hover
	
	$('#logo').hover(function(){
		$(this).stop().animate({marginTop:'-20'},300,'easeOutCirc');				  
	}, function(){
		$(this).stop().animate({marginTop:'-40'},300,'easeOutCirc');				  
	})
	
	$('.button1').hover(function(){
		$(this).stop().animate({backgroundPosition:'50% -50px'},700,'easeOutQuad')						 
	}, function(){
		$(this).stop().animate({backgroundPosition:'50% 50px'},700,'easeOutQuad')						 
	})
	
	$('.banner1').hover(function(){
		$(this).find('span').stop().animate({bottom:'-20', right:'-20', width:'90', height:'90'},400,'easeOutCirc')						 
	}, function(){
		$(this).find('span').stop().animate({bottom:'-10', right:'-10', width:'70', height:'70'},400,'easeOutCirc')
	})
	
	$('.banner2').hover(function(){
		$(this).find('span').stop().animate({bottom:'-7', right:'-7', width:'90', height:'90'},400,'easeOutCirc')						 
	}, function(){
		$(this).find('span').stop().animate({bottom:'3', right:'3', width:'70', height:'70'},400,'easeOutCirc')
	})
	
	$('.list1 a').hover(function(){
		$(this).parent().find('span').stop().animate({rotate:'360deg'},500)						 
	}, function(){
		$(this).parent().find('span').stop().animate({rotate:'0deg'},500)						 
	})
	
	$('#gallery1 .active, .rooms .active').css({ opacity:'0'})
	
	$('#gallery1 li > div').hover(function(){
		$(this).find('.active').stop().animate({opacity:'1'},300);								   
		$(this).find('p,h2').css({color:'#fff'});

	},function(){
		$(this).find('.active').stop().animate({opacity:'0'},300);						   
		$(this).find('p,h2').css({color:'#000'});

	})
        
        $('#gallery2 .active, .rooms .active').css({ opacity:'0'})
	
	$('#gallery2 li > div').hover(function(){
		$(this).find('.active').stop().animate({opacity:'1'},300);								   
		$(this).find('p,h2').css({color:'#fff'});

	},function(){
		$(this).find('.active').stop().animate({opacity:'0'},300);						   
		$(this).find('p,h2').css({color:'#000'});

	})
        
        $('#gallery3 .active, .rooms .active').css({ opacity:'0'})
	
	$('#gallery3 li > div').hover(function(){
		$(this).find('.active').stop().animate({opacity:'1'},300);								   
		$(this).find('p,h2').css({color:'#fff'});

	},function(){
		$(this).find('.active').stop().animate({opacity:'0'},300);						   
		$(this).find('p,h2').css({color:'#000'});

	})
        
        $('#gallery4 .active, .rooms .active').css({ opacity:'0'})
	
	$('#gallery4 li > div').hover(function(){
		$(this).find('.active').stop().animate({opacity:'1'},300);								   
		$(this).find('p,h2').css({color:'#fff'});

	},function(){
		$(this).find('.active').stop().animate({opacity:'0'},300);						   
		$(this).find('p,h2').css({color:'#000'});

	})
	
	$('.rooms').hover(function(){
		$(this).find('.active').stop().animate({opacity:'1'}, function(){$(this).css({opacity:'none'})})				   
	}, function(){
		$(this).find('.active').stop().animate({opacity:'0'})				   
	})
	
	//contact form
	$('#ContactForm').forms({
		ownerEmail:'mail@gebrkoehoorn.nl'
	})
	
	//menu
	$('#menu').superfish({
      delay:       300,
      animation:   {opacity:'show', height:'show'},
      speed:       400,
      autoArrows:  false,
      dropShadows: false
    });
	
	// for lightbox
	$("a[data-type^='prettyPhoto']").prettyPhoto({theme:'light_square'});
	
	var content=$('#content'),
		nav=$('.menu'),
		footer_nav=$('.footer_menu');
	nav.navs({
		useHash:true,
		hoverIn:function(li){
			$('> span',li).stop().animate({backgroundPosition:'50% -110px'},700, 'easeOutQuad');
		},
		hoverOut:function(li){
			if (li.attr('class')!='sfHover') {
				$('> span',li).stop().animate({backgroundPosition:'50% 0px'},700, 'easeOutQuad');
			}
		},
		hover:true
	})	
	footer_nav.navs({
		useHash:true,
		hover:true
	})	
	nav.navs(function(n, _){
			content.cont_sw(n);
			footer_nav.navs(n);
			$('> ul > li> a', nav).stop().animate({backgroundPosition:'50% -130px'},700, 'easeOutQuad');
			$('> ul > li> span', nav).stop().animate({backgroundPosition:'50% 0px'},700, 'easeOutQuad');
			if (_.n!=-1) {
				$('> ul > li> a', nav).eq(_.n).stop().animate({backgroundPosition:'50% 0px'},700, 'easeOutQuad');
			}
	})	
	content.cont_sw({
		showFu:function(){
			var _=this
			$.when(_.li.find('.inner')).then(function(){
				$.when(_.li.find('.box')).then(function(){	
					$.when(_.li.find('.shape')).then(function(){					  
						_.next.css({display:'block'}).find('.box').stop().animate({height:'100%', width:'100%', marginTop:'0', marginLeft:'0'},500, 'easeOutCirc', function(){
							_.next.find('.inner').css({display:'block'}).stop().animate({opacity:'1'}, function(){$(this).css({opacity:'none'})})																																				
						});
					});	
				});	
			});	
		},
		hideFu:function(){
			var _=this
			_.li.find('.inner').stop().animate({opacity:'0'},300, function(){
				$(this).css({display:'none'})
				_.li.find('.box').stop().animate({height:'0', width:'0', marginTop:'301', marginLeft:'475'},500, 'easeOutCirc', function(){
					$(this).parent().find('.shape').stop().animate({height:'301', width:'475', marginTop:'151', marginLeft:'238'},500, 'easeOutCirc').animate({height:'0', width:'0', marginTop:'301', marginLeft:'475'},500, 'easeOutCirc', function(){$(this).parent().css({display:'none'})});																													 
				});
			})
		},
		preFu:function(){
			var _=this
			_.li.css({position:'absolute', display:'none'});
			_.li.find('.box').css({ height:'0', width:'0', marginTop:'301px', marginLeft:'475px'});
			_.li.find('.inner').css({opacity:'0', display:'none'});
			_.li.find('.shape').css({ height:'0', width:'0', marginTop:'301px', marginLeft:'475px'});
		}
	})
	
		
	//bg animate
	$('#bgSlider').bgSlider({
		duration:1000,
		pagination:'.pagination',
		preload:true,
		spinner:'.bg_spinner'
	})
		
 });
