// Details (IE5+) (S:04)

/* RESERVED WORDS: details */

details = new Object();
details.aObj = new Array();
details.timerID = null;
details.refreshRate = 100; // [Hz]

document.write("<style type=\"text\/css\">.s04_01 {position:absolute; left:-2px; top:-2px; width:2px; height:2px; overflow:hidden; visibility:hidden} .s04_02{position:absolute; overflow:hidden}<\/style>");
window.attachEvent("onresize", f04_10);

function f04_01(dNum) {

  var dData_ = detailsData[dNum];

  document.write("<div id=\"o04_" + dNum + "\" class=\"s04_01\"><div id=\"o04_" + dNum + "d\" class=\"s04_02\"><iframe name=\"o04_" + dNum + "f\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\"></iframe></div></div>");

  dData_._parent = new Object();
  dData_._parent.obj = document.all["o04_" + dNum];
  dData_._parent.dObj = document.all["o04_" + dNum + "d"];
  dData_._parent.dObj.onmouseover = f04_04;
  dData_._parent.dObj.onmouseout = f04_05;
  with (document.frames["o04_" + dNum + "f"]) {
    document.open("text/html");
    document.write(dData_[4]);
    document.close();
    dData_._parent.fObj = document.body
  }

  with (jps) {
    regXMethod(dData_._parent, getAnchRef(dData_[3]));
    regYMethod(dData_._parent, getAnchRef(dData_[0]));
    regWMethod(dData_._parent, getAnchRef(dData_[3]), getAnchRef(dData_[1]));
    regHMethod(dData_._parent, getAnchRef(dData_[0]), getAnchRef(dData_[2]))
  }

  dData_._fInitLeft;
  dData_._fInitTop;
  dData_._fCurrLeft;
  dData_._fCurrTop;
  dData_._fGoalLeft;
  dData_._fGoalTop;
  dData_._fLeftInc;
  dData_._fTopInc;

  dData_._state = 1; //States: 1-hidden; 2-shown; 3-disappearing
  dData_._timerID = null

}
details.init = f04_01;

function f04_02(dNum) {

  var dData = detailsData[dNum], dDataPar = detailsData[dNum]._parent; dDefaults = detailsData.defaults;
  var _left, _top, _fLeft, _fTop, _width, _height, _temp;

  if (dData._state && dData._state == 1) {
    _left = dDataPar._x() + (typeof dData.hOffset == "undefined" ? dDefaults.hOffset : dData.hOffset);
    _top = dDataPar._y() + (typeof dData.vOffset == "undefined" ? dDefaults.vOffset : dData.vOffset);

    _width = (typeof dData.width == "undefined" ? dDefaults.width : dData.width).split("auto");
    if (_width.length == 2) {
      _temp = dDataPar.fObj.scrollWidth;
      _width[1] = isNaN(_width[1]) ? Number.NEGATIVE_INFINITY : _width[1];
      _width = _temp > _width[1] ? _temp : parseInt(_width[1])
    }
    else
      _width = _width == "syncro" ? dDataPar._width() : parseInt(_width);

    _height = (typeof dData.height == "undefined" ? dDefaults.height : dData.height).split("auto");
    if (_height.length == 2) {
      _temp = dDataPar.fObj.scrollHeight;
      _height[1] = isNaN(_height[1]) ? Number.NEGATIVE_INFINITY : _height[1];
      _height = _temp > _height[1] ? _temp : parseInt(_height[1])
    }
    else
      _height = _height == "syncro" ? dDataPar._height() : parseInt(_height);

    switch (typeof dData.hAlign == "undefined" ? dDefaults.hAlign : dData.hAlign) {
      case "oleft":
        _left -= _width;
        break;
      case "center":
        _left += Math.round((dDataPar._width() - _width)/2);
        break;
      case "right":
        _left += dDataPar._width() - _width;
        break;
      case "oright":
        _left += dDataPar._width()
    }

    switch (typeof dData.vAlign == "undefined" ? dDefaults.vAlign : dData.vAlign) {
      case "otop":
        _top -= _height;
        break;
      case "middle":
        _top += Math.round((dDataPar._height() - _height)/2);
        break;
      case "bottom":
        _top += dDataPar._height() - _height;
        break;
      case "obottom":
        _top += dDataPar._height()
    }

    _temp = typeof dData.hSpeed == "undefined" ? dDefaults.hSpeed : dData.hSpeed;
    if (_temp == "static")
      _fLeft = dData._fCurrLeft = dData._fLeftInc = 0
    else {
      dData._fLeftInc = _temp/details.refreshRate;
      _fLeft = dData._fCurrLeft = dData._fLeftInc + (_temp > 0 ? -_width : _width)
    }

    _temp = typeof dData.vSpeed == "undefined" ? dDefaults.vSpeed : dData.vSpeed;
    if (_temp == "static")
      _fTop = dData._fCurrTop = dData._fTopInc = 0
    else {
      dData._fTopInc = _temp/details.refreshRate;
      _fTop = dData._fCurrTop = dData._fTopInc + (_temp > 0 ? -_height : _height)
    }

    dDataPar.dObj._onMouseOver = (typeof dData.onMouseOver == "undefined") ? null : dData.onMouseOver;
    dDataPar.dObj._onMouseOut = (typeof dData.onMouseOut == "undefined") ? null : dData.onMouseOut;


    dData._fInitLeft = _fLeft - dData._fLeftInc;
    dData._fInitTop = _fTop - dData._fTopInc;
    dData._fGoalLeft = 0;
    dData._fGoalTop = 0;

    with (dDataPar.dObj.style) {
      left = _fLeft + "px";
      top = _fTop + "px";
      width = _width + "px";
      height = _height + "px"
    }

    with (dDataPar.obj.style) {
      width = _width + "px";
      height = _height + "px";
      left = _left + "px";
      top = _top + "px";
      visibility = "visible"
    }

    dData._state = 2;

    if (_fLeft !=0 || _fTop != 0)
      details.aObj[details.aObj.length] = dData;

    if (details.timerID == null)
      details.timerID = setInterval("f04_03()", Math.round(1000/details.refreshRate));

    if (typeof dData.onAppear != "undefined")
      eval(dData.onAppear)
  }

}
details.show = f04_02

function f04_03() {
  var static_, activeCounter_ = 0;
  for (var i=0; i<details.aObj.length; ++i) {
    if (details.aObj[i]) {
      ++activeCounter_;
      static_ = true;
      with (details.aObj[i]) {
        if (_fCurrLeft != _fGoalLeft) {
          _fCurrLeft += _fLeftInc;
          if (((_fCurrLeft > _fGoalLeft) && (_fLeftInc > 0)) || ((_fCurrLeft < _fGoalLeft) && (_fLeftInc < 0)))
            _fCurrLeft = _fGoalLeft
          else
            static_ = false;
          _parent.dObj.style.left = _fCurrLeft + "px"
        }

        if (_fCurrTop != _fGoalTop) {
          _fCurrTop += _fTopInc;
          if (((_fCurrTop > _fGoalTop) && (_fTopInc > 0)) || ((_fCurrTop < _fGoalTop) && (_fTopInc < 0)))
            _fCurrTop = _fGoalTop
          else
            static_ = false;
          _parent.dObj.style.top = _fCurrTop + "px"
        }
        if (static_) {
          details.aObj[i] = false;
          if ((_fGoalTop != 0) || (_fGoalLeft != 0)) {
            with (_parent.obj.style) {
              visibility = "hidden";
              width = "2px";
              height = "2px";
              left = "-2px";
              top = "-2px"
            }
            _state = 1;
            if (typeof onHide != "undefined")
              eval(onHide)
          }
          else
          if (typeof onShow != "undefined")
            eval(onShow)
        }
      }
    }
  }
  if (activeCounter_ == 0) {
    clearInterval(details.timerID);
    details.timerID = null;
    details.aObj.length = 0
  }
}

function f04_04() { // onMouseOver handler
  eval(this._onMouseOver);
  window.event.cancelBubble = true
}

function f04_05() { // onMouseOut handler
  eval(this._onMouseOut);
  window.event.cancelBubble = true
}

function f04_06(dNum) {
  var dData = detailsData[dNum], dDataPar = detailsData[dNum]._parent;
  if (dData._state != 1) {
    var i = 0;
    while (i < details.aObj.length && details.aObj[i] != dData)
      ++i;

    if (details.aObj[i] == dData)
      details.aObj[i] = false;

    with (dDataPar.obj.style) {
      visibility = "hidden";
      width = "2px";
      height = "2px";
      left = "-2px";
      top = "-2px"
    }

    clearTimeout(dData._timerID);
    dData._state = 1;

    if (typeof dData.onHide != "undefined")
      eval(dData.onHide)
  }
}
details.fastHide = f04_06;

function f04_07(dNum) {
  var dData = detailsData[dNum], dDataPar = detailsData[dNum]._parent;
  if (dData._state == 2) {

    clearTimeout(dData._timerID);

    dData._fGoalLeft = dData._fInitLeft;
    dData._fGoalTop = dData._fInitTop;
    dData._fLeftInc = -dData._fLeftInc;
    dData._fTopInc = -dData._fTopInc;

    var i = 0;
    while (i < details.aObj.length && details.aObj[i] != dData)
      ++i;

    if (details.aObj[i] != dData)
      details.aObj[details.aObj.length] = dData

    dData._state = 3;

    if (details.timerID == null)
      details.timerID = setInterval("f04_03()", Math.round(1000/details.refreshRate))
  }
}

function f04_08(dNum) {
  with (detailsData[dNum])
    if (_state == 2) {
      clearTimeout(_timerID);
      _timerID = setTimeout("f04_07(" + dNum + ")", typeof hideDelay == "undefined" ? detailsData.defaults.hideDelay : hideDelay)
    }
}
details.hide = f04_08

function f04_09(dNum) {
  with (detailsData[dNum])
    if (_state == 2)
      clearTimeout(_timerID)
}

function f04_10() {
  for (var i=0; i<detailsData.length; ++i )
    if (detailsData[i]._state > 1)
      f04_06(i)
}
