$('document').ready(function(){

$('body').wrapInner($(document.createElement("div")).attr('id','wrapAll'));

$('#nav li a').mouseenter(function(){
	$(this).children().animate({top:'-5px'},200);
	});
	
$('#nav li a').mouseleave(function(){
	$(this).children().animate({top:'0px'},200);
	});
	
$('#nav li:last-child').addClass('lastChild');
	
$('#footer div+div').prepend($(document.createElement("a")).attr('href','#'));
$('#footer div+div > a').prepend($(document.createElement("img")).attr('src','_images/footer/close.png').attr('alt','close'));
	
$('#footer').hide();

$('#wrapFooter').height(55);

$('#openFooter').show().children().children().click(function(){
	
		$('#openFooter').fadeOut();
		
		$('#wrapFooter').animate({
		
			height:125
		
		},500,function(){$('#footer').fadeIn();});

	});
	
$('#footer div+div > a').click(function(){
	
		$('#footer').fadeOut();
		
		$('#wrapFooter').animate({
		
			height:55
		
		},500,function(){$('#openFooter').fadeIn();});

	});
	
/* $('#slideshow ul').cycle({timeout:8000,speed:2000}); */

$('.fancyBox a').fancybox({padding:5,overlayColor:'#000',overlayOpacity:0.5,titleShow:false});

$('a.videoLink').fancybox({padding:5,overlayColor:'#000',overlayOpacity:0.5,titleShow:false});


	$("a.target").attr("target", "_blank");
	
	if ($("#contact").length==1)
	{
		$("#content p+p+p img").wrap("<a href='mailto:infos@zyrgomatik.be' />");
	}
	
	frmSubmit($("form#frmNewsletter"), "actions.php", "newsletter");
	
	
if ($('#spectacles').length==1){

	$('a.link1').mouseenter(function(){
	
		$(this).children('p').children('img').attr('src','_images/spectacles/spectacle1-link-hover.png');
	
	}).mouseleave(function(){
	
		$(this).children('p').children('img').attr('src','_images/spectacles/spectacle1-link.png');
	
	});
	
	$('a.link2').mouseenter(function(){
	
		$(this).children('p').children('img').attr('src','_images/spectacles/spectacle2-link-hover.png');
	
	}).mouseleave(function(){
	
		$(this).children('p').children('img').attr('src','_images/spectacles/spectacle2-link.png');
	
	});
	
	$('a.link3').mouseenter(function(){
	
		$(this).children('p').children('img').attr('src','_images/spectacles/spectacle3-link-hover.png');
	
	}).mouseleave(function(){
	
		$(this).children('p').children('img').attr('src','_images/spectacles/spectacle3-link.png');
	
	});


}

});
