
$(document).ready(function() {
	// hover
	
	$('.link1 span').each(function(){
		color = $(this).parent().css('color');
		$(this).css({background:color})
	})
	
	$('.link1').hover(function(){
		$(this).find('span').css({left:'0', right:'auto'}).stop().animate({width:'100%'},500,'easeOutCirc')				   
	}, function(){
		$(this).find('span').css({right:'0', left:'auto'}).stop().animate({width:0},500,'easeOutCirc')				   
	})
	
	$('.button1 strong').css({opacity:0})
	
	$('.button1').hover(function(){
		$(this).find('strong').stop().animate({opacity:1})						 
	}, function(){
		$(this).find('strong').stop().animate({opacity:0})						 
	})
	
	$('.close').css({opacity:0.4})
	
	$('.close').hover(function(){
		$(this).stop().animate({opacity:1})						 
	}, function(){
		$(this).stop().animate({opacity:0.4})						 
	})
	
	$('.catalogue a').hover(function(){
		$(this).find('img').stop().animate({opacity:0.8})
	}, function(){
		$(this).find('img').stop().animate({opacity:1})
	})
	
	$('#icons a').hover(function(){
		$(this).find('img').stop().animate({width:34, height:34, top:5, left:5}, function(){$(this).animate({top:0, left:0, width:44, height:44})})
	}, function(){})
	
	
	$('ul#menu').superfish({
      delay:       600,
      animation:   {height:'show'},
      speed:       600,
      autoArrows:  false,
      dropShadows: false
    });
	
	
		
 });
(function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var f=d.call(arguments),e=b.apply(this,[c+f[0]].concat(f));return typeof f[0]==="number"||typeof f[1]==="number"?this:e};function b(l){var m=this,h,k={},g=l?$.fn:$,n=arguments,i=4,f=n[1],j=n[2],p=n[3];if(typeof f!=="string"){i--;f=l=0;j=n[1];p=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(f){k=a[f]||(a[f]={})}}k.id&&clearTimeout(k.id);delete k.id;function e(){if(l){h.removeData(l)}else{if(f){delete a[f]}}}function o(){k.id=setTimeout(function(){k.fn()},j)}if(p){k.fn=function(q){if(typeof p==="string"){p=g[p]}p.apply(m,d.call(n,i))===true&&!q?o():e()};o()}else{if(k.fn){j===undefined?e():k.fn(j===false);return true}else{e()}}}})(jQuery);
$(window).load(function() {	
	//bg animate
	
	$('#pagination a').each(function(e){
		$(this).data({num:e})							 
	})
	
	$('#pagination a').click(function(){
		num=$(this).data('num');
		if (!$(this).parent().hasClass('active')) {
			$('#caption .active').stop().animate({left:2400, height:0, width:0},600, function(){
				$('#caption li').eq(num).addClass('active').css({left:-1600}).stop().animate({left:0, height:'100%', width:'100%'},600)														
			}).removeClass('active');
		}
	})
	
	$('#bgStretch').bgStretch({
			align:'leftTop',
			navigs:$('#pagination').navigs()
		})
		.sImg({
			spinner:$('<div class="spinner"></div>').css({opacity:.7}).hide()
	})
	
	$('#pagination li').eq(0).addClass('active');
	$('#caption li').eq(0).addClass('active').stop().animate({left:0, height:'100%', width:'100%'},600);
	var loopbg=0;
	$.doTimeout( 5000, function(){
		++loopbg;
		if (loopbg==$('#pagination a').length) loopbg=0;
		$('#pagination a')[loopbg].click();
		return true;
	});
	
	// scroll
	$('.scroll').cScroll({
		duration:700,
		step:57,
		trackCl:'track',
		shuttleCl:'shuttle'
	})	
	
	$('._up-butt, ._down-butt').css({opacity:0.4})
	
	$('._up-butt, ._down-butt').hover(function(){
		$(this).stop().animate({opacity:1})									   
	}, function(){
		$(this).stop().animate({opacity:0.4})									   
	})
	
	//content switch
	var content=$('#content'),
		nav=$('.menu');
	nav.navs({
		useHash:true,
		hoverIn:function(li){
			$('> span',li).stop().animate({width:'100%'})
		},
		hoverOut:function(li){
			if (!li.hasClass('with_ul') || !li.hasClass('sfHover')) {
				$('> span',li).stop().animate({width:0})
			}
		}				
	})	
	nav.navs(function(n, _){
		content.cont_sw(n);
	})
	content.cont_sw({
		showFu:function(){
			var _=this			
			if (_.next.attr('id')=='page_Contacts') {
				$('#map').html('<iframe width="334" height="261" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Studio+Sylvia,+brandstraat+60,+8755+Ruiselede,+Belgium&amp;aq=0&amp;sll=37.0625,-95.677068&amp;sspn=67.042676,135.263672&amp;ie=UTF8&amp;hq=&amp;hnear=Brandstraat+60,+Ruiselede+8755+Ruiselede,+West-Vlaanderen,+Vlaams+Gewest,+Belgi%C3%AB&amp;ll=51.072448,3.355154&amp;spn=67.042676,135.263672&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe>');
			}
			$.when(_.li).then(function(){	
				_.next.css({display:'block', top:-1800},600,'easeOutCirc').stop().animate({top:0})
				$('#caption').stop().animate({bottom:-210})
			});
			$('#content').stop().animate({minHeight:806})
			
		},
		hideFu:function(){
			var _=this
			_.li.stop().animate({top:1800},600, 'easeInCirc', function(){
				_.li.css({display:'none'})
				$('#caption').stop().animate({bottom:142})
			});
			$('#content').stop().animate({minHeight:306})
			
		},
		preFu:function(){
			var _=this
			_.li.css({position:'absolute', display:'none'});
		}
	})
})

	hs.graphicsDir = '/img/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.fadeInOut = true;
	hs.outlineType = 'glossy-dark';
	hs.wrapperClassName = 'dark';
	hs.captionEval = 'this.thumb.alt';
	hs.numberPosition = 'caption';
	hs.useBox = true;
	hs.width = 1000;
	hs.height = 700;
	hs.dimmingOpacity = 0.8;
	hs.headingText = '&nbsp'; // Add an empty heading text
 
	// Add the slideshow providing the controlbar and the thumbstrip
	hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			position: 'bottom center',
			opacity: .75,
			hideOnMouseOut: true
		},
		thumbstrip: {
			position: 'top center', // Set to top center
			mode: 'horizontal',
			relativeTo: 'expander',
			offsetY: -110 // Add negative offsetY
		}
	});
