/*
  DByte64
  Version: 2.0.
  Writted by : Pou Le Serg (DByte64)
  http://pouleserg.com/
  http://clubin.org.ua/
  http://posejdonet.org.ua/
*/

var iID2, objD2, IncrementToOpacity2, i2, CurOp2, CurX2, CurY2, FarY2;
var StepRoll2 = 1;                   // increment
var SpaceBetweenBlocks2 = 25;
var FloatBlockName = 'altTitlefloatBlock';

function GetXY(elem01) {
  var coffx = 0, coffy = 0;
  do {
    coffx += elem01.offsetLeft;
    coffy += elem01.offsetTop;
  } while (elem01 = elem01.offsetParent);
  return [coffx, coffy];
}

function MoveAndTransparent2(NewY, NewTransparent) {
  objD2.style.top = NewY + 'px';
  objD2.style.opacity = NewTransparent;
}

function ProcessChange2(typeOfAction) {
  if (typeOfAction == "Show2") {
    if (i2 > CurY2) {
      i2 -= StepRoll2;
      CurOp2 += IncrementToOpacity2;
      MoveAndTransparent2(i2,CurOp2);
    } else {
      clearInterval(iID2);
      MoveAndTransparent2(CurY2,1);
    }
  } else if (typeOfAction == "Hide2") {
    if (i2 < FarY2) {
      i2 += StepRoll2;
      CurOp2 -= IncrementToOpacity2;
      MoveAndTransparent2(i2,CurOp2);
    } else {
      clearInterval(iID2);
      MoveAndTransparent2(FarY2,0);
    }
  }
}

function Show2(tText,thisBlock) {
  clearInterval(iID2);
  objD2 = document.getElementById(FloatBlockName);
  objD2.innerHTML = tText;
  RealH2 = objD2.clientHeight;
  PartToScroll2 = RealH2 * 0.75;        // 75 %
  IncrementToOpacity2 = StepRoll2 / PartToScroll2;
  var newposxy = GetXY(thisBlock);
  CurX2 = (thisBlock.clientWidth / 2) - (objD2.clientWidth / 2) + newposxy[0];
  CurY2 = thisBlock.clientHeight + SpaceBetweenBlocks2 + newposxy[1];
  FarY2 = CurY2 + PartToScroll2;
  objD2.style.left = CurX2 + 'px';
  i2 = FarY2;
  CurOp2 = 0;
  iID2 = setInterval("ProcessChange2('Show2')",20);
}

function Hide2() {
  clearInterval(iID2);
  iID2 = setInterval("ProcessChange2('Hide2')",20);
}

function AddFloatBlockToDoc() {
  document.write('<div id="' + FloatBlockName + '" style="position: absolute; top: 0; left: 0; opacity: 0; filter: alpha(opacity = 0); text-align: center; border: 1px solid #333; background-color: #555; color: #EFF; padding: 0 2px; font-size: 14px;">Офіційна сторінка Pou Le Serg</div>');
}

//
//  DByte64, 2009 - 2010
//