﻿function fillDropDown() 
{
  var forms = document.getElementsByTagName("form");
  try{
    for(i = 0; i < forms.length; i++){
      if(forms[i].name=="sexform")
        fillform(forms[i]);
    }
  }catch(e){ }
}

function fillform(form){
  if(form)
  for(i = 0; i < 82; i++) 
  {
    var theOption = new Option();
    theOption.text = i+18;
    theOption.value = i+18;
    form.lvan.options[i] = theOption;

    theOption = new Option();
    theOption.text = i+18;
    theOption.value = i+18;
    if(i==12)
      theOption.selected = true;
    form.ltot.options[i] = theOption;
  }
}

function validate_sexdate(form){
  if(!form)
    return false;
  else{
    if(form.lvan.options[form.lvan.selectedIndex].value>form.ltot.options[form.ltot.selectedIndex].value){
      var van = form.lvan.selectedIndex;
      var tot = form.ltot.selectedIndex;
      
      form.lvan.selectedIndex = tot;
      form.ltot.selectedIndex = van;
    }
  }
  return true;
}