// cbe_core.js
// CBE v5.0 beta, Cross-Browser DHTML API from Cross-Browser.com
// Copyright (c) 2002,2003 Michael Foster (mike@cross-browser.com)
// This library is distributed under the terms of the LGPL (gnu.org)
var cbeVersion="5.0b", cbeDocumentId='idDocument', cbeWindowId='idWindow', cbeAll=new Array();
window.onload=function() {
  cbeInitialize("DIV", "SPAN");
  if(window.windowOnload) window.windowOnload();
}
if(!window.opera) {
  window.onunload=function() {
    if(window.windowOnunload) { window.windowOnunload(); }
    if(window.cbeDebugObj) { window.cbeDebugObj=null; }
    for(var i=0; i<cbeAll.length; i++) {
      if(cbeAll[i] && cbeAll[i].ele && cbeAll[i].ele.cbe) {
        cbeAll[i].ele.cbe=null;
        cbeAll[i]=null;
      }
    }
  }
}
function CrossBrowserNode() {
  this.parentNode=null;
  this.childNodes=0;
  this.firstChild=null;
  this.lastChild=null;
  this.previousSibling=null;
  this.nextSibling=null;
  this.appendNode=function(cbeChild) {
    if (cbeChild) {
      if (!this.firstChild) { this.firstChild=cbeChild; }
      else {
        cbeChild.previousSibling=this.lastChild;
        this.lastChild.nextSibling=cbeChild;
      }
      cbeChild.parentNode=this;
      this.lastChild=cbeChild;
      ++this.childNodes;
    }
    return cbeChild;
  }
} // end CrossBrowserNode
CrossBrowserElement.prototype=new CrossBrowserNode;
function CrossBrowserElement(){
  // begin v5.0
  this.contains=function(iLeft, iTop, iClipTop, iClipRight, iClipBottom, iClipLeft){if (arguments.length==2){iClipTop=iClipRight=iClipBottom=iClipLeft=0;} else if (arguments.length==3){iClipRight=iClipBottom=iClipLeft=iClipTop;} else if (arguments.length==4){iClipLeft=iClipRight; iClipBottom=iClipTop;} var thisX=this.pageX(), thisY=this.pageY(); return ( iLeft >=thisX + iClipLeft && iLeft <=thisX + this.width() - iClipRight && iTop >=thisY + iClipTop && iTop <=thisY + this.height() - iClipBottom );}

  this.left=function(iX) {return xLeft(this.ele, iX);}
  this.top=function(iY) {return xTop(this.ele, iY);}
  this.offsetLeft=function(){return xOffsetLeft(this.ele);}
  this.offsetTop=function(){return xOffsetTop(this.ele);}
  this.pageX=function(){return xPageX(this.ele);}
  this.pageY=function(){return xPageY(this.ele);}
  this.zIndex=function(uZ){return xZIndex(this.ele, uZ);}

  if (cbeAll.length < 2){
    this.width=xClientWidth;
    this.height=xClientHeight;
    this.scrollLeft=xScrollLeft;
    this.scrollTop=xScrollTop;}
  else{
    this.width=function(uW){return xWidth(this.ele, uW);}
    this.height=function(uH){return xHeight(this.ele, uH);}
    this.scrollLeft=function(){return this.ele.scrollLeft;}
    this.scrollTop=function(){return this.ele.scrollTop;}
  }
  
  this.show=function(){xShow(this.ele);}
  this.hide=function(){xHide(this.ele);}
  this.color=function(sColor){return xColor(this.ele, sColor);}
  this.background=function(sColor, sImage){return xBackground(this.ele, sColor, sImage);}
  this.clip=function(iTop,iRight,iBottom,iLeft){xClip(this.ele,iTop,iRight,iBottom,iLeft);}
  this.moveTo=function(x_cr, y_mar, outside, xEndL){if (isFinite(x_cr)){this.left(x_cr); this.top(y_mar);}else{this.cardinalPosition(x_cr, y_mar, outside); this.left(this.x); this.top(this.y);}if (xEndL) cbeEval(xEndL, this);}
  this.moveBy=function(uDX, uDY, xEndL){if (uDX){this.left(this.left() + uDX);}  if (uDY){this.top(this.top() + uDY);} if (xEndL){cbeEval(xEndL, this);}}
  this.sizeTo=function(uW, uH) { this.width(uW); this.height(uH); }
  this.sizeBy=function(iDW, iDH) { this.width(this.width() + iDW); this.height(this.height() + iDH); }
  this.resizeTo=function(uW, uH, xEndListener){ this.sizeTo(uW, uH); /* this.clip(); */ cbeEval(xEndListener, this); }
  this.resizeBy=function(iDW, iDH, xEndListener){this.sizeBy(iDW, iDH); /* this.clip(); */ cbeEval(xEndListener, this);}
  
  // end v5.0
  this.visibility=_retVoid;
  this.innerHtml=_retEStr;
  this.id=""; this.index=cbeAll.length; cbeAll[this.index]=this; this.w=this.h=0; this.x=this.y=0;
  if (window.cbeEventJsLoaded) this.listeners=new Array();
}
function cbeBindElement(cbe, ele){
  if (!cbe || !ele) return;
  cbe.ele=ele; cbe.ele.cbe=cbe; cbe.parentElement=cbeGetParentElement(ele);
  if (ele==window){cbe.id=ele.id=cbeWindowId; return;} else if (ele==document){cbe.id=ele.id=cbeDocumentId; return;} else{cbe.id=ele.id;}
  if (xDef(ele.clip)){cbe.w=ele.clip.width; cbe.h=ele.clip.height;}
  //v5
}
function cbeInitialize(sTagNames){
  var t,i,ele,eleList,cbe;
  cbe=new CrossBrowserElement(window);
  cbeBindElement(cbe, window);
  cbe=new CrossBrowserElement(document);
  cbeBindElement(cbe, document);
  if (!document.getElementById) document.getElementById=xGetElementById;
  if (document.createElement || document.layers) document.cbe.createElement=_cbeCreateElement;
  document.cbe.isSupported=_cbeIsSupported;
  document.cbe.supported=new Array();
  _sup(true,"left","top","width","height","zIndex","show","hide","visibility","background","color","clip","offsetLeft","offsetTop","pageX","pageY","innerHtml","scrollLeft","scrollTop","createElement","appendChild","removeChild","moveTo","moveBy","sizeTo","sizeBy","resizeTo","resizeBy","contains");
  for (t=0; t < arguments.length; ++t){
    eleList=cbeGetElementsByTagName(arguments[t]);
    for (i=0; i < eleList.length; ++i){
      ele=eleList[i];
      if ( ele.id && ele.id !=""){
        cbe=new CrossBrowserElement();
        cbeBindElement(cbe, ele);
     }
   }
    if (document.layers) break;
 }
  _cbeCreateTree();
  if (window.cbeEventJsLoaded && (document.layers || is.opera5or6)){window.cbe.addEventListener("resize", cbeDefaultResizeListener);}
}
function _cbeIsSupported(sMethods){var i; for (i=0; i<arguments.length; ++i){if (!document.cbe.supported[arguments[i]]) return false;}return true;}
function _sup(bValue, sMethods){var i; for (i=1; i<arguments.length; ++i) document.cbe.supported[arguments[i]]=bValue;}
function _cbeCreateTree(){var parent; for (var i=1; i < cbeAll.length; ++i){parent=cbeAll[i].parentElement; if (!parent.cbe){while (parent && !parent.cbe){parent=cbeGetParentElement(parent);}if (!parent) parent=document;}parent.cbe.appendNode(cbeAll[i]);}}
function cbeGetElementsByTagName(sTagName){
  var eleList;
  if (document.getElementsByTagName) eleList=document.getElementsByTagName(sTagName); // standard
  else if (document.body && document.body.getElementsByTagName) eleList=document.body.getElementsByTagName(sTagName); // opera5or6
  else if (document.all && document.all.tags) eleList=document.all.tags(sTagName); // ie4
  else if (document.layers){eleList=new Array(); nnGetAllLayers(window, eleList, 0);}// nn4
  return eleList;
}
function nnGetAllLayers(parent, layerArray, nextIndex){
  var i, layer;
  for (i=0; i < parent.document.layers.length; i++){
    layer=parent.document.layers[i]; layerArray[nextIndex++]=layer;
    if (layer.document.layers.length) nextIndex=nnGetAllLayers(layer, layerArray, nextIndex);
 }
  return nextIndex;
}
// begin v5.0
function cbeGetParentElement(e) {
  var p;
  if (e==window) p=null;
  else if (e==document) p=window;
  else p = xParent(e);
  return p || document;
}
function cbeGetElementById(sId){return xGetElementById(sId);}
function nnGetElementById(sId){return xLayer(sId);}
// end v5.0
function _retZero(){return 0;}
function _retNull(){return null;}
function _retEStr(){return "";}
function _retVoid(){}
function _def(){var i; for (i=0; i<arguments.length; ++i){if(typeof(arguments[i])=="undefined") return false;}return true;}

////// when optimizing, don't remove anything above this comment //////

function _cbeCreateElement(sEleType){// returns an Element object
  var ele=null;
  if (document.createElement && sEleType.length){
    ele=document.createElement(sEleType);
    if (ele && ele.style){ele.style.position="absolute";}
 }
  else if (document.layers){
    ele=new Object();
 }
  return ele;
}
CrossBrowserNode.prototype.appendChild=function(eleChild){// returns the appended Element object on success
  var cbe, ele, rv=null;
  if (document.layers){
    var thisEle;
    if (this.index < 2) thisEle=window;
    else thisEle=this.ele;
    ele=new Layer(this.width(), thisEle);
    if (ele){
      if (eleChild.id) ele.id=ele.name=eleChild.id;
      cbe=new CrossBrowserElement();
      cbeBindElement(cbe, ele);
      this.appendNode(ele.cbe);
      eleChild.cbe=cbe;
      rv=ele;
   }
 }
  else{
    if (this.index < 2) ele=document.body;
    else ele=this.ele;
    if (ele.appendChild){
      ele.appendChild(eleChild);
      cbe=new CrossBrowserElement();
      cbeBindElement(cbe, eleChild);
      this.appendNode(eleChild.cbe);
      rv=eleChild;
   }
 }
  return rv;
}
CrossBrowserNode.prototype.removeChild=function(eleChild){
  var ele, rv=null;
  if (this.index < 2) ele=document.body;
  else ele=this.ele;
  if (ele.removeChild || document.layers) {
    --this.childNodes;
    var prevSib=eleChild.cbe.previousSibling;
    var nextSib=eleChild.cbe.nextSibling;
    with (eleChild.cbe){
      parentNode=null;
      previousSibling=null;
      nextSibling=null;
    }
    if (prevSib) prevSib.nextSibling=nextSib;
    else this.firstChild=nextSib;
    if (nextSib) nextSib.previousSibling=prevSib;
    else this.lastChild=prevSib;
    if (document.layers){/* not done */}
    else {ele.removeChild(eleChild);}
    rv=eleChild;
  }
  return rv;
}
// begin v5.0
function _cbeContains(iLeft, iTop, iClipTop, iClipRight, iClipBottom, iClipLeft){if (arguments.length==2){iClipTop=iClipRight=iClipBottom=iClipLeft=0;} else if (arguments.length==3){iClipRight=iClipBottom=iClipLeft=iClipTop;} else if (arguments.length==4){iClipLeft=iClipRight; iClipBottom=iClipTop;} var thisX=this.pageX(), thisY=this.pageY(); return ( iLeft >=thisX + iClipLeft && iLeft <=thisX + this.width() - iClipRight && iTop >=thisY + iClipTop && iTop <=thisY + this.height() - iClipBottom );}
function cbeInnerWidth(){return xClientWidth();}
function cbeInnerHeight(){return xClientHeight();}
function cbePageXOffset(){return xScrollLeft();}
function cbePageYOffset(){return xScrollTop();}
// end v5.0
function _domVisibility(vis){if (arguments.length){if (vis){this.ele.style.visibility='visible';} else{this.ele.style.visibility='hidden';}}else return (this.ele.style.visibility=='visible' || this.ele.style.visibility=='inherit' || this.ele.style.visibility=='');}
function _nnVisibility(vis){if (arguments.length){if (vis){this.ele.visibility='show';} else{this.ele.visibility='hide';}}else return (this.ele.visibility=='show' || this.ele.visibility=='inherit' || this.ele.visibility=='');}
function _ieInnerHtml(sHtml){if (arguments.length){this.ele.innerHTML=sHtml;}else return this.ele.innerHTML;}
function _nnInnerHtml(sHtml){if (arguments.length){if (sHtml==""){sHtml=" ";} this.ele.document.open(); this.ele.document.write(sHtml); this.ele.document.close();}else return "";}
CrossBrowserElement.prototype.cardinalPosition=function(cp, margin, outside){
  if (typeof(cp) !='string'){window.status='cardinalPosition() error: cp=' + cp + ', id=' + this.id; return;}
  var x=this.left(), y=this.top(), w=this.width(), h=this.height();
  var pw=this.parentNode.width(), ph=this.parentNode.height();
  var sx=this.parentNode.scrollLeft(), sy=this.parentNode.scrollTop();
  var right=sx + pw, bottom=sy + ph;
  var cenLeft=sx + Math.floor((pw-w)/2), cenTop=sy + Math.floor((ph-h)/2);
  if (!margin) margin=0;
  else{
    if (outside) margin=-margin;
    sx +=margin; sy +=margin; right -=margin; bottom -=margin;
 }
  switch (cp.toLowerCase()){
    case 'n': x=cenLeft; if (outside) y=sy - h; else y=sy; break;
    case 'ne': if (outside){x=right; y=sy - h;}else{x=right - w; y=sy;}break;
    case 'e': y=cenTop; if (outside) x=right; else x=right - w; break;
    case 'se': if (outside){x=right; y=bottom;}else{x=right - w; y=bottom - h}break;
    case 's': x=cenLeft; if (outside) y=sy - h; else y=bottom - h; break;
    case 'sw': if (outside){x=sx - w; y=bottom;}else{x=sx; y=bottom - h;}break;
    case 'w': y=cenTop; if (outside) x=sx - w; else x=sx; break;
    case 'nw': if (outside){x=sx - w; y=sy - h;}else{x=sx; y=sy;}break;
    case 'cen': case 'center': x=cenLeft; y=cenTop; break;
    case 'cenh': x=cenLeft; break;
    case 'cenv': y=cenTop; break;
 }
  this.x=x; this.y=y;
}
function cbeEval(exp, arg1, arg2, arg3, arg4, arg5, arg6){
  if (typeof(exp)=="function") exp(arg1, arg2, arg3, arg4, arg5, arg6);
  else if (typeof(exp)=="object" && typeof(arg1)=="function") {
    exp._cbeEval_ = arg1;
    exp._cbeEval_(arg2, arg3, arg4, arg5, arg6);
  }
  else if (typeof(exp)=="string") eval(exp);
}
function ClientSnifferJr(){
  this.ua=navigator.userAgent.toLowerCase();
  this.major=parseInt(navigator.appVersion);
  this.minor=parseFloat(navigator.appVersion);
  if (document.addEventListener && document.removeEventListener) this.dom2events=true;
  if (document.getElementById) this.dom1getbyid=true;
  if (window.opera){
    this.opera=true;
    this.opera5=(this.ua.indexOf("opera 5") !=-1 || this.ua.indexOf("opera/5") !=-1);
    this.opera6=(this.ua.indexOf("opera 6") !=-1 || this.ua.indexOf("opera/6") !=-1);
    this.opera5or6=this.opera5 || this.opera6;
    this.opera7=(this.ua.indexOf("opera 7") !=-1 || this.ua.indexOf("opera/7") !=-1);
    return;
  }
  this.konq=this.ua.indexOf('konqueror') != -1;
  this.safari=this.ua.indexOf('safari') != -1;
  this.ie=this.ua.indexOf('msie') !=-1;
  if (this.ie){
    this.ie3=this.major < 4;
    this.ie4=(this.major==4 && this.ua.indexOf('msie 5')==-1 && this.ua.indexOf('msie 6')==-1);
    this.ie4up=this.major >=4;
    this.ie5=(this.major==4 && this.ua.indexOf('msie 5.0') !=-1);
    this.ie5up=!this.ie3 && !this.ie4;
    this.ie6=(this.major==4 && this.ua.indexOf('msie 6.0') !=-1);
    this.ie6up=(!this.ie3 && !this.ie4 && !this.ie5 && this.ua.indexOf("msie 5.5")==-1);
    return;
  }
  this.hotjava=this.ua.indexOf('hotjava') !=-1;
  this.webtv=this.ua.indexOf('webtv') !=-1;
  this.aol=this.ua.indexOf('aol') !=-1;
  if (this.hotjava || this.webtv || this.aol) return;
  // Gecko, NN4, and NS6
  this.gecko=this.ua.indexOf('gecko') !=-1;
  this.nav=(this.ua.indexOf('mozilla') !=-1 && this.ua.indexOf('spoofer')==-1 && this.ua.indexOf('compatible')==-1);
  if (this.nav){
    this.nav4=this.major==4;
    this.nav4up=this.major >=4;
    this.nav5up=this.major >=5;
    this.nav6=this.major==5;
    this.nav6up=this.nav5up;
  }
}
window.is=new ClientSnifferJr();

// x.js
// X v3.13.2, Cross-Browser DHTML Library from Cross-Browser.com
// Copyright (c) 2002,2003 Michael Foster (mike@cross-browser.com)
// This library is distributed under the terms of the LGPL (gnu.org)

// Variables:
var xVersion='3.13.2',xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
  xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
  if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if(document.layers) {xNN4=true;}
else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;}
// Object:
function xGetElementById(e) {
  if(typeof(e)!='string') return e;
  if(document.getElementById) e=document.getElementById(e);
  else if(document.all) e=document.all[e];
  else if(document.layers) e=xLayer(e);
  else e=null;
  return e;
}
function xParent(e,bNode){
  if (!(e=xGetElementById(e))) return null;
  var p=null;
  if (!bNode && xDef(e.offsetParent)) p=e.offsetParent;
  else if (xDef(e.parentNode)) p=e.parentNode;
  else if (xDef(e.parentElement)) p=e.parentElement;
  else if (xDef(e.parentLayer)){if (e.parentLayer!=window) p=e.parentLayer;}
  return p;
}
function xDef() {
  for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}
  return true;
}
function xStr(s) {
  return typeof(s)=='string';
}
function xNum(n) {
  return typeof(n)=='number';
}
// Appearance:
function xShow(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='visible';
  else if(xDef(e.visibility)) e.visibility='show';
}
function xHide(e) {
  if(!(e=xGetElementById(e))) return;
  if(e.style && xDef(e.style.visibility)) e.style.visibility='hidden';
  else if(xDef(e.visibility)) e.visibility='hide';
}
function xZIndex(e,uZ) {
  if(!(e=xGetElementById(e))) return 0;
  if(e.style && xDef(e.style.zIndex)) {
    if(xNum(uZ)) e.style.zIndex=uZ;
    uZ=parseInt(e.style.zIndex);
  }
  else if(xDef(e.zIndex)) {
    if(xNum(uZ)) e.zIndex=uZ;
    uZ=e.zIndex;
  }
  return uZ;
}
function xColor(e,sColor) {
  if(!(e=xGetElementById(e))) return '';
  var c='';
  if(e.style && xDef(e.style.color)) {
    if(xStr(sColor)) e.style.color=sColor;
    c=e.style.color;
  }
  return c;
}
function xBackground(e,sColor,sImage) {
  if(!(e=xGetElementById(e))) return '';
  var bg='';
  if(e.style) {
    if(xStr(sColor)) {
      if(!xOp5or6) e.style.backgroundColor=sColor;
      else e.style.background=sColor;
    }
    if(xStr(sImage)) e.style.backgroundImage=(sImage!='')? 'url('+sImage+')' : null;
    if(!xOp5or6) bg=e.style.backgroundColor;
    else bg=e.style.background;
  }
  else if(xDef(e.bgColor)) {
    if(xStr(sColor)) e.bgColor=sColor;
    bg=e.bgColor;
    if(xStr(sImage)) e.background.src=sImage;
  }
  return bg;
}
// Position:
function xMoveTo(e,iX,iY) {
  xLeft(e,iX);
  xTop(e,iY);
}
function xLeft(e,iX) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if (css && xStr(e.style.left)) {
    if(xNum(iX)) e.style.left=iX+'px';
    else {
      iX=parseInt(e.style.left);
      if(isNaN(iX)) iX=0;
    }
  }
  else if(css && xDef(e.style.pixelLeft)) {
    if(xNum(iX)) e.style.pixelLeft=iX;
    else
      iX=e.style.pixelLeft;
  }
  else if(xDef(e.left)) {
    if(xNum(iX)) e.left=iX;
    else
      iX=e.left;
  }
  return iX;
}
function xTop(e,iY) {
  if(!(e=xGetElementById(e))) return 0;
  var css=xDef(e.style);
  if(css && xStr(e.style.top)) {
    if(xNum(iY)) e.style.top=iY+'px';
    else {
      iY=parseInt(e.style.top);
      if(isNaN(iY)) iY=0;
    }
  }
  else if(css && xDef(e.style.pixelTop)) {
    if(xNum(iY)) e.style.pixelTop=iY;
    else
      iY=e.style.pixelTop;
  }
  else if(xDef(e.top)) {
    if(xNum(iY)) e.top=iY;
    else
      iY=e.top;
  }
  return iY;
}
function xPageX(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.pageX)) return e.pageX;
  var x = 0;
  while (e) {
    if (xDef(e.offsetLeft)) x += e.offsetLeft;
    e = xParent(e);
  }
  return x;
}
function xPageY(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.pageY)) return e.pageY;
  var y = 0;
  while (e) {
    if (xDef(e.offsetTop)) y += e.offsetTop;
    e = xParent(e);
  }
  return y;
}
function xOffsetLeft(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetLeft)) return e.offsetLeft; // v3.13
  else return xPageX(e) - xPageX(xParent(e)); // ?
}
function xOffsetTop(e) {
  if (!(e=xGetElementById(e))) return 0;
  if (xDef(e.offsetTop)) return e.offsetTop; // v3.13
  else return xPageY(e) - xPageY(xParent(e)); // ?
}
// Size:
function xResizeTo(e,uW,uH) {
  xWidth(e,uW);
  xHeight(e,uH);
}
function xWidth(e,uW) {
  if(!(e=xGetElementById(e))) return 0;

  if (xNum(uW)) { // v3.13.1
    if (uW<0) uW = 0;
    else uW=Math.round(uW);
  }
  else uW=0;
  
  var css=xDef(e.style);
  if(css && xDef(e.offsetWidth) && xStr(e.style.width)) {
    if(uW) xSetCW(e, uW);
    uW=e.offsetWidth;
  }
  else if(css && xDef(e.style.pixelWidth)) {
    if(uW) e.style.pixelWidth=uW;
    uW=e.style.pixelWidth;
  }
  else if(xDef(e.clip) && xDef(e.clip.right)) {
    if(uW) e.clip.right=uW;
    uW=e.clip.right;
  }
  return uW;
}
function xHeight(e,uH) {
  if(!(e=xGetElementById(e))) return 0;

  if (xNum(uH)) { // v3.13.1
    if (uH<0) uH = 0;
    else uH=Math.round(uH);
  }
  else uH=0;
  
  var css=xDef(e.style);
  if(css && xDef(e.offsetHeight) && xStr(e.style.height)) {
    if(uH) xSetCH(e, uH);
    uH=e.offsetHeight;
  }
  else if(css && xDef(e.style.pixelHeight)) {
    if(uH) e.style.pixelHeight=uH;
    uH=e.style.pixelHeight;
  }
  else if(xDef(e.clip) && xDef(e.clip.bottom)) {
    if(uH) e.clip.bottom=uH;
    uH=e.clip.bottom;
  }
  return uH;
}
function xGetCS(ele,sP){return parseInt(document.defaultView.getComputedStyle(ele,'').getPropertyValue(sP));}
function xSetCW(ele,uW){
  var pl=0,pr=0,bl=0,br=0;
  if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
    pl=xGetCS(ele,'padding-left');
    pr=xGetCS(ele,'padding-right');
    bl=xGetCS(ele,'border-left-width');
    br=xGetCS(ele,'border-right-width');
  }
  else if(xDef(ele.currentStyle,document.compatMode)){
    if(document.compatMode=='CSS1Compat'){
      pl=parseInt(ele.currentStyle.paddingLeft);
      pr=parseInt(ele.currentStyle.paddingRight);
      bl=parseInt(ele.currentStyle.borderLeftWidth);
      br=parseInt(ele.currentStyle.borderRightWidth);
    }
  }
  else if(xDef(ele.offsetWidth,ele.style.width)){ // ?
    ele.style.width=uW+'px';
    pl=ele.offsetWidth-uW;
  }
  if(isNaN(pl)) pl=0; if(isNaN(pr)) pr=0; if(isNaN(bl)) bl=0; if(isNaN(br)) br=0;
  var cssW=uW-(pl+pr+bl+br);
  if(isNaN(cssW)||cssW<0) return;
  else ele.style.width=cssW+'px';
}
function xSetCH(ele,uH){
  var pt=0,pb=0,bt=0,bb=0;
  if(xDef(document.defaultView) && xDef(document.defaultView.getComputedStyle)){
    pt=xGetCS(ele,'padding-top');
    pb=xGetCS(ele,'padding-bottom');
    bt=xGetCS(ele,'border-top-width');
    bb=xGetCS(ele,'border-bottom-width');
  }
  else if(xDef(ele.currentStyle,document.compatMode)){
    if(document.compatMode=='CSS1Compat'){
      pt=parseInt(ele.currentStyle.paddingTop);
      pb=parseInt(ele.currentStyle.paddingBottom);
      bt=parseInt(ele.currentStyle.borderTopWidth);
      bb=parseInt(ele.currentStyle.borderBottomWidth);
    }
  }
  else if(xDef(ele.offsetHeight,ele.style.height)){ // ?
    ele.style.height=uH+'px';
    pt=ele.offsetHeight-uH;
  }
  if(isNaN(pt)) pt=0; if(isNaN(pb)) pb=0; if(isNaN(bt)) bt=0; if(isNaN(bb)) bb=0;
  var cssH=uH-(pt+pb+bt+bb);
  if(isNaN(cssH)||cssH<0) return;
  else ele.style.height=cssH+'px';
}
function xClip(e,iTop,iRight,iBottom,iLeft) {
  if(!(e=xGetElementById(e))) return;
  if(e.style) {
    if (xNum(iLeft)) e.style.clip='rect('+iTop+'px '+iRight+'px '+iBottom+'px '+iLeft+'px)';
    else e.style.clip='rect(0 '+parseInt(e.style.width)+'px '+parseInt(e.style.height)+'px 0)';
  }
  else if(e.clip) {
    if (xNum(iLeft)) { e.clip.top=iTop; e.clip.right=iRight; e.clip.bottom=iBottom; e.clip.left=iLeft; }
    else { e.clip.top=0; e.clip.right=xWidth(e); e.clip.bottom=xHeight(e); e.clip.left=0; }
  }
}
// Window:
function xScrollLeft() {
  var offset=0;
  if(xDef(window.pageXOffset)) offset=window.pageXOffset;
  else if(document.documentElement && document.documentElement.scrollLeft) offset=document.documentElement.scrollLeft;
  else if(document.body && xDef(document.body.scrollLeft)) offset=document.body.scrollLeft;
  return offset;
}
function xScrollTop() {
  var offset=0;
  if(xDef(window.pageYOffset)) offset=window.pageYOffset;
  else if(document.documentElement && document.documentElement.scrollTop) offset=document.documentElement.scrollTop;
  else if(document.body && xDef(document.body.scrollTop)) offset=document.body.scrollTop;
  return offset;
}
function xClientWidth() {
  var w=0;
  if(xOp5or6) w=window.innerWidth;
  else if(!window.opera && document.documentElement && document.documentElement.clientWidth) // v3.12
    w=document.documentElement.clientWidth;
  else if(document.body && document.body.clientWidth)
    w=document.body.clientWidth;
  else if(xDef(window.innerWidth,window.innerHeight,document.height)) {
    w=window.innerWidth;
    if(document.height>window.innerHeight) w-=16;
  }
  return w;
}
function xClientHeight() {
  var h=0;
  if(xOp5or6) h=window.innerHeight;
  else if(!window.opera && document.documentElement && document.documentElement.clientHeight) // v3.12
    h=document.documentElement.clientHeight;
  else if(document.body && document.body.clientHeight)
    h=document.body.clientHeight;
  else if(xDef(window.innerWidth,window.innerHeight,document.width)) {
    h=window.innerHeight;
    if(document.width>window.innerWidth) h-=16;
  }
  return h;
}


// End cbe_core.js
