// ouverture d'une fenêtre version "accessible"
function OpenWindowByTarget(target, url, width, height, top, left) {
var wdw;
var options = "menubar=yes,toolbar=yes,resizable=yes,scrollbars=yes";
wdw = window.open(url, target, "top="+top+",left="+left+",width="+width+",height="+height+","+options);
wdw.focus();
return false;
}
// insertion du lien vers les listes des arrêts et lieux publics
function insertGetPointsList(typePT, DepArr, scoOpt, formName) {
var html = "";
var separateur = "";
if (typePT == 0 || typePT == 2) {
// lien vers les arrêts
html = '
Liste des arrêts';
}
if (typePT == 0 || typePT == 1) {
// lien vers les lieux publics
html = 'Liste des lieux publics';
}
if (html != '')
html = '';
document.write(html);
}
// accès à la liste des points d'arrêt / lieux publics
function getPointsList(type, dest, sco, formName, rub_code)
{
// récup de l'objet commune (hidden ou combo)
var obj = eval("document." + formName + ".com" + dest);
if (obj.type != "hidden")
var comID = obj.options[obj.selectedIndex].value;
else
var comID = obj.value;
var listPopup = window.open("/ri/popup.asp?rub_code=" + rub_code + "&type=" + type + "&dest=" + dest + "&comID=" + comID + "&sco=" + sco, "listPopup", "width=500,height=500,top=0,left=150,resizable=yes,scrollbars=yes,menubar=yes,status=no");
listPopup.focus();
}
// accès à la liste des points d'arrêt pour les préférences utilisateur
function getPointsList(type, dest)
{
// récup de l'objet commune (hidden ou combo)
var obj = eval("document.routeForm.com" + dest);
if (obj.type != "hidden")
var comID = obj.options[obj.selectedIndex].value;
else
var comID = obj.value;
var listPopup = window.open("/ri/popup.asp?rub_code=&type=" + type + "&dest=" + dest + "&comID=" + comID, "listPopup", "width=620,height=500,top=0,left=150,resizable=no,scrollbars=yes,menubar=no,status=no");
listPopup.focus();
}
// changement de mode scolaire ON / OFF
function changeSchoolOption() {
var newLoc = ""
var loc = window.location.href;
var pos = loc.indexOf("&sco=1");
if (pos > -1)
// on désactive la recherche scolaire
newLoc = loc.substring(0, pos) + loc.substring(pos+6, loc.length)
else
// on active la recherche scolaire
newLoc = location + "&sco=1";
window.location = newLoc;
}
// lien vers la fiche horaire d'une ligne via la carto Flash
function getLine(lineId) {
if (lineId)
window.location = "/horaires_ligne/index.asp?rub_code=6&lign_id=" + lineId;
}
// ouverture du plan d'un dépositaire
function getMapSalePoint(id)
{
var parametre_fenetre = 'scrollbars=yes,width=500,height=550,top=50,left=50;menubar=no,resizable=no,scrollbars=no';
var URL_PLAN = "/ri//CarteGoogle.asp?";
var URL_PLAN = URL_PLAN + "dep_id=" + id;
var newWindow = window.open(URL_PLAN, 'MAP',parametre_fenetre);
newWindow.focus();
}
var plv = new Number(15000);
// lancement
function play()
{
setTimeout('stop()', plv);
}
// stop
function stop()
{
document.getElementById("flash").style.visibility = "hidden"
}
// format date
function formatDate(inf_date)
{
actu=new Date();
date = document.getElementById(inf_date).value
res = date.indexOf('/')
if (res == -1)
{
day=date.substring(0,2);
month=date.substring(2,4);
year=date.substring(4);
date = day + "/" + month + "/" + year
}
day=date.substring(0,2);
month=date.substring(3,5);
year=date.substring(6);
if (year.length < 3)
{
year = 20 + year
}
date = day + "/" + month + "/" + year
document.getElementById(inf_date).value = date
}
// calcul de l'age
function calc_age(inf_date, inf_age)
{
actu=new Date();
date = document.getElementById(inf_date).value
res = date.indexOf('/')
if (res == -1)
{
day=date.substring(0,2);
month=date.substring(2,4);
year=date.substring(4);
date = day + "/" + month + "/" + year
}
day=date.substring(0,2);
month=date.substring(3,5);
year=date.substring(6);
if (year.length < 3)
{
var nb = parseInt(year)
if (nb + 2000 < actu.getFullYear())
{
year = nb + 2000
}
else
{
year = nb + 1900
}
}
date = day + "/" + month + "/" + year
document.getElementById(inf_date).value = date
if((actu.getMonth()+1)>=month)
{
if((actu.getMonth()+1)==month)
{
if(actu.getDate()>=day)
{
mois=(actu.getMonth()+1)-month;
ans=actu.getFullYear()-year;
}
else
{
mois=(12-month)+(actu.getMonth()+1);
ans=actu.getFullYear()-year-1;
}
}
else
{
mois=(actu.getMonth()+1)-month;
ans=actu.getFullYear()-year;
}
}
else
{
mois=(12-month)+(actu.getMonth()+1);
ans=actu.getFullYear()-year-1;
}
if(actu.getDate()>day)
{
jours=actu.getDate()-day;
}
else
{
jours=(30-day)+(actu.getDate());
}
while(jours>30)
{
jours-=30;
mois+=1;
}
while(mois>12)
{
mois-=12;
ans+=1;
}
//return ans;
out=document.getElementById(inf_age);
out.innerHTML= ans;
}
// formatage heure
function formatHeure(inf_heure)
{
actu=new Date();
lHeure = document.getElementById(inf_heure).value
lHeure = lHeure.replace('h', ':')
res = lHeure.indexOf(':')
if (lHeure.length < 4)
{
if (res == -1)
lHeure = lHeure + ":00"
else
lHeure = lHeure + "00"
}
else if (res == -1)
{
h=lHeure.substring(0,2);
m=lHeure.substring(2,4);
lHeure = h + ":" + m
}
document.getElementById(inf_heure).value = lHeure
}