			
$(document).ready(function(){

	$('#nojs').remove();
	
    $('#left .fadein').fadeIn(2000);
	
	$('#profiles a').hover(
		function(){$(this).find('strong').stop(true,true).fadeTo(50, 1);}, 
		function(){$(this).find('strong').stop(true,true).fadeTo(500, 0);
	});	

	
	$('#header ul a, #lrn').hover(
		function(){$(this).find('span').stop().fadeTo(50, 1);}, 
		function(){if ($(this).parent('li').hasClass('active')){ return;};$(this).find('span').stop().fadeTo(500, 0);}
	);
	setInterval(function() {
		$('#home-img').find('img').fadeIn(2000);
		$('#circles').fadeIn(1000);		
	}, 100);
	
	setInterval(function() {	
		$('#fix').fadeOut(2000);		
	}, 600);
	
	$('#home-banner').cycle({
			fx: 'fade',
			timeout: 5000,
			next: '#next',
			speed: 2400,
			delay: 0
	});

	$('#mot, #pp').hover(
		function(){$(this).find('em').stop(true,true).fadeTo(200, 1);}, 
		function(){$(this).find('em').stop(true,true).fadeTo(500, 0);
	});	
	
	$('#header ul a').hover(
		function(){$(this).stop().animate({'color' : '#fff'}, 50);}, 
		function(){$(this).stop().animate({'color' : '#999'}, 300);	
	});	

	if($(".gallery").length)
	{
		$("a[rel=lbx]").fancybox({
				'transitionIn'		: 'fade',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + '<\/span>';
			}			
		});
	}	

	if($(".tst").length)
	{
		$("a[rel=lbx]").fancybox({
				'transitionIn'		: 'fade',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'autoScale'			: false,
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
						return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + '<\/span>';
			}			
		});
	}		
	$("#form").validate();	

	$('.blank').click(function(){ window.open(this.href);return false });

});

