var TO = 2400;

function winOnLoad(timeout_)
{
  if (timeout_) {
  	TO = timeout_;
  }
  var lc = xGetElementById('maintext');
  if (lc && xDef(lc.style, lc.offsetLeft, lc.offsetTop)) { // downgrade check
	//lc.slideLinear = true; // this feature will be supported in X v3.15.3
	xMoveTo(lc, lc.offsetLeft, lc.offsetTop); // prime the element's inline style properties
//	console.log(lc.offsetTop.toString());
	lc.slideTop = lc.offsetTop;
	lc.slideLeft = lc.offsetLeft;

	var e = xGetElementById('nyilfel');
	e.scrlUp = true;
	e.scrlEle = lc;
	e.onmouseover = scrlOnMouseover;
	e.onmouseout = scrlOnMouseout;

	e = xGetElementById('nyille');
	e.scrlEle = lc;
	e.onmouseover = scrlOnMouseover;
	e.onmouseout = scrlOnMouseout;
  }
  /*xClip(lc, 0, 200, 200, 0);*/
}
function scrlOnMouseover()
{
  var st, y, minST, maxST;
  if (this.scrlUp) {
	minST = 400;
	maxST = TO;
	y = this.scrlEle.slideTop;
  }
  else {
	minST = TO;
	maxST = 400;
	y = -xHeight(this.scrlEle) + 300;
//	console.log(-xHeight(this.scrlEle));
  }
  
  st = parseInt(xLinearScale(-xTop(this.scrlEle), this.scrlEle.slideTop, xHeight(this.scrlEle), minST, maxST));
 // console.log(y + ' : ' + st + ';');
  xSlideTo(this.scrlEle, this.scrlEle.slideLeft, y, st);
}
function scrlOnMouseout()
{
  this.scrlEle.stop = true;
}

