<!--
function xLayerInfo(id, iScelta) {
  var ele = xGetElementById(id);
  if (!ele) return false;
  if (iScelta == 1) {
    //
  } else {
    if (ele.style && _def(ele.style.visibility)) return ele.style.visibility;
    else if (document.layers) return document.layers[id].visibility;
  }
}
function xShow(id) {
  var ele = xGetElementById(id);
  if (!ele) return;
  if (ele.style && _def(ele.style.visibility)) ele.style.visibility = 'inherit';
  else if (document.layers) document.layers[id].visibility = 'show';
}

function xHide(id) {
  var ele = xGetElementById(id);
  if (!ele) return;
  if (ele.style && _def(ele.style.visibility)) ele.style.visibility = 'hidden';
  else if (document.layers) document.layers[id].visibility = 'hide';
}

function xBackground(sId, sBgColor, sBgImage) {
  var bg = "", ele = xGetElementById(sId);
  if (!ele) return;
  if (ele.style) {
    if (arguments.length > 1)
      ele.style.backgroundColor = sBgColor;
    if (arguments.length == 3)
      ele.style.backgroundImage = "url(" + sBgImage + ")";
    bg = ele.style.backgroundColor;
  }
  else if (document.layers) {
    if (arguments.length > 1) ele.bgColor = sBgColor;
    if (arguments.length == 3) ele.background.src = sBgImage;
    bg = ele.bgColor;
  }
  return bg;
}

function xMoveTo(id, iX, iY) {
  xLeft(id, iX);
  xTop(id, iY);
}

function xMoveBy(id, iDx, iDy) {
  xLeft(id, iDx + xLeft(id));
  xTop(id, iDy + xTop(id));
}

function xLeft(id, iX) {
  var ele = xGetElementById(id);
  if (!ele) return;
  var css=_def(ele.style);
  if (css && _def(ele.style.left) && typeof(ele.style.left)=="string") {
    if (arguments.length > 1) ele.style.left = iX + "px";
    else { iX = parseInt(ele.style.left); if (isNaN(iX)) iX = 0; }
  }
  else if (css && _def(ele.style.pixelLeft)) {
    if (arguments.length > 1) ele.style.pixelLeft = iX;
    else iX = ele.style.pixelLeft;
  }
  else if (_def(ele.left)) {
    if (arguments.length > 1) ele.left = iX;
    else iX = ele.left;
  }
  return iX;
}

function xTop(id, iY) {
  var ele = xGetElementById(id);
  if (!ele) return;
  var css = _def(ele.style);
  if (css && _def(ele.style.top) && typeof(ele.style.top)=="string") {
    if (arguments.length > 1) ele.style.top = iY + "px";
    else { iY = parseInt(ele.style.top); if (isNaN(iY)) iY = 0; }
  }
  else if (css && _def(ele.style.pixelTop)) {
    if (arguments.length > 1) ele.style.pixelTop = iY;
    else iY = ele.style.pixelTop;
  }
  else if (_def(ele.top)) {
    if (arguments.length > 1) ele.top = iY;
    else iY = ele.top;
  }
  return iY;
}

function xResizeTo(id, uW, uH) {
  xClip(id, 0, xWidth(id, uW), xHeight(id, uH), 0);
}

function xResizeBy(id, iDw, iDh) {
  xClip(id, 0, xWidth(id, iDw + xWidth(id)), xHeight(id, iDh + xHeight(id)), 0);
}

function xClip(id, iTop, iRight, iBottom, iLeft) {
  var ele = xGetElementById(id);
  if(!ele) return;
  if (ele.style && _def(ele.style.clip)) ele.style.clip = "rect(" + iTop + "px " + iRight + "px " + iBottom + "px " + iLeft + "px" + ")";
  else if (document.layers) {
    ele.clip.top = iTop;
    ele.clip.right = iRight;
    ele.clip.bottom = iBottom;
    ele.clip.left = iLeft;
  }
}

function xWidth(id, uW) {
  var ele = xGetElementById(id);
  if (!ele) return Null;
  var css = _def(ele.style);
  if (css && _def(ele.style.width, ele.offsetWidth) && typeof(ele.style.width)=="string") {
    if (arguments.length > 1) {
      uW = Math.round(uW);
      _domSetWidth(ele, uW);
    }
    uW = ele.offsetWidth;
  }
  else if (css && _def(ele.style.pixelWidth)) {
    if (arguments.length > 1) {
      uW = Math.round(uW);
      ele.style.pixelWidth = uW;
    }
    uW = ele.style.pixelWidth;
  }
  else if (_def(ele.clip) && _def(ele.clip.right)) {
    if (arguments.length > 1) {
      uW = Math.round(uW);
      ele.clip.right = uW;
    }
    uW = ele.clip.right;
  }
  return uW;
}
  
function xHeight(id, uH) {
  var ele = xGetElementById(id);
  if (!ele) return Null;
  var css = _def(ele.style);
  if (css && _def(ele.style.height, ele.offsetHeight) && typeof(ele.style.height)=="string") {
    if (arguments.length > 1) {
      uH = Math.round(uH);
      _domSetHeight(ele, uH);
    }
    uH = ele.offsetHeight;
  }
  else if (css && _def(ele.style.pixelHeight)) {
    if (arguments.length > 1) {
      uH = Math.round(uH);
      ele.style.pixelHeight = uH;
    }
    uH = ele.style.pixelHeight;
  }
  else if (_def(ele.clip) && _def(ele.clip.bottom)) {
    if (arguments.length > 1) {
      uH = Math.round(uH);
      ele.clip.bottom = uH;
    }
    uH = ele.clip.bottom;
  }
  return uH;
}

function xScrollLeft() {
  var offset=0;
  if (_def(window.pageXOffset)) offset=window.pageXOffset; // gecko, nn4, opera
  else if (document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft; // ie6 compat mode
  else if (document.body && _def(document.body.scrollLeft)) offset=document.body.scrollLeft; // ie4up
  return offset;
}

function xScrollTop() {
  var offset=0;
  if (_def(window.pageYOffset)) offset=window.pageYOffset;
  else if (document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
  else if (document.body && _def(document.body.scrollTop)) offset=document.body.scrollTop;
  return offset;
}

var is_ie = navigator.userAgent.toLowerCase().indexOf('msie') != -1;

function xClientWidth() {
  var w=0;
  if (window.opera){w=window.innerWidth;}
  else if (is_ie && document.documentElement && document.documentElement.clientWidth) w=document.documentElement.clientWidth; // ie6 compat mode
  else if (document.body && document.body.clientWidth) w=document.body.clientWidth; // ie4up and gecko
  else if (_def(window.innerWidth,window.innerHeight,document.height)){// nn4
    w=window.innerWidth;
    if (document.height > window.innerHeight) w -=16;
 }
  return w;
}

function xClientHeight() {
  var h=0;
  if (window.opera){h=window.innerHeight;}
  else if (is_ie && document.documentElement && document.documentElement.clientHeight) h=document.documentElement.clientHeight;
  else if (document.body && document.body.clientHeight) h=document.body.clientHeight;
  else if (_def(window.innerWidth,window.innerHeight,document.width)){
    h=window.innerHeight;
    if (document.width > window.innerWidth) h -=16;
 }
  return h;
}
//-->