var valeur=0;
function init(){
$("#affajaxdiv").load("./html/acc.html",function(){
defil_img(0,"acc");
});
$("#logo").animate({top:"+=218"},2000);
$("#acc").animate({top:"+=80"},2000);
$("#menu_acc").hoverIntent(function(){
if(valeur!=0){
$("#acc").animate({top:"+=80"},700);
}
},function(){
if(valeur!=0){
$("#acc").animate({top:"-=80"},700);
}
});
$("#logo").hoverIntent(function(){
if(valeur!=0){
$("#acc").animate({top:"+=80"},700);
}
},function(){
if(valeur!=0){
$("#acc").animate({top:"-=80"},700);
}
});
$("#menu_egi").hoverIntent(function(){
if(valeur!=1){
$("#egi").animate({top:"+=80"},700);
}
},function(){
if(valeur!=1){
$("#egi").animate({top:"-=80"},700);
}
});
$("#menu_bati").hoverIntent(function(){
if(valeur!=2){
$("#bati").animate({top:"+=80"},700);
}
},function(){
if(valeur!=2){
$("#bati").animate({top:"-=80"},700);
}
});
$("#menu_auto").hoverIntent(function(){
if(valeur!=3){
$("#auto").animate({top:"+=80"},700);
}
},function(){
if(valeur!=3){
$("#auto").animate({top:"-=80"},700);
}
});
$("#menu_clim").hoverIntent(function(){
if(valeur!=4){
$("#clim").animate({top:"+=80"},700);
}
},function(){
if(valeur!=4){
$("#clim").animate({top:"-=80"},700);
}
});
$("#menu_cont").hoverIntent(function(){
if(valeur!=5){
$("#cont").animate({top:"+=80"},700);
}
},function(){
if(valeur!=5){
$("#cont").animate({top:"-=80"},700);
}
});
$("#logo").bind("click",function(){
choix_anim(valeur);
valeur=0;
$("#affajaxdiv").load("./html/acc.html",function(){
defil_img(0,"acc");
});
});
$("#navigation").find("li").each(function(){
var _1=$(this).attr("id");
var _2=_1.substring(_1.indexOf("_")+1,_1.length);
var _3=parseInt($(this).attr("num"));
var _4=parseInt($(this).attr("nbf"));
$(this).click(function(){
choix_anim(valeur);
valeur=_3;
$("#affajaxdiv").load("./html/"+_2+".html",function(){
defil_img(_4,_2);
});
});
});
}
function defil_img(_5,_6){
if(_5>0){
_5++;
var _7="";
for(var _8=1;_8<_5;_8++){
_7+="<img src=\"images/"+_6+"/"+_8+".jpg\" border=\"0\" alt=\"\" />";
}
$("#img_defil_"+_6).html(_7);
$("#img_defil_"+_6).css("text-align","center");
$("#img_defil_"+_6).cycle({fx:"fade",timeout:2000});
}
if(_6=="acc"){
$("#image_slide").cycle({fx:"scrollLeft",timeout:5000});
}
}
function choix_anim(_9){
switch(_9){
case 1:
$("#egi").animate({top:"-=80"},700);
break;
case 2:
$("#bati").animate({top:"-=80"},700);
break;
case 3:
$("#auto").animate({top:"-=80"},700);
break;
case 4:
$("#clim").animate({top:"-=80"},700);
break;
case 5:
$("#cont").animate({top:"-=80"},700);
break;
default:
$("#acc").animate({top:"-=80"},700);
break;
}
}


