/*******
cbe_core.js
CrossBrowserElement v3b3 (Core)
Cross-Browser DHTML for IE 4+, NN 4+, Gecko, and Opera 4+
Download the latest version at cross-browser.com
Documentation is in cbe_reference.html

Copyright (c) 2001 by Michael Foster (mfoster@cybrtyme.com)
This is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.  see the
GNU General Public License for more details: www.gnu.org


Code at the very first removes menu from netscape 4 and 3 by object detection.

*******/


if ( (navigator.appName == "Netscape") && (navigator.appVersion.substring(0,1) <= "4")  ) 
 

{
document.write(" ");
}

else

{



window.onload = function()
{
  cbeInitialize();
  if (window.windowOnload)
    window.windowOnload();
}

///////////////////////////////////// CrossBrowserElement Object Constructor

function CrossBrowserElement(eleObject, indexNum)
{
  if (arguments.length > 2) {
    alert('cbe error: invalid number of arguments for CrossBrowserElement constructor');
    return;
  }
  if (!eleObject) {
    alert("cbe error: CrossBrowserElement constructor requires non-null argument");
    return;
  }

  //// Core Properties:

  if (indexNum == 0)
    this.id = cbeBodyId;
  else
    this.id = eleObject.id;
  this.ele = eleObject;
  this.parent = cbeGetElementParent(eleObject);
  this.index = indexNum;
  this.w = 0;
  this.h = 0;
  this.x = 0;
  this.y = 0;
  this.path = new Array(); // for animation methods

  //// Core Methods:

  this.sizeTo = cbeSizeTo;
  this.sizeBy = cbeSizeBy;
  this.moveTo = cbeMoveTo;
  this.moveBy = cbeMoveBy;
  this.show = cbeShow;
  this.hide = cbeHide;
  this.contains = cbeContains;
  this.scrollLeft = cbeScrollLeft;
  this.scrollTop = cbeScrollTop;

  this.left = domLeft;
  this.top = domTop;
  this.width = domWidth;
  this.height = domHeight;
  this.offsetLeft = domOffsetLeft;
  this.offsetTop = domOffsetTop;
  
  this.zIndex = domZIndex;
  this.innerHtml = domInnerHtml;
  this.visibility = domVisibility;
//  this.display =            ////////// to be implemented
  this.color = domColor;
  this.background = domBackground;
  this.relativePosition = cbeRelativePosition;

  this.clip = domClip;
  this.clipTop = domClipTop;
  this.clipRight = domClipRight;
  this.clipBottom = domClipBottom;
  this.clipLeft = domClipLeft;
  this.clipWidth = domClipWidth;
  this.clipHeight = domClipHeight;
  this.clipArray = domClipArray;
  
  // Adapt interface to browser-specifics:

  if (is.ie4up) {                                // IE4+
    this.left = ieLeft;
    this.top = ieTop;
    this.width = ieWidth;
    this.height = ieHeight;
  }
  else if (is.opera) {                           // Opera
    this.left = ieLeft;
    this.top = ieTop;
    this.width = ieWidth;
    this.height = ieHeight;
    this.background = opBackground;
    this.clip = opClip;
    this.clipTop = cbeReturnZero;
    this.clipRight = cbeReturnZero;
    this.clipBottom = cbeReturnZero;
    this.clipLeft = cbeReturnZero;
    this.clipWidth = opClipWidth;
    this.clipHeight = opClipHeight;
    this.clipArray = nnClipArray;
    this.innerHtml = opInnerHtml;
    this.scrollBy = cbeReturnZero;
    this.clipBy = cbeReturnZero;
    this.autoClip = cbeReturnZero;
  }
  else if (is.gecko) {                           // Gecko
    ;
  }
  else if (is.nav4up) {                          // NN4+
    this.left = nnLeft;
    this.top = nnTop;
    this.width = nnWidth;
    this.height = nnHeight;
    this.offsetLeft = nnOffsetLeft;
    this.offsetTop = nnOffsetTop;
    this.visibility = nnVisibility;
    this.zIndex = nnZIndex;
    this.background = nnBackground;
    this.color = nnColor;
    this.clip = nnClip;
    this.clipTop = nnClipTop;
    this.clipRight = nnClipRight;
    this.clipBottom = nnClipBottom;
    this.clipLeft = nnClipLeft;
    this.clipWidth = nnClipWidth;
    this.clipHeight = nnClipHeight;
    this.clipArray = nnClipArray;
    this.innerHtml = nnInnerHtml;
  }
  else {
    alert("cbe error: Unsupported browser");
    return;
  }

  // Add a property (cbe) to the Element object to point to this CBE object
  this.ele.cbe = this;

  if (this.index != 0) { // if is not body object
    // Initialize width and height (Special thanks to Vlad):
    if (is.ie) this.sizeTo(this.ele.offsetWidth, this.ele.offsetHeight);
    else if (is.gecko) this.sizeTo(this.ele.offsetWidth, this.ele.offsetHeight);
    else if (is.nav) this.sizeTo(this.ele.clip.width, this.ele.clip.height);
    else if (is.opera) this.sizeTo(this.ele.style.pixelWidth, this.ele.style.pixelHeight);
    // Hide, clip to width and height, and move outside of container:
    this.hide();
    this.clip('auto');
    // this.moveTo(-this.w, -this.h);   // commented out in v3b3
  }
}

///////////////////////////////////// Create the Cross-Browser Object Model

function cbeInitialize()
{
  window.cbeBodyId = 'cbeBodyId';
  
  //// Add ClientSnifferJr instance to window

  window.is = new ClientSnifferJr();

  if (!is.ie && !is.nav && !is.gecko && !is.opera) {
    alert(
      "It appears that you are not using one of the browsers I support on this site: IE, NN, Gecko, or Opera.\n\n"
      +"Please send me an email and tell me what browser you are using - I will try to support it!\n\n"
      +"Or, if I have not properly detected your browser, please let me know about that also.\n\n"
      +"Thanks,\nMike Foster\nmfoster@cybrtyme.com\nwww.cross-browser.com\n\nPlease include the following message with your email:\n"+is.ua
    );
  }

  //// Add appropriate CrossBrowserElement properties and methods
  //// if other .js files have been loaded

  // Event Methods (in cbe_event.js)
  if (window.cbeEventJsLoaded) {
    CrossBrowserElement.prototype.addEventListener = _cbeAddEventListener;
    CrossBrowserElement.prototype.removeEventListener = _cbeRemoveEventListener;
    // Add CrossBrowserEvent object to window
    window.cbeEvent = new CrossBrowserEvent();
  }
  // Animation Methods (in cbe_anim.js)
  if (window.cbeAnimJsLoaded) {
    CrossBrowserElement.prototype.slideTo = cbeSlideTo;
    CrossBrowserElement.prototype.arcTo = cbeArcTo;
    CrossBrowserElement.prototype.linearPath = cbeLinearPath;
    CrossBrowserElement.prototype.circularPath = cbeCircularPath;
    CrossBrowserElement.prototype.followPath = cbeFollowPath;
    CrossBrowserElement.prototype.cyclePaths = cbeCyclePaths;
    CrossBrowserElement.prototype.stopCycle = cbeStopCycle;
    CrossBrowserElement.prototype.slideToY = cbeSlideToY; //
    CrossBrowserElement.prototype.yTarget = 0;            // for slideToY
    CrossBrowserElement.prototype.moving = false;
    CrossBrowserElement.prototype.walk = null;
    CrossBrowserElement.prototype.stop = true;
//    CrossBrowserElement.prototype.path = new Array(); // this won't work here, it makes it "static", I put it back in the constructor
    if (!CrossBrowserElement.prototype.timeout)
      CrossBrowserElement.prototype.timeout = 10;
  }
  // Clipping Methods (in cbe_clip.js)
  if (window.cbeClipJsLoaded) {
    CrossBrowserElement.prototype.clipBy = cbeClipBy;
    CrossBrowserElement.prototype.autoClip = cbeAutoClip;
    CrossBrowserElement.prototype.scrollBy = cbeScrollBy;
    CrossBrowserElement.prototype.clipSpeed = 50;
    CrossBrowserElement.prototype.clipping = false;
    if (!CrossBrowserElement.prototype.timeout)
      CrossBrowserElement.prototype.timeout = 10;
  }
 
  //// Add document methods for W3C DOM support

  if (!document.getElementById) document.getElementById = cbeGetElementById;
  if (!document.getElementsByTagName) document.getElementsByTagName = cbeGetElementsByTagName;
  if (!document.body) document.body = new Object();
  document.body.id = cbeBodyId;
  
  //// Build array (cbeAll) of all CrossBrowserElement objects.
  //// It includes all DIV, SPAN, and LAYER elements with id != "".
  
  var i, j, ele, divArray;
  window.cbeAll = new Array();
  // document.body object is first
  cbeAll[0] = new CrossBrowserElement(document.body, 0);
  // Get all named DIV elements
  divArray = document.getElementsByTagName('DIV');
  for (i = 0, j = 1; i < divArray.length; i++) {
    ele = divArray[i];
    if ( ele.id != "") {
      cbeAll[j] = new CrossBrowserElement(ele, j);
      ++j;
    }
  }
  // Get all named SPAN elements
  if (!is.nav4) {
    divArray = document.getElementsByTagName('SPAN');
    for (i = 0; i < divArray.length; i++) {
      ele = divArray[i];
      if ( ele.id != "") {
        cbeAll[j] = new CrossBrowserElement(ele, j);
        ++j;
      }
    }
  }
}    // end cbeInitialize

///////////////////////////////////// W3C DOM Support

function cbeGetElementById(eleId)
{
  var ele = null;

  if (is.ie5up || is.gecko || is.opera)
    ele = document.getElementById(eleId);
  else if (is.ie4up)
    ele = document.all[eleId];
  else if (is.nav4up)
    ele = nnGetElementById(window, eleId);
    
  return ele;
}

function nnGetElementById(parent, searchId)    // testing this idea
{                                              // assumes cbom is in place
  for (var i = 0; i < cbeAll.length; i++) {
    if ( cbeAll[i].id == searchId )
      return cbeAll[i].ele;
  }
  return null;
}

function xx_nnGetElementById(parent, searchId) // instead of this
{
  var i, ele, eleFound;
  for (i = 0; i < parent.document.layers.length; i++) {
    ele = parent.document.layers[i];
    if ( ele.id == searchId )
      return ele;
    if (ele.document.layers.length) {
      eleFound = nnGetElementById(ele, searchId);
      if (eleFound) return eleFound;
    }
  }
  return null;
}

function cbeGetElementsByTagName(tagName)
{
  var eleArray;
  if (is.opera)
    eleArray = document.body.getElementsByTagName(tagName);
  else if (is.ie4)
    eleArray = document.all.tags(tagName);
  else if (is.ie5up || is.gecko || is.nav5up)  
    eleArray = document.getElementsByTagName(tagName);
  else if (is.nav4) {
    eleArray = new Array();
    nnGetAllLayers(window, eleArray, 0);
  }
  return eleArray;
}

function nnGetAllLayers(parent, layerArray, nextIndex)
{
  var i, layer;
  // get all named layers
  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;
}

function cbeGetElementParent(child)
{
  var parent = document.body; // assume cbom is in place
  
  if (child.id == cbeBodyId) // if is body object
    parent = null;
  else {
    if (is.ie || is.gecko || is.opera) {
      if (child.parentElement) parent = child.parentElement;
      else if (child.parentNode) parent = child.parentNode;
      else if (child.offsetParent) parent = child.offsetParent;
    }
    else if (is.nav4up) {
      if (child.parentLayer) {
        if (child.parentLayer != window)
          parent = child.parentLayer;
      }    
    }
  }
  return parent;
}

///////////////////////////////////// CrossBrowserElement Methods

function cbeContains(leftPoint, topPoint, margin)
{
  if (arguments.length < 3)
    margin = 0;
  return (    
    leftPoint > this.left() + margin &&
    leftPoint < this.left() + this.width() - margin &&
    topPoint > this.top() + margin &&
    topPoint < this.top() + this.height() - margin
  );
}

function cbeMoveTo(x_cr, y_mar, outside)
{
  if (isFinite(x_cr)) {
    this.left(x_cr);
    this.top(y_mar);
  }
  else {
    this.relativePosition(x_cr, y_mar, outside);
    this.left(this.x);
    this.top(this.y);
  }  
}

function cbeMoveBy(dX, dY)
{
  if (dX) this.left(this.left() + dX);
  if (dY) this.top(this.top() + dY);
}

function domLeft(newLeft)
{
  if (arguments.length == 1) this.ele.style.left = newLeft + "px";
  return parseInt(this.ele.style.left);
}

function ieLeft(newLeft)
{
  if (arguments.length == 1) this.ele.style.pixelLeft = newLeft;
  return this.ele.style.pixelLeft;
}

function nnLeft(newLeft)
{
  if (arguments.length == 1) this.ele.left = newLeft;
  return this.ele.left;
}

function domTop(newTop)
{
  if (arguments.length == 1) this.ele.style.top = newTop + "px";
  return parseInt(this.ele.style.top);
}

function ieTop(newTop)
{
  if (arguments.length == 1) this.ele.style.pixelTop = newTop;
  return this.ele.style.pixelTop;
}

function nnTop(newTop)
{
  if (arguments.length == 1) this.ele.top = newTop;
  return this.ele.top;
}

function domOffsetLeft()
{
  return this.ele.offsetLeft; // exists but not valid in Opera5
}

function domOffsetTop()
{
  return this.ele.offsetTop; // exists but not valid in Opera5
}

function nnOffsetLeft()
{
  return this.ele.pageX;
}

function nnOffsetTop()
{
  return this.ele.pageY;
}

function cbeSizeTo(newWidth, newHeight)
{
  this.width(newWidth);
  this.height(newHeight);
}

function cbeSizeBy(dW, dH)
{
  this.width(this.width() + dW);
  this.height(this.height() + dH);
}

function domWidth(newWidth)
{
  if (arguments.length == 1) {
    this.w = newWidth;
    this.ele.style.width = newWidth + "px";
  }
  else if (this.index == 0) { // if is document.body.cbe
    this.w = cbeInnerWidth();
  }
  return this.w
}

function ieWidth(newWidth)
{
  if (arguments.length == 1) {
    this.w = newWidth;
    this.ele.style.pixelWidth = newWidth;
  }  
  else if (this.index == 0) { // if is document.body.cbe
    this.w = cbeInnerWidth();
  }
  return this.w
}

function nnWidth(newWidth)
{
  if (arguments.length == 1) {
    this.w = newWidth;
  }  
  else if (this.index == 0) { // if is document.body.cbe
    this.w = cbeInnerWidth();
  }
  return this.w
}

function domHeight(newHeight)
{
  if (arguments.length == 1) {
    this.h = newHeight;
    this.ele.style.height = newHeight + "px";
  }
  else if (this.index == 0) { // if is document.body.cbe
    this.h = cbeInnerHeight();
  }
  return this.h
}

function ieHeight(newHeight)
{
  if (arguments.length == 1) {
    this.h = newHeight;
    this.ele.style.pixelHeight = newHeight;
  }  
  else if (this.index == 0) { // if is document.body.cbe
    this.h = cbeInnerHeight();
  }
  return this.h
}

function nnHeight(newHeight)
{
  if (arguments.length == 1) {
    this.h = newHeight;
  }  
  else if (this.index == 0) { // if is document.body.cbe
    this.h = cbeInnerHeight();
  }
  return this.h
}

function cbeScrollLeft()
{
  var value = 0;
  if (is.ie4up) {
    value = this.ele.scrollLeft;
  }
  else if (is.nav4up || is.opera || is.gecko) {
    if (this.index == 0) // if is body object
      value = window.pageXOffset;
    else {
      value = 0; // ???????
    }
  }  
  return value;
}

function cbeScrollTop()
{
  var value = 0;
  if (is.ie4up) {
    value = this.ele.scrollTop;
  }
  else if (is.nav4up || is.opera || is.gecko) {
    if (this.index == 0) // if is body object
      value = window.pageYOffset;
    else {
      value = 0; // ???????
    }
  }  
  return value;
}

function cbeShow()
{
  this.visibility(1);
}

function cbeHide()
{
  this.visibility(0);
}

function domVisibility(vis)
{
  if (arguments.length == 1) {
    switch(typeof(vis)) {
      case 'number':
      case 'boolean':
        if (vis)
          this.ele.style.visibility = is.opera ? 'visible' : 'inherit';
        else  
          this.ele.style.visibility = 'hidden';
        break;
      case 'string':
        this.ele.style.visibility = vis;
        break;
      default:
        alert('invalid argument in domVisibility()');  
    }
  }
  else {
    return (
      this.ele.style.visibility == 'visible'
      || this.ele.style.visibility == 'inherit'
      || this.ele.style.visibility == ''
    );
  }
}

function nnVisibility(vis)
{
  if (arguments.length == 1) {
    switch(typeof(vis)) {
      case 'number':
      case 'boolean':
        if (vis)
          this.ele.visibility = 'inherit';
        else  
          this.ele.visibility = 'hide';
        break;
      case 'string':
        this.ele.style.visibility = vis;
        break;
      default:
        alert('invalid argument in nnVisibility()');  
    }
  }
  else {
    return (
      this.ele.visibility == 'show'
      || this.ele.visibility == 'inherit'
      || this.ele.visibility == ''
    );
  }
}

function domZIndex(newZ)
{
  if (arguments.length == 1)
    this.ele.style.zIndex = newZ;
  return this.ele.style.zIndex
}

function nnZIndex(newZ)
{
  if (arguments.length == 1)
    this.ele.zIndex = newZ;
  return this.ele.zIndex;
}

function domBackground(newBgColor, newBgImage)
{
  if (arguments.length >= 1) {
    if (newBgColor == null || newBgColor == 'transparent')
      newBgColor = 'transparent';
    this.ele.style.backgroundColor = newBgColor;
    if (arguments.length == 2)
      this.ele.style.backgroundImage = "url(" + newBgImage + ")";
  }
  return this.ele.style.backgroundColor;
}

function nnBackground(newBgColor, newBgImage)
{
  if (arguments.length >= 1) {
    if (newBgColor == null || newBgColor == 'transparent')
      newBgColor = null;
    this.ele.bgColor = newBgColor;
    if (arguments.length == 2)
  this.ele.background.src = newBgImage || null;
  }
  return this.ele.bgColor;
}

function opBackground(newBgColor, newBgImage)
{
  // how to make transparent?
  // and backgroundImage not yet supported by Opera
  if (arguments.length >= 1) {
    this.ele.style.background = newBgColor;
  }
  return this.ele.style.background;
}

function domColor(newColor)
{
  if (arguments.length == 1) {
    this.ele.style.color = newColor;
  }
  return this.ele.style.color;
}

function nnColor(newColor)
{
  return;
}

function domClip(top, right, bottom, left)
{
  if (arguments.length == 4) {
    var clipRect =
      "rect("
      + top + "px "
      + right + "px "
      + bottom + "px "
      + left + "px"
      + ")";
    this.ele.style.clip = clipRect;
  }
  else if (arguments.length == 1) {
    this.clip(0, this.width(), this.height(), 0);
  }
  else
    return this.ele.style.clip;
}

function nnClip(top, right, bottom, left)
{
  if (arguments.length == 4) {
    this.ele.clip.top = top;
    this.ele.clip.right = right;
    this.ele.clip.bottom = bottom;
    this.ele.clip.left = left;
  }
  else if (arguments.length == 1) {
    this.clip(0, this.width(), this.height(), 0);
  }
  else {
    var clipRect =
      "rect("
      + this.ele.clip.top + "px "
      + this.ele.clip.right + "px "
      + this.ele.clip.bottom + "px "
      + this.ele.clip.left + "px"
      + ")";
    return clipRect;
  }
}

function opClip(top, right, bottom, left)
{
  if (arguments.length == 0)
    return "rect()";
}

function domClipArray()
{
  var re = /\(|px,?\s?\)?|\s|,|\)/;  // special thanks to David Wincent
  return this.ele.style.clip.split(re);
}

function nnClipArray()
{
  alert('method not implemented for NN4 nor Opera');
}

function domClipTop()
{
  var a = this.clipArray();
  return parseInt(a[1]);
}
function nnClipTop()
{
  return this.ele.clip.top;
}
//--
function domClipRight()
{
  var a = this.clipArray();
  return parseInt(a[2]);
}
function nnClipRight()
{
  return this.ele.clip.right;
}
//--
function domClipBottom()
{
  var a = this.clipArray();
  return parseInt(a[3]);
}
function nnClipBottom()
{
  return this.ele.clip.bottom;
}
//--
function domClipLeft()
{
  var a = this.clipArray();
  return parseInt(a[4]);
}
function nnClipLeft()
{
  return this.ele.clip.left;
}

function domClipWidth()
{
  var a = this.clipArray();
  return (a[2] - a[4]);
}
function nnClipWidth()
{
  if (this.index == 0)
    return cbeInnerWidth();
  return this.ele.clip.width;
}
function opClipWidth()
{
  return this.w;
}
//--
function domClipHeight()
{
  var a = this.clipArray();
  return (a[3] - a[1]);
}
function nnClipHeight()
{
  if (this.index == 0)
    return cbeInnerHeight();
  return this.ele.clip.height;
}
function opClipHeight()
{
  return this.h;
}

function cbeReturnZero()
{
  return 0;
}

function cbeReturnVoid()
{
}

function domInnerHtml(newHtml)
{
  this.ele.innerHTML = newHtml;
}

function nnInnerHtml(newHtml)
{
  if (newHtml == '') newHtml = ' ';
  this.ele.document.open();
  this.ele.document.write(newHtml);
  this.ele.document.close();
}

function opInnerHtml(newHtml)
{
  return;  // Opera5 does not support this
}

function cbeRelativePosition(rp, margin, outside)
{
  var x = this.left();
  var y = this.top();
  var w = this.clipWidth();
  var h = this.clipHeight();
  var pw = this.parent.cbe.width();
  var ph = this.parent.cbe.height();
  var sx = this.parent.cbe.scrollLeft();
  var sy = this.parent.cbe.scrollTop();
  var right = sx + pw;
  var bottom = sy + ph;
  var cenLeft = sx + Math.floor(pw/2) - Math.floor(w/2);
  var cenTop = sy + Math.floor(ph/2) - Math.floor(h/2);
  
  if (arguments.length > 1) {
    if (outside)
      margin = -margin;
    sx += margin;
    sy += margin;
    right -= margin;
    bottom -= margin;
  }
  switch (rp.toLowerCase()) {
    case 'center':
      x = cenLeft;
      y = cenTop;
      break;
    case 'centerh':
      x = cenLeft;
      break;
    case 'centerv':
      y = cenTop;
      break;  
    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;
    default:
      alert("invalid 'rp' argument in relativePosition()");
  }
  this.x = x;
  this.y = y;
}

// End of method definitions, global functions follow
/////////////////////////////////////

function cbeInnerWidth()
{
  var w = 0;
  if (is.nav4up) {
    w = window.innerWidth;
    if (document.height > window.innerHeight) // has vert scrollbar
      w -= 16;
  }
  else if (is.ie4up) {
    w = document.body.clientWidth;
  }
  else if (is.opera) {
    w = window.innerWidth;
  }
  return w;
}

function cbeInnerHeight()
{
  var h = 0;
  if (is.nav4up) {
    h = window.innerHeight;
    if (document.width > window.innerWidth) // has horz scrollbar
      h -= 16;
  }
  else if (is.ie4up) {
    h = document.body.clientHeight;
  }
  else if (is.opera) {
    h = window.innerHeight;
  }
  return h;
}

function cbePageXOffset()
{
  var offset;
  if (is.nav4up || is.opera) {
    offset = window.pageXOffset;
  }
  else if (is.ie4up) {
    offset = document.body.scrollLeft;
  }
  return offset;
}

function cbePageYOffset()
{
  var offset;
  if (is.nav4up || is.opera) {
    offset = window.pageYOffset;
  }
  else if (is.ie4up) {
    offset = document.body.scrollTop;
  }
  return offset;
}

///////////////////////////////////// ClientSnifferJr Object Constructor
// Special thanks to Baron Schwartz

function ClientSnifferJr()
{
  this.ua = navigator.userAgent.toLowerCase();
  this.major = parseInt(navigator.appVersion);
  this.minor = parseFloat(navigator.appVersion);
  // Opera
  this.opera = this.ua.indexOf('opera') != -1;
  if (this.opera) return;
  // MSIE
  this.ie = this.ua.indexOf('msie') != -1;
  if (this.ie) {
    this.ie3 = this.major == 2;
    this.ie4 = (
      this.major == 4 && this.ua.indexOf('msie 5.0') == -1
    );
    this.ie4up = this.major >= 4;
    this.ie5up = !this.ie3 && !this.ie4;
    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;
    return;
  }
  // Others
  this.hotjava = this.ua.indexOf('hotjava') != -1; 
  this.webtv = this.ua.indexOf('webtv') != -1;
  this.aol = this.ua.indexOf('aol') != -1; 
}



// end else routine

}


// End cbe_core.js

