$(document).ready(function(){
	
	$(function () {
		
		// Page ThematicBox animation

		/* Box1 */
		$(".thematicBox #box1").hover(function() {
			$(this).toggleClass('hover', 250);
			$('#pageThematicBox #box1 a').animate({opacity: "1"},{ queue: false, duration:150});
			$('#homepageThematicBox #box1 .ifHover').animate({opacity: "1"},{ queue: false, duration:150});
		},function(){
			$('#pageThematicBox #box1 a').stop().animate({opacity: "0"},{duration:150});
			$('#homepageThematicBox #box1 .ifHover').stop().animate({opacity: "0"},{duration:150});
		});
		/* Box2 */
		$(".thematicBox #box2").hover(function() {
			$(this).toggleClass('hover', 250);
			$('#pageThematicBox #box2 a').animate({opacity: "1"},{ queue: false, duration:150});
			$('#homepageThematicBox #box2 .ifHover').animate({opacity: "1"},{ queue: false, duration:150});
		},function(){
			$('#pageThematicBox #box2 a').stop().animate({opacity: "0"},{duration:150});
			$('#homepageThematicBox #box2 .ifHover').stop().animate({opacity: "0"},{duration:150});
		});
		/* Box3 */
		$(".thematicBox #box3").hover(function() {
			$(this).toggleClass('hover', 250);
			$('#pageThematicBox #box3 a').animate({opacity: "1"},{ queue: false, duration:150});
			$('#homepageThematicBox #box3 .ifHover').animate({opacity: "1"},{ queue: false, duration:150});
		},function(){
			$('#pageThematicBox #box3 a').stop().animate({opacity: "0"},{duration:150});
			$('#homepageThematicBox #box3 .ifHover').stop().animate({opacity: "0"},{duration:150});
		});
		/* Box4 */
		$(".thematicBox #box4").hover(function() {
			$(this).toggleClass('hover', 250);
			$('#pageThematicBox #box4 a').animate({opacity: "1"},{ queue: false, duration:150});
			$('#homepageThematicBox #box4 .ifHover').animate({opacity: "1"},{ queue: false, duration:150});
		},function(){
			$('#pageThematicBox #box4 a').stop().animate({opacity: "0"},{duration:150});
			$('#homepageThematicBox #box4 .ifHover').stop().animate({opacity: "0"},{duration:150});
		});

	});

});
