Jquery(document).ready(function(){
var animationSpeed = "fast" ;
Jquery(".CMS_menusL1 li.m > a.m").bind("mouseenter",function(){
if(Jquery(this).next("ul").length != 0){
if(!Jquery(this).next("ul").hasClass("open") && !Jquery(this).next("ul").hasClass("opening")/* */ ){
// var interruptedAnimation = false;
if(Jquery(this).next("ul").hasClass("closing")){
Jquery(this).next("ul").stop(true, false);
Jquery(this).next("ul").data('interruptedAnimation', 'close');
Jquery(this).next("ul").removeClass("closing");
// interruptedAnimation = true;
}
/* currUL = Jquery(this).next("ul").get(0);
if(currUL.style.display=='' && currUL.style.overflow=='hidden'){
interruptedAnimation = true;
} */
Jquery(".opening").stop(true, false);
Jquery(".opening").data('interruptedAnimation', 'open');
Jquery(".opening").addClass("closing");
Jquery(".closing").removeClass("opening");
Jquery(".open").addClass("closing");
Jquery(".closing").removeClass("open");
Jquery(".closing").slideUp(animationSpeed, function(){
Jquery(this).removeClass("closing");
if(Jquery(this).data('interruptedAnimation')!='none'){
Jquery(this).data('interruptedAnimation','none');
Jquery(this).removeAttr("style");
Jquery(this).hide();
}
});

Jquery(this).next("ul").addClass("opening");
if(Jquery(this).next("ul").data('interruptedAnimation')!='none'){
Jquery(this).next("ul").animate({'height':(Jquery(this).next("ul").data('originalHeight')+'px'), 'padding-top':'1px'}, animationSpeed, function(){
Jquery(this).addClass("open");
Jquery(this).removeClass("opening");
Jquery(this).removeAttr("style");
Jquery(this).data('interruptedAnimation','none');
});
}else{
Jquery(this).next("ul").slideDown(animationSpeed, function(){
Jquery(this).addClass("open");
Jquery(this).removeClass("opening");
});
}
}
} else {
Jquery(".opening").stop(true, false);
Jquery(".opening").data('interruptedAnimation', 'open');
Jquery(".opening").addClass("closing");
Jquery(".closing").removeClass("opening");
Jquery(".open").addClass("closing");
Jquery(".closing").removeClass("open");
Jquery(".closing").slideUp(animationSpeed, function(){
Jquery(this).removeClass("closing");
if(Jquery(this).data('interruptedAnimation')!='none'){
Jquery(this).data('interruptedAnimation','none');
Jquery(this).removeAttr("style");
Jquery(this).hide();
}
});
}
});
Jquery(".CMS_menusL1 a").bind("mouseenter", function(){
if(!Jquery(this).hasClass("o")){Jquery(this).addClass("o");
Jquery(this).bind("mouseleave", function(){
if(Jquery(this).hasClass("o")){
Jquery(this).removeClass("o");
}
});
}
});

Jquery(".CMS_menusL1").bind("mouseleave", function(){
Jquery(".opening").stop(true, false);
Jquery(".opening").data('interruptedAnimation', 'open');
Jquery(".opening").addClass("closing");
Jquery(".closing").removeClass("opening");
Jquery(".open").addClass("closing");
Jquery(".closing").removeClass("open");
Jquery(".closing").slideUp(animationSpeed, function(){
Jquery(this).removeClass("closing");
});
});
uls=Jquery(".CMS_menusL2");

// IE7 Bug fix Detection :: Start
if(Jquery.browser.msie){
isIE = true;
version = Jquery.browser.version;
if(version=='8.0'){
IEbugFix=false;
}else{
IEbugFix=true;
}
} else {
isIE = false;
IEbugFix = false;
}
// IE7 Bug fix Detection :: End

 for(n=0;n<uls.length;n++){
// IE7 Bug fix :: Start
if ( isIE && IEbugFix) {
h=0;
lis=uls[n].getElementsByTagName("li");
for(i=0;i<lis.length;i++){
if(Jquery(lis[i]).width()>h){
h=Jquery(lis[i]).width();
//lis[i].style.width=h+'px';
//lis[i].firstChild.style.width=(h-8-60)+'px';
}
}
for(i=0;i<lis.length;i++){
lis[i].style.width=h+'px';
//lis[i].firstChild.style.width=(h-8-60)+'px';
}
}
// IE7 Bug fix :: End
Jquery(uls[n]).data('originalHeight', Jquery(uls[n]).height());
}
Jquery(".CMS_menusL2").data('interruptedAnimation', 'none');
Jquery(".CMS_menusL2").hide();
Jquery(".CMS_menusL1 a:first").addClass("first");
if(Jquery("li.selectedMenu").length != 0){
Jquery("li.ongletactif").removeClass("ongletactif");
}
});

