1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
| function GetId(id) {
return document.getElementById(id);
}
// Change la couleur du champ formulaire lorsqu on clique dessus
function input_color(current_obj) {
var objList = new Array("name", "email", "subject", "msg");
for(var i = 0; i < 4; i++) {
var obj = GetId(objList[i]);
var error = GetId("error_" + objList[i]);
if(objList[i] == current_obj) {
obj.style.backgroundColor = "#FEFFCC";
error.style.display = "none";
} else obj.style.backgroundColor = "";
}
}
// Vérifie la valeur des champs du formulaire
function form_check() {
var result = true;
if(document.contact.msg.value == "") {
document.contact.msg.focus();
result = false;
}
if(document.contact.subject.value == "") {
var error = GetId("error_subject");
error.style.display = "inline";
document.contact.subject.focus();
result = false;
}
if(document.contact.email.value == "") {
var error = GetId("error_email");
error.style.display = "inline";
document.contact.email.focus();
result = false;
} else { if(document.contact.email.value.search(/^[^._-][a-z0-9._-]+[^._-]@[a-z0-9._-]+([a-z0-9]+[^._-])?[.-]+[a-z]{2,4}$/) == -1) {
var error = GetId("error_email");
error.style.display = "inline";
document.contact.email.focus();
result = false;
}
}
if(document.contact.name.value == "") {
var error = GetId("error_name");
error.style.display = "inline";
document.contact.name.focus();
result = false;
}
return result;
}
// PageLoad function
// This function is called when:
// 1. after calling $.historyInit();
// 2. after calling $.historyLoad();
// 3. after pushing "Go Back" button of a browser
function pageload(hash) {
if(hash) {
var i = hash.indexOf("-");
var part1 = "";
var part2 = "";
if(i == -1) {
hash = hash + ".php";
if(hash == "actu.php") hash = "news.php";
} else {
part1 = hash.substr(0, i);
part2 = hash.substr(i + 1, hash.length);
hash = part1 + ".php?page=" + part2;
}
$("#content").html('<p style="text-align: center; font-weight : bold; margin-top: 30px;">Chargement... <br /><br /><img src="./template/orange/images/loading.gif"></p>');
setTimeout(function(){
$("#content").load(hash, function(){
$(".accordion h3:first").addClass("active");
$(".accordion p:not(:first)").hide();
$(".accordion h3").click(function(){
$(this).next("p").slideToggle("slow").siblings("p:visible").slideUp("slow");
$(this).toggleClass("active");
$(this).siblings("h3").removeClass("active");
});
$('#newsSlide').wslide({
width: 520,
height: 500,
horiz: true,
duration: 1000,
});
$("#galerie2007").transition({
title: "Elektrochoc 2007",
images: [
{image: "images/2007/01.jpg", thumb: "images/2007/thumb/01.jpg", title: "01.jpg"},
{image: "images/2007/02.jpg", thumb: "images/2007/thumb/02.jpg", title: "02.jpg"},
{image: "images/2007/03.jpg", thumb: "images/2007/thumb/03.jpg", title: "03.jpg"},
{image: "images/2007/04.jpg", thumb: "images/2007/thumb/04.jpg", title: "04.jpg"},
{image: "images/2007/05.jpg", thumb: "images/2007/thumb/05.jpg", title: "05.jpg"},
{image: "images/2007/06.jpg", thumb: "images/2007/thumb/06.jpg", title: "06.jpg"},
{image: "images/2007/07.jpg", thumb: "images/2007/thumb/07.jpg", title: "07.jpg"}
],
displayCaption: false,
autoRun: true,
displayTime: 5000,
transitionTime: 500
});
});
}, 400);
} else {
$("#content").html('<p style="text-align: center; font-weight : bold; margin-top: 30px;">Chargement... <br /><br /><img src="./template/orange/images/loading.gif"></p>');
setTimeout(function(){
$("#content").load("accueil.php");
}, 400);
}
}
$(document).ready(function(){
$.historyInit(pageload);
$("a[@rel='history']").click(function(){
var hash = this.href;
hash = hash.replace(/^.*#/, '');
$.historyLoad(hash);
return false;
});
}); |
Partager