<!--

function redirect() {
  i = document.languageSelector.lang.selectedIndex;
  url = document.languageSelector.lang.options[i].value;
  parent.location.href = url;
}

function birthdayPopup(image) {
  var birthdayWin;
  birthdayWin=window.open ("images/users/" + image + ".jpg","","width=600,height=480,scrollbars=no,resizable=no,screenX=0,screenY=0");
}

function newWin(w,h,dir,pic,url,text) {
  var win;
  win=window.open ("ecard_send.php?directory=" + dir + "&image=" + pic + "&page=" + url + "&image_text=" + text + "","Ecards","width=" + w + ",height=" + h + ",scrollbars=yes,resizable=no,screenX=50,screenY=50");
}

function agendaWin(id) {
  var win2;
  win2=window.open ("agenda_details.php?id=" + id,"Agenda","width=400,height=300,scrollbars=yes,resizable=no,screenX=50,screenY=50");
}

function emailCheck(str) {
  var at="@"
  var dot="."
  var lat=str.indexOf(at)
  var lstr=str.length
  var ldot=str.indexOf(dot)
  if (str.indexOf(at)==-1){
    alert("Adresse Email non-valide.")
    return false
  }

  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
    alert("Adresse Email non-valide.")
    return false
  }

  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
    alert("Adresse Email non-valide.")
    return false
  }

  if (str.indexOf(at,(lat+1))!=-1){
    alert("Adresse Email non-valide.")
    return false
  }

  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
    alert("Adresse Email non-valide.")
    return false
  }

  if (str.indexOf(dot,(lat+2))==-1){
    alert("Adresse Email non-valide.")
    return false
  }

  if (str.indexOf(" ")!=-1){
    alert("Adresse Email non-valide.")
    return false
  }

  return true
}


function dialog(url,message) {
  var button;
  button=confirm(message);
  if (button==true) {
    window.location.href=url;
  }
}

function Login_Form_Validator(theForm) {

  if (theForm.uid.value == "") {
    alert("Veuillez saisir votre nom d'utilisateur.");
    theForm.uid.focus();
    return (false);
  }

  if (theForm.pw.value == "") {
    alert("Veuillez saisir votre mot de passe.");
    theForm.pw.focus();
    return (false);
  }
  return (true);
}

function MailingList_Form_Validator(theForm) {

  if (theForm.email_addr.value == "") {
    alert("Veuillez saisir votre adresse email.");
    theForm.email_addr.focus();
    return (false);
  }  
  return (true);
}

function Search_Form_Validator(theForm) {

  if (theForm.searchWord.value == "") {
    alert("Veuillez indiquer un mot clé.");
    theForm.searchWord.focus();
    return (false);
  }  
  return (true);
}

function seasonRedirect(address) {
  i = document.seasonSelector.selectedSeason.selectedIndex;
  url = address+document.seasonSelector.selectedSeason.options[i].value;
  parent.location.href = url;
}

function categoryRedirect(address) {
  i = document.categorySelector.selectedCategory.selectedIndex;
  url = address+document.categorySelector.selectedCategory.options[i].value;
  parent.location.href = url;
}

function albumRedirect(address) {
  i = document.albumSelector.selectedAlbum.selectedIndex;
  url = address+document.albumSelector.selectedAlbum.options[i].value;
  parent.location.href = url;
}
-->