var attente = 3300; var stop = false; var id_bandeau = 0; var id_news = 0; var nb_news = 4; var Bandeau = new Array(Array); Bandeau[0]=new Array(Array); Bandeau[0]["url_img"]="fichiers/acc-photo_mairie.jpg"; Bandeau[1]=new Array(Array); Bandeau[1]["url_img"]="fichiers/acc-mairie3.jpg"; Bandeau[2]=new Array(Array); Bandeau[2]["url_img"]="fichiers/acc-mairie1.jpg"; Bandeau[3]=new Array(Array); Bandeau[3]["url_img"]="fichiers/acc-mairie4.jpg"; window.addEvent("domready", function(){ menu_bandeau_off(); background(); $("bandeau_accueil").addEvent("mouseenter", function(){ menu_bandeau_on(); }); $("bandeau_accueil").addEvent("mouseleave", function(){ menu_bandeau_off(); }); $("pp").addEvent("click", function(){ if ($("pp").getProperty("src")=="img/pause.png") { stop = true; $("pp").setProperty("src", "img/play.png"); } else { stop = false; $("pp").setProperty("src", "img/pause.png"); } }); $("arr").addEvent("click", function(){ stop = true; arr(); }); $("avv").addEvent("click", function(){ stop = true; avv(); }); }); function background() { if(stop==false) { var path="js/photo.php?url="+Bandeau[id_bandeau]["url_img"]; new Request({url: path, onSuccess: function(txt){$("bandeau").set("html", txt);}, onFailure: function(){$("bandeau").set("html", "Recuperation bandeau impossible"); }}).send(); if (id_bandeau == (Bandeau.length-1)){id_bandeau=0;}else{id_bandeau=id_bandeau+1;} } setTimeout("background()",attente); } function arr() { if (id_bandeau == 0){id_bandeau=Bandeau.length-1;}else{id_bandeau=id_bandeau-1;} var path = "js/photo.php?url="+Bandeau[id_bandeau]["url_img"]; new Request({url: path, onSuccess: function(txt){$("bandeau").set("html", txt);}, onFailure: function(){$("bandeau").set("html", "Recuperation bandeau impossible"); }}).send(); } function avv() { if (id_bandeau == (Bandeau.length-1)){id_bandeau=0;}else{id_bandeau=id_bandeau+1;} var path="js/photo.php?url="+Bandeau[id_bandeau]["url_img"]; new Request({url: path, onSuccess: function(txt){$("bandeau").set("html", txt);}, onFailure: function(){$("bandeau").set("html", "Recuperation bandeau impossible"); }}).send(); } function menu_bandeau_off() { var el = $("menu_bandeau"); el.fade(0); } function menu_bandeau_on() { var el = $("menu_bandeau"); el.fade(1); }