var obj = null;

function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast').parent().parent().parent().find('.tplboxm').fadeIn('fast');	
	} //if
} //checkHover


//*************Specials******/
//initSpecs : comportement des specials
// Lancer la fn dans d.ready.
//***************************/
function initSpecs() {
    //on cache toutes leslistes sous-rubriques
    $('ul.speclist ul').hide();
   
    $.each($('ul.speclist'), function(){
        $('#' + this.id + '.expandfirst ul:first').show();
    });
   
    //Gestion du survol sur les specials
    $('ul.speclist li.specdev a').mouseover(
        function() {
       
            var checkElement = $(this).next();
            var parent = this.parentNode.parentNode.id;

          
            if($('#' + parent).hasClass('noaccordion')) {
                $(this).next().slideToggle(1000);
                return false;
            }
             
            if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
                if($('#' + parent).hasClass('collapsible')) {
                    $('#' + parent + ' ul:visible').slideUp(1000);
                }
                return false;
            }
            if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
                $('#' + parent + ' ul:visible').slideUp(1000);
                checkElement.slideDown(1000);
                return false;
            }
        }
    );
   
}
//Fin de la fonction initSpecs




$(document).ready(function() {
	
	 $(".imgmen li ").mouseenter(function(){
 	  		  $(this).children().css({color:"#fff",fontSize:"15px",fontWeight:"bold"});	
 	  		 //  $(this+"img").css({width:"130px"});	
 	  })
 	  .mouseleave(function(){
 	  		 $(this).children().css({color:"#ccc",fontSize:"12px",fontWeight:"normal"});
 	  		  //  $(this).css({width:"105px"});	
 	  		 //  $(this+"img").css({width:"130px"});	
 	  });
		
	initSpecs();
	//document.getElementById("logo").style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=fig0902.png,sizingMethod='scale')";
	
	
	//Repositionnement des blocs nav laterales
	if($(window).width()>1400){
		$("#latnav").css({'width' : '1400px', 'left' : '50%' , 'margin-left' : '-700px' });
		//$("#latnav").html("repositionne");
	}
	
	$(".toggle_container").hide(); 

	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	$(".btn75").click(function(){
		//$(this).hide();
		$(this).toggleClass("active").slideToggle("fast").slideToggle("normal").next().slideToggle("slow");
	});

	
	$(window).resize(function(){
		if($(window).width()>1400){
			//alert("width >1200")
			$("#latnav").css({'width' : '1400px', 'left' : '50%' , 'margin-left' : '-700px' });
			//$("#latnav").html("repositionne");
		}else{
			$("#latnav").css({'width' : 'auto', 'left' : '0%' , 'margin-left' : '0px' });
			//$("#latnav").html("hello");
		}
	});
	//$(this).find('ul').css(ncol);
	$('#menue > li').hover(function() {
		if (obj) {
				obj.find('ul').fadeOut('fast',function(){}).parent().parent().parent().find('.tplboxm').fadeIn('fast');
				obj = null;
		} //if
		
		//alert(ncol);
		
		$(this).find('ul').css({'opacity' : '0.6'});
		
		
		
		if($(this).find('ul')){
			
			
		}
		$(this).find('ul').fadeIn('fast',function(){		}).parent().parent().parent().find('.tplboxm').fadeOut('fast');;
		
		//$('.tplboxm').fadeOut('fast');
		
	}, function() {
	
		obj = $(this);
		setTimeout(
			"checkHover()",
			0); // si vous souhaitez retarder la disparition, c'est ici
	});
});
