/*
  DByte64 inc.
Writted by Pou Le Serg (DByte64 inc.)
http://pouleserg.org.ua/
http://clubin.org.ua/
*/

var curID, objtoWork, startLen, endLen, i, tpadding;
var ScrollStep = 4;     // increment

function ProcessChange(typeofScrollAction) {
  if (typeofScrollAction == 'wide') {
    if (objtoWork.clientHeight < endLen) {
      i+=ScrollStep;
      objtoWork.style.height = startLen + i + 'px';
    } else {
      clearInterval(curID);
    }
  } else if (typeofScrollAction == 'small') {
    if (objtoWork.clientHeight - tpadding > startLen) {
      i-=ScrollStep;
      objtoWork.style.height = startLen + i + 'px';
    } else {
      clearInterval(curID);
    } 
  }
}

function DoWide(tcObj,beginLen,endlenght,thispadding) {
  clearInterval(curID);
  objtoWork = document.getElementById(tcObj);
  startLen = beginLen;
  endLen = endlenght;
  tpadding = 2 * thispadding;
  i = 0;
  curID = setInterval("ProcessChange('wide')",2);
}

function DoSmall() {
  clearInterval(curID);
  curID = setInterval("ProcessChange('small')",1);
}

//
// DByte64 inc.
//