var min_day = 1, max_day = 31, month = "Gennaio ,Febbraio ,Marzo ,Aprile ,Maggio ,Giugno ,Luglio ,Agosto ,Settembre ,Ottobre ,Novembre ,Dicembre ".split(","), min_year = 2E3, max_year = min_year + 10, nbJours = 7; function leMois(a, d, e) { a = a < e.getMonth() ? e.getYear() + 1 : e.getYear(); 1900 > a && (a += 1900); return d + a }
function verifier_date_vol(a, d, e, f) {
    var b = a.selectedIndex + 1, c = d.options[d.selectedIndex].value, g = d.options[d.selectedIndex].text, j = g.indexOf(" "), g = g.substring(j, g.length); if (2 == c) if (0 == g % 4) { if (29 < b) a.selectedIndex = 28 } else { if (28 < b) a.selectedIndex = 27 } else { if (7 > c) var h = 0; else 8 < c && (h = 1); if ((7 > c || 8 < c) && c % 2 == h && 29 < b) a.selectedIndex = 29 } e.value = g; f.value = a.options[a.selectedIndex].value + "/" + d.options[d.selectedIndex].value + "/" + g; f = d.options[d.selectedIndex].value + "/" + a.options[a.selectedIndex].value + "/" +
g; if ("DEPART_DD" == a.name && "DEPART_MM" == d.name) { a = a.selectedIndex + 1; d = d.options[d.selectedIndex].value - 1; e = e.value; b = Ajout_date(a, d, e, nbJours); document.moteur.RETOUR_DD.selectedIndex = b.getDate() - 1; for (c = 0; 11 >= c; c++) if (document.moteur.RETOUR_MM.options[c].value == b.getMonth() + 1) var k = c; Afficher_Jour_Aller_Vol(a, d, e); document.moteur.RETOUR_MM.selectedIndex = k; document.moteur.RETOUR_YYYY.value = b.getYear(); Afficher_Jour_Retour_Vol(b.getDate(), b.getMonth(), b.getYear()) } else a = a.selectedIndex + 1, d = d.options[d.selectedIndex].value -
1, e = e.value, Afficher_Jour_Retour_Vol(a, d, e); sjour = GetTodayName(f)
} function Ajout_date(a, d, e, f) { for (var b = [], c = 0; 6 >= c; c++) b[c] = c % 2 ? 30 : 31; for (c = 7; 11 >= c; c++) b[c] = c % 2 ? 31 : 30; b[1] = e % 4 ? 28 : 29; for (a += f; a > b[d] && !(a -= b[d], d++, 12 == d); ); 12 == d ? (e++, a--, b = Ajout_date(1, 0, e, a)) : b = new Date(e, d, a); return b }
function saisie_date(a, d, e, f, b, c, g) {
    c = new Date(c); b = new Date(b); document.write("<select class='input1' name='" + a + "' tabindex='3' style='width:40px; color:#000000; font-size: 10px; font-family: Trebuchet; font-weight: normal;' OnChange='verifier_date_vol(form." + a + ",form." + d + ",form." + e + "," + f + ")'" + g + ">"); for (i = min_day; i <= max_day; i++) c.getDate() == i ? document.write("<option value='" + i + "' selected>" + (10 > i ? "0" + i : i)) : document.write("<option value='" + i + "'>" + (10 > i ? "0" + i : i)); document.write("</select>"); document.write("<select class='input1' name='" +
d + "' tabindex='4' style='width:117px; color:#000000; font-size: 10px; font-family: Trebuchet; font-weight: normal;' OnChange='verifier_date_vol(form." + a + ",this,form." + e + "," + f + ");'" + g + ">"); for (i = b.getMonth(); i < month.length; i++) c.getMonth() == i ? document.write("<option value='" + (i + 1) + "' selected>" + leMois(i, month[i], b)) : document.write("<option value='" + (i + 1) + "'>" + leMois(i, month[i], b)); for (i = 0; i < b.getMonth(); i++) c.getMonth() == i ? document.write("<option value='" + (i + 1) + "' selected>" + leMois(i, month[i], b)) :
document.write("<option value='" + (i + 1) + "'>" + leMois(i, month[i], b)); document.write("</select>"); annee = 1900 > c.getYear() ? c.getYear() + 1900 : c.getYear(); document.write("<input type='hidden' name='" + e + "' value='" + annee + "'>"); "D" == g && Afficher_Jour_Aller_Vol(c.getDate(), c.getMonth(), c.getYear()); "R" == g && Afficher_Jour_Retour_Vol(c.getDate(), c.getMonth(), c.getYear())
} function Trim(a) { var d = ""; for (i = 0; i < a.length; i++) " " != a.charAt(i) && (d += a.charAt(i)); return d }
function IsNumeric(a) { var d = !0; for (i = 0; i < a.length; i++) if (temp = a.charAt(i), !(0 <= temp && 9 >= temp || "." == temp)) { d = !1; break } return d } function Test_Numeric(a) { a.value = Trim(a.value); IsNumeric(a.value) || (alert("La valeur doit \u00eatre num\u00e9rique"), a.focus()) } function Compter_Chaine(a, d) { for (var e = d, f = 0, b = 0, c = 0; c < e.length; c++) b = e.indexOf(a, 0), -1 != b && (f++, e = e.substring(b + a.length, e.length)); return f }
function IsMail(a) { var d = !1; -1 != a.indexOf("@") && a.indexOf("@") != a.length - 1 && 0 != a.indexOf("@") && 1 == Compter_Chaine("@", a) && (d = !0); return d }
function GetSaturday(a, d) {
    var e = new Date(a), f = e.getDate(), b = e.getMonth(), c = e.getYear(), e = e.getDay(); date2 = ""; 1900 > c && (c += 1900); if (0 == e) return date2 = (10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 6 + d); if (1 == e) return date2 = (10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 12 + d); if (2 == e) return date2 = (10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 11 + d); if (3 == e) return date2 = (10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 10 + d); if (4 == e) return date2 =
(10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 9 + d); if (5 == e) return date2 = (10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 8 + d); if (6 == e) return date2 = (10 > f ? "0" + f : f) + "/" + (10 > b ? "0" + b : b) + "/" + c, date2 = Ajout_date(f, b, c, 7 + d)
} function GetTodayDate(a) { Aoujourdhui = new Date(a); jour = Aoujourdhui.getDate(); mois = Aoujourdhui.getMonth() + 1; annee = Aoujourdhui.getFullYear(); return date = (10 > mois ? "0" + mois : mois) + "/" + (10 > jour ? "0" + jour : jour) + "/" + annee }
function GetTodayName(a) { Aoujourdhui = new Date(a); jour = Aoujourdhui.getDay(); if (0 == jour) return "Dim"; if (1 == jour) return "Lun"; if (2 == jour) return "Mar"; if (3 == jour) return "Mer"; if (4 == jour) return "Jeu"; if (5 == jour) return "Ven"; if (6 == jour) return "Sam" }
function Afficher_Jour_Aller_Vol(a, d, e) { DateSaisie = new Date(e, d, a, 0, 0, 0, 0); jour = DateSaisie.getDay(); if (0 == jour) document.moteur.image1.src = "dimanche.gif"; if (1 == jour) document.moteur.image1.src = "lundi.gif"; if (2 == jour) document.moteur.image1.src = "mardi.gif"; if (3 == jour) document.moteur.image1.src = "mercredi.gif"; if (4 == jour) document.moteur.image1.src = "jeudi.gif"; if (5 == jour) document.moteur.image1.src = "vendredi.gif"; if (6 == jour) document.moteur.image1.src = "samedi.gif" }
function Afficher_Jour_Retour_Vol(a, d, e) { DateSaisie = new Date(e, d, a, 0, 0, 0, 0); jour = DateSaisie.getDay(); if (0 == jour) document.moteur.image2.src = "dimanche.gif"; if (1 == jour) document.moteur.image2.src = "lundi.gif"; if (2 == jour) document.moteur.image2.src = "mardi.gif"; if (3 == jour) document.moteur.image2.src = "mercredi.gif"; if (4 == jour) document.moteur.image2.src = "jeudi.gif"; if (5 == jour) document.moteur.image2.src = "vendredi.gif"; if (6 == jour) document.moteur.image2.src = "samedi.gif" };
