Mon3 = ["Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "October", "November", "December"];

function LengthOfMonth(Y, M) { // M=1..12 // OK in NS4? Mac?
  with (new Date(Y,M,1,12)) { setDate(0) ; return getDate() } }

var D_Opt = new Array() // 29..31

function MonLen(Yr, Mo, Dy) { var Dol, K, DiM, NsI
  DiM = LengthOfMonth(+Yr.options[Yr.selectedIndex].text,
    Mo.selectedIndex+1)
  Dol = Dy.options.length
  if ( (NsI = Dy.selectedIndex) >= DiM ) NsI = DiM-1
  for (K=Dol   ; K >DiM ; K--)
    { D_Opt[K] = Dy.options[K-1] ; Dy.options[K-1] = null }
  for (K=Dol+1 ; K<=DiM ; K++)   Dy.options[K-1] = D_Opt[K]
  Dy.selectedIndex = NsI }

function InitYMDselector(Yr, Mo, Dy) { var J
  Base = new Date().getFullYear()
  SetObj = new Date()
  for (J=0; J<3; J++) Yr.options[J] = new Option(Base+J)
  for (J=0;  J<12 ; J++) Mo.options[J] = new Option(Mon3[J])
  for (J=0;  J<31 ; J++) Dy.options[J] = new Option(J+1)
  if (SetObj) with (SetObj) {
    Yr.selectedIndex = getFullYear()-Base
    Mo.selectedIndex = getMonth()
    Dy.selectedIndex = getDate()-1 }
  else Yr.selectedIndex = Mo.selectedIndex = Dy.selectedIndex = 0
  MonLen(Yr, Mo, Dy) }
