$(document).ready(function(){  

//slide en diagonal bloc 3
  $('.eimm_col2_bloc3.slide').hover(function(){  
         $(".eimm_col2_bloc3_front", this).stop().animate({top:'-260px', left:'325px'},{queue:false,duration:500},{easing:'easeOutElastic'});  
     }, function() {  
         $(".eimm_col2_bloc3_front", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:500},{easing:'easeOutElastic'});  

    });  

	
//slide en diagonal bloc 4
  $('.eimm_col2_bloc4.slide').hover(function(){  
         $(".eimm_col2_bloc4_front", this).stop().animate({top:'-260px', left:'-325px'},{queue:false,duration:500},{easing:'easeOutElastic'});  
     }, function() {  
         $(".eimm_col2_bloc4_front", this).stop().animate({top:'0px', left:'0px'},{queue:false,duration:500},{easing:'easeOutElastic'});  
    });  
	

	// on met le background a none
/*	var imageUrl = "../images/eimm_col3_degrade.png";
	

	// find the div.fade elements and hook the hover event
	$('.hover').hover(function() {
		// on hovering over find the element we want to fade *up*
		var fade = $('.hover', this).parent();
		//$('.hover').parent().css("background-image", 'url('+imageUrl+')');
		//$('.hover').parent().css('background-image', 'url("../images/eimm_col3_degrade.png")');
 
		// if the element is currently being animated (to fadeOut)...
		if (fade.is(':animated')) {
			// ...stop the current animation, and fade it to 1 from current position
			fade.stop().fadeTo(500, 1);
		} else {
			fade.fadeIn(500);
		}
	}, function () {
		var fade = $('.hover', this).parent();
		if (fade.is(':animated')) {
			fade.stop().fadeTo(500, 0);
		} else {
			fade.fadeOut(500);
		}
	});
 
	// get rid of the text
	//$('li > .hover').empty();*/
	

//$('.hover').parent().css( {backgroundPosition: "-500px 0"}).mouseover
$('.hover').parent().css({backgroundPosition: "+308px 0"});
$('.hover').parent().mouseover(
		 function()
		 {
			//$(this).stop().animate({backgroundPosition:"0 0"}, {duration:800})
			$(this).stop().animate({backgroundPosition: "0px" }, {duration: 500});
		 }
)
 
 
$('.hover').parent().mouseout(

		function()
		{
			$(this).stop().animate( { backgroundPosition: "+308px" }, {duration: 500});
			//$(this).stop().animate({backgroundPosition:"500px 0"}, {duration:800})
		}
 )
 
 
 /***Liens sur une div**/
 
$(".eimm_col2_bloc1").mouseover(function(){
$(this).css("cursor","pointer").find("a").css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc_img_lien_hover.gif)");
}).mouseout(function(){
$(this).find("a").css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc_img_lien.gif)");
}).click(function(e){
document.location.href = $(this).find("a").attr("href");
e.preventDefault();
});


$(".eimm_col2_bloc2").mouseover(function(){
$(this).css("cursor","pointer").find("a").css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc_img_lien_hover.gif)");
}).mouseout(function(){
$(this).find("a").css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc_img_lien.gif)");
}).click(function(e){
$(this).find("a").trigger("click");
e.preventDefault();
});


 /***Liens sur une div + animation**/
 
$(".eimm_col3_bloc_fleche").hide();
$(".eimm_col3_bloc_fleche_rouge").hide();

$(".eimm_col3_bloc1").css({backgroundPosition: "+308px 0"});
$(".eimm_col3_bloc2").css({backgroundPosition: "308px 0"});
$(".eimm_col3_bloc3").css({backgroundPosition: "+308px 0"});

$(".eimm_col3_bloc1").mouseenter(function(){
$(this).css("cursor","pointer").find("a").css("text-decoration","none");
$(this).find("p").animate({paddingLeft: "17px" }, {duration: 90});
$(this).find("span").show();
$(this).find("span").animate({left:'144px'}, {duration: 90});
$(this).stop().animate({backgroundPosition: "0px" }, {duration: 500});
//$(this).stop().animate({backgroundColor: '#e1e1e1'}, 2000);
});

$(".eimm_col3_bloc1").mouseleave(function(){
$(this).find("a").css("text-decoration","none");
$(this).find("p").animate({paddingLeft: "15px" }, {duration: 90});
//$(this).stop().animate({backgroundColor:'transparent'}, 500);
$(this).find("span").hide();
$(this).find("span").animate({left:'136px'}, {duration: 90});
$(this).stop().animate({ backgroundPosition: "+308px" }, {duration: 500});
});

$(".eimm_col3_bloc1").click(function(e){
document.location.href = $(this).find("a").attr("href");
e.preventDefault();
});


$(".eimm_col3_bloc2").mouseenter(function(){
$(this).css("cursor","pointer").find("a").css("text-decoration","none");
//$(this).stop().animate({backgroundColor: '#e1e1e1'}, 2000);
$(this).find("p").animate({paddingLeft: "17px" }, {duration: 50});
$(this).find("span").show();
$(this).find("span").animate({left:'145px'}, {duration: 90});
$(this).stop().animate({backgroundPosition: "0px" }, {duration: 500});
}).mouseleave(function(){
$(this).find("a").css("text-decoration","none");
//$(this).stop().animate({backgroundColor:'#C30C0C'}, 500);
$(this).find("p").animate({paddingLeft: "15px" }, {duration: 50});
$(this).find("span").hide();
$(this).find("span").animate({left:'135px'}, {duration: 90});
$(this).stop().animate({ backgroundPosition: "308px" }, {duration: 500});
}).click(function(e){
$(this).find("a").trigger("click");
e.preventDefault();
});


$(".eimm_col3_bloc3").mouseenter(function(){
$(this).css("cursor","pointer").find("a").css("text-decoration","none");
//$(this).stop().animate({backgroundColor: '#e1e1e1'}, 2000);
$(this).find("p").animate({paddingLeft: "17px" }, {duration: 50});
$(this).find("span").show();
$(this).find("span").animate({left:'144px'}, {duration: 90});
$(this).stop().animate({backgroundPosition: "0px" }, {duration: 800});
}).mouseleave(function(){
$(this).find("a").css("text-decoration","none");
//$(this).stop().animate({backgroundColor:'transparent'}, 500);
$(this).find("p").animate({paddingLeft: "15px" }, {duration: 50});
$(this).find("span").hide();
$(this).find("span").animate({left:'136px'}, {duration: 90});
$(this).stop().animate({ backgroundPosition: "+308px" }, {duration: 500});
}).click(function(e){
document.location.href = $(this).find("a").attr("href");
e.preventDefault();
});


	$(".popin").fancybox({
	
		'zoomOpacity'	: 	true,
		'frameWidth'	:	855,
		'frameHeight'	:	625,
		'overlayShow'	:	true,
		'overlayOpacity':	0.3,
		'overlayColor'	:	'#000',
		'centerOnScroll' :	true,
		'hideOnContentClick' : false
	});
	
	
		$(".popin_carte").fancybox({
	
		'zoomOpacity'	: 	true,
		'frameWidth'	:	855,
		'frameHeight'	:	625,
		'overlayShow'	:	true,
		'overlayOpacity':	0.3,
		'overlayColor'	:	'#000',
		'centerOnScroll' :	true,
		'hideOnContentClick' : false
	});
	
 
 /* $("#eimm_menu a").hover(function(){
    $(this).stop();
    $(this).fadeTo(500, 1);
  }, function(){
    $(this).stop();
    $(this).fadeTo(500, 0);  
  });*/
  
  	
	/*$("#eimm_menu a").css({"opacity" : 0}).hover(function(){ 

		$(this).stop().animate({"opacity" : "1"}, 1000); 
		// au mouse over
		}, function(){
		//$(this).fadeTo("slow", 0);
		$(this).stop().animate({"opacity" : "0"}, 1000); 
	});
	*/
	
		$("#eimm_menu li").css({"opacity" : 0}).mouseenter(function(){
	
		$(this).stop().animate(
			{"opacity" : "1"}, 1000); 
		})
		.mouseleave(function(){
			$(this).stop().animate(
				{"opacity" : 0.2}, 0); 
			});
			
			
$(".eimm_col2_bloc3_back li").mouseover(function(){
$(this).css("cursor","pointer");
$(this).css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc4_back_button_hover.gif)");
}).mouseout(function(){
$(this).css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc4_back_button.gif)");
});


$(".eimm_col2_bloc4_back li").mouseover(function(){
$(this).css("cursor","pointer");
$(this).css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc4_back_button_hover.gif)");
}).mouseout(function(){
$(this).css("background-image","url(http://www.societegenerale.fr/images/eimm_col2_bloc4_back_button.gif)");
});
  
 });  
