/*
$ /js/dd.js | 2007/12/07 13:10 | 2008/01/03 10:08 $
*/

function dd(id) {
  oi = 'wtBodyIntro'+id;
  of = 'wtBodyFull'+id;

  dds = document.getElementById("wtBody").getElementsByTagName("div");

  for (var d = 0; d < dds.length; d++) {
    if (dds[d].className == 'wtBodyIntroA') {
      ci = dds[d].id;
      cf = ci.replace(/Intro/gi, "Full");
      d = dds.length;
    }
  }

  if (oi == ci) { return; }

  // open this
  oie = document.getElementById(oi);
  ofe = document.getElementById(of);
  ofe_oh = ofe.offsetHeight;

  // close this
  cie = document.getElementById(ci);
  cfe = document.getElementById(cf);
  cfe_oh = cfe.offsetHeight;
  //cfe.style.height = cfe_oh + 'px';

  cie.className = 'wtBodyIntro';
  oie.className = 'wtBodyIntroA';
  ofe.style.height = '0px';
  ofe.style.display = 'block';

  setTimeout(slide, 1);
}


function rbDD(id) {
  oi = 'rbDDBodyIntro'+id;
  of = 'rbDDBodyFull'+id;

  dds = document.getElementById("rbDDBody").getElementsByTagName("div");

  for (var d = 0; d < dds.length; d++) {
    if (dds[d].className == 'rbDDBodyIntroA') {
      ci = dds[d].id;
      cf = ci.replace(/Intro/gi, "Full");
      d = dds.length;
    }
  }

  if (oi == ci) { return; }

  // open this
  oie = document.getElementById(oi);
  ofe = document.getElementById(of);
  ofe_oh = ofe.offsetHeight;

  // close this
  cie = document.getElementById(ci);
  cfe = document.getElementById(cf);
  cfe_oh = cfe.offsetHeight;
  //cfe.style.height = cfe_oh + 'px';

  cie.className = 'rbDDBodyIntro';
  oie.className = 'rbDDBodyIntroA';
  ofe.style.height = '0px';
  ofe.style.display = 'block';

  setTimeout(slide, 1);
}


function slide() {
  uh = cfe.offsetHeight;
  uh = parseInt(uh - 10);

  dh = ofe.offsetHeight;
  dh = parseInt(dh + 10);

  if (dh <= cfe_oh) {
    ofe.style.height = dh + 'px';
  }

  if (uh <= 0) {
    cfe.style.display = 'none';
    cfe.style.height = cfe_oh + 'px';
  }
  else {
    cfe.style.height = uh + 'px';
  }

  if (dh <= cfe_oh | uh > 0) {
    setTimeout(slide, 1);
  }
}
