var rvm= new function() {}; rvm.AfficherAutrePhoto= function(cpt) { if (rvm["params"]["images"].length <= 1) { return; } if (typeof rvm["params"]["images"][cpt] == "undefined") { return; } $("img#imgPrincipale").attr("src", rvm["params"]["images"][cpt]); var nouveauCpt= (cpt == rvm["params"]["images"].length - 1) ? 0 : cpt + 1; setTimeout("rvm.AfficherAutrePhoto(" + nouveauCpt + ");", 3000); }; rvm.TimerPhotos= function(strImageSupplementaires) { rvm["params"]["images"]= Array(); var photoSupplementaires= $.secureEvalJSON(strImageSupplementaires); if (photoSupplementaires.length > 0) { $(photoSupplementaires).each(function() { rvm["params"]["images"].push(this); }); } // On ajoute la première. rvm["params"]["images"].push($("img#imgPrincipale").attr("src")); setTimeout("rvm.AfficherAutrePhoto(0);", 3000); }; rvm.AppliquerReglesAuDOM= function() { $("span#spanPoserQuestion").click(function() { $("form#formPoserQuestion").trigger("submit"); }); $("span#spanRechercher").click(function() { $("form#formRechercher").trigger("submit"); }); $("span.liensAddthis").click(function() { if ($(this).attr("id") != "") { var idLien= $(this).attr("id").replace(/spanAddThis/g, "aAddThis"); if (idLien != $(this).attr("id") && $("a#" + idLien).length > 0) { $("a#" + idLien).trigger("click"); } } }); $("a.aAddThisCustom").click(function() { if ($(this).attr("id") != "") { var idLien= $(this).attr("id").replace(/aAddThisCustom/g, "aAddThis"); if (idLien != $(this).attr("id") && $("a#" + idLien).length > 0) { $(this).attr("href", $("a#" + idLien).attr("href")); } } }); if ($("input#imageSupplementaires").length > 0 && $("img#imgPrincipale").length > 0) { if ($("input#imageSupplementaires").val() != "") { rvm.TimerPhotos($("input#imageSupplementaires").val()); } } $(".element_invisible").css({opacity: 0}); }; $(document).ready(function() { rvm["params"]= new Array(); rvm.AppliquerReglesAuDOM(); });