// JavaScript Document
	function initial(){
		$("#apDiv1").animate({ 
        opacity: 0
      }, 0,"","");
	stopit();sortirslog();

    $("#bouton1").click(function () {
	document.location=("index.html");
	});
	$("#bouton2").click(function () {
	document.location=("navettes-aeroports-gares.html");
	});
	$("#bouton3").click(function () {
	document.location=("services-transport-de-personnes.html");
	});
	$("#bouton4").click(function () {
	document.location=("tarifs-transport-competitifs.html");
	});
	$("#bouton5").click(function () {
	document.location=("reservations-navettes-privees.html");
	});
	$("#bouton6").click(function () {
	document.location=("questions-transport-taxis-navettes.html");
	});
	$("#bouton7").click(function () {
	document.location=("contact-MF-TRANSPORT.html");
	});
	$("#abs1").click(function () {
	document.getElementById("apDiv1").style.visibility='visible';
      $("#apDiv1").animate({ 
        opacity: 1
      }, 600,"","");
    });
	
	$("#abs2").click(function () {
      $("#apDiv1").animate({ 
        opacity: 0
      }, 600,"",hid);
    });
	
	$("#bouton1").hover(function () {
      $("#imgbout1").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout1").animate({ 
        opacity: 1
      }, 600,"","");
    });
	$("#bouton2").hover(function () {
      $("#imgbout2").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout2").animate({ 
        opacity: 1
      }, 600,"","");
    });
	$("#bouton3").hover(function () {
      $("#imgbout3").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout3").animate({ 
        opacity: 1
      }, 600,"","");
    });
	$("#bouton4").hover(function () {
      $("#imgbout4").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout4").animate({ 
        opacity: 1
      }, 600,"","");
    });
	$("#bouton5").hover(function () {
      $("#imgbout5").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout5").animate({ 
        opacity: 1
      }, 600,"","");
    });
	$("#bouton6").hover(function () {
      $("#imgbout6").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout6").animate({ 
        opacity: 1
      }, 600,"","");
    });
	$("#bouton7").hover(function () {
      $("#imgbout7").animate({ 
        opacity: 0
      }, 600,"","");
	}, function () {
     $("#imgbout7").animate({ 
        opacity: 1
      }, 600,"","");
    });
	
	$("#sm1").hover(function () {
      $(this).removeClass("sm");
	  $(this).addClass("smhov");
	  }, function () {
     $(this).removeClass("smhov");
	  $(this).addClass("sm");
    });
	
	$("#sm1").click(function () {
		for(i=1;i<5;i++){
		$(".contsm").eq(i-1).removeClass("vis");
		$(".contsm").eq(i-1).addClass("invis");
		$("#sm"+i).removeClass("smclick");
		$("#sm"+i).removeClass("smhov");
		$("#sm"+i).addClass("sm");
		}
      $(this).removeClass("sm");
	  $(this).removeClass("smhov");	  
	  $(this).addClass("smclick");
	  $("#illustration").html("<img src='images/courses.jpg' hspace='30' vspace='10' /><br /><img src='images/services-2.jpg' hspace='30' vspace='10' /><br /><img src='images/services.jpg' hspace='30' vspace='10' />");
	  $(".contsm").eq(0).removeClass("invis");
	  $(".contsm").eq(0).addClass("vis");
    });
	
	$("#sm2").click(function () {
		for(i=1;i<5;i++){
		$(".contsm").eq(i-1).removeClass("vis");
		$(".contsm").eq(i-1).addClass("invis");
		$("#sm"+i).removeClass("smclick");
		$("#sm"+i).removeClass("smhov");
		$("#sm"+i).addClass("sm");
		}
      $(this).removeClass("sm");
	  $(this).removeClass("smhov");	  
	  $(this).addClass("smclick");
	  $("#illustration").html("<img src='images/courses.jpg' hspace='30' vspace='10' /><br /><img src='images/handicape.jpg' hspace='45' vspace='15' /><br /><img src='images/malades.jpg' hspace='30' />");
	  $(".contsm").eq(1).removeClass("invis");
	  $(".contsm").eq(1).addClass("vis");
    });
	
	$("#sm3").click(function () {
		for(i=1;i<5;i++){
		$(".contsm").eq(i-1).removeClass("vis");
		$(".contsm").eq(i-1).addClass("invis");
		$("#sm"+i).removeClass("smclick");
		$("#sm"+i).removeClass("smhov");
		$("#sm"+i).addClass("sm");
		}
      $(this).removeClass("sm");
	  $(this).removeClass("smhov");	  
	  $(this).addClass("smclick");
	 $("#illustration").html("<img src='images/courses.jpg' hspace='30' vspace='10' /><br /><img src='images/services-2.jpg' hspace='30' vspace='10' /><br /><img src='images/services.jpg' hspace='30' vspace='10' />");
	  $(".contsm").eq(2).removeClass("invis");
	  $(".contsm").eq(2).addClass("vis");
    });
	
	$("#sm4").click(function () {
		for(i=1;i<5;i++){
		$(".contsm").eq(i-1).removeClass("vis");
		$(".contsm").eq(i-1).addClass("invis");
		$("#sm"+i).removeClass("smclick");
		$("#sm"+i).removeClass("smhov");
		$("#sm"+i).addClass("sm");
		}
      $(this).removeClass("sm");
	  $(this).removeClass("smhov");	  
	  $(this).addClass("smclick");
	  $(".contsm").eq(3).removeClass("invis");
	  $(".contsm").eq(3).addClass("vis");
    });
	
	$("#sm2").hover(function () {
      $(this).removeClass("sm");
	  $(this).addClass("smhov");
	  }, function () {
     $(this).removeClass("smhov");
	  $(this).addClass("sm");
    });
	$("#sm3").hover(function () {
      $(this).removeClass("sm");
	  $(this).addClass("smhov");
	  }, function () {
     $(this).removeClass("smhov");
	  $(this).addClass("sm");
    });
	$("#sm4").hover(function () {
      $(this).removeClass("sm");
	  $(this).addClass("smhov");
	  }, function () {
     $(this).removeClass("smhov");
	  $(this).addClass("sm");
    });
	
	
	}


function sortir(){
compt=compt+1;
if(compt==4){compt=2;}
$("#phot").html("<img src='images/milieu"+compt+".jpg'/>");
 $("#phot").animate({ 
        opacity: 1
      }, 5600,"",stopit);
}

function smvisible(a){
document.getElementById("smcont"+a).style.visibility='visible';
}

function hid(){
document.getElementById("apDiv1").style.visibility='hidden';
}

function stopit(){
setTimeout('rentrer()',20000)
}

function contin(){
setTimeout('sortir()',15000)
}

function rentrer(){
 $("#phot").animate({ 
        opacity:0
      }, 5600,"",contin);
}

function sortirslog(){
if(index=="stl"){comptslogstl=comptslogstl+1;
if(comptslogstl>($(".stl").length-1)){comptslogstl=0;comptslogsl=-1;comptslogsr=-1;};var contenuslog = $(".stl").eq(comptslogstl).html();index="sr";tpsappar=tempsapparait[0];cycle=0;
} else {
if(index=="sl"){comptslogsl=comptslogsl+1;
var contenuslog = $(".sl").eq(comptslogsl).html();index="sr";tpsappar=tempsapparait[1];cycle=cycle+1;
} else {
if(index=="sr"){comptslogsr=comptslogsr+1;
;var contenuslog = $(".sr").eq(comptslogsr).html();index="sl";tpsappar=tempsapparait[2];cycle=cycle+1;};}
}
$("#slogan").html(contenuslog);
 $("#slogan").animate({ 
        opacity: 1
      }, tpsappar,"",stopitslog);
}

function stopitslog(){
if(cycle==0){setTimeout("rentrerslog("+tempsdisparait[0]+")",tempsaffichage[0]);}
else {if(index=="sr"){setTimeout("rentrerslog("+tempsdisparait[1]+")",tempsaffichage[1]);} 
else {if(index=="sl"){setTimeout("rentrerslog("+tempsdisparait[2]+")",tempsaffichage[2]);};};}
if(cycle==2){cycle=0;index="stl";} 
}


function rentrerslog(t){
 $("#slogan").animate({ 
        opacity:0
      }, t,"",sortirslog);
}
