/* ***********************************
   JavaScript DHTML code by Tim Poulsen
   Ziff-Davis Education
   **********************************/

function clipStart()
  {
  if(isNav4)
    {
  this.origTop = this.clipTop = this.css.clip.top;
  this.origRight = this.clipRight = this.css.clip.right;
  this.origBottom = this.clipBottom = this.css.clip.bottom;
  this.origLeft = this.clipLeft = this.css.clip.left;
  this.wipeBegin = true;
  this.done = false;
  this.clipTo = clipItToNav;
  this.clipBy = clipItByNav;
  this.wipeLeft = wipeToLeft;
  this.revealLeft = revealToLeft;
  this.wipeRight = wipeToRight;
  this.revealRight = revealToRight;
  this.wipeUp = wipeItUp;
  this.revealUp = revealItUp;
  this.wipeDown = wipeItDown;
  this.revealDown = revealItDown;
      }
  else if(isNav6)
    {
  var clipTemp = this.css.clip.substring(5, this.css.clip.length-1).split("px");
  this.origTop = this.clipTop = parseInt(clipTemp[0]);
  this.origRight = this.clipRight = parseInt(clipTemp[1]);
  this.origBottom = this.clipBottom = parseInt(clipTemp[2]);
  this.origLeft = this.clipLeft = parseInt(clipTemp[3]);
  this.wipeBegin = true;
  this.done = false;
  this.clipTo = clipItToIE;
  this.clipBy = clipItByIE;
  this.wipeLeft = wipeToLeft;
  this.revealLeft = revealToLeft;
  this.wipeRight = wipeToRight;
  this.revealRight = revealToRight;
  this.wipeUp = wipeItUp;
  this.revealUp = revealItUp;
  this.wipeDown = wipeItDown;
  this.revealDown = revealItDown;
      }
  else
    {
  var clipTemp = this.css.clip.substring(5, this.css.clip.length-1).split("px");
  this.origTop = this.clipTop = parseInt(clipTemp[0]);
  this.origRight = this.clipRight = parseInt(clipTemp[1]);
  this.origBottom = this.clipBottom = parseInt(clipTemp[2]);
  this.origLeft = this.clipLeft = parseInt(clipTemp[3]);
  this.wipeBegin = true;
  this.done = false;
  this.clipTo = clipItToIE;
  this.clipBy = clipItByIE;
  this.wipeLeft = wipeToLeft;
  this.revealLeft = revealToLeft;
  this.wipeRight = wipeToRight;
  this.revealRight = revealToRight;
  this.wipeUp = wipeItUp;
  this.revealUp = revealItUp;
  this.wipeDown = wipeItDown;
  this.revealDown = revealItDown;
  }
  }
ActiveElement.prototype.clipInit = clipStart;


function clipItToNav(t,r,b,l)
  {
  this.clipTop = this.css.clip.top = t;
  this.clipRight = this.css.clip.right = r;
  this.clipBottom = this.css.clip.bottom = b;
  this.clipLeft = this.css.clip.left = l;
  }

function clipItToIE(t,r,b,l)
  {
  this.css.clip = "rect("+t+"px "+r+"px "+b+"px "+l+"px)";
  this.clipTop = t;
  this.clipRight = r;
  this.clipBottom = b;
  this.clipLeft = l;
  }

function clipItByNav(t,r,b,l)
  {
  this.clipTop = this.css.clip.top = this.clipTop + t;
  this.clipRight = this.css.clip.right = this.clipRight + r;
  this.clipBottom = this.css.clip.bottom = this.clipBottom + b;
  this.clipLeft = this.css.clip.left = this.clipLeft + l;
  }

function clipItByIE(t,r,b,l)
  {
  var newClip = "rect("+(this.clipTop+t)+"px ";
  newClip += (this.clipRight+r)+"px ";
  newClip += (this.clipBottom+b)+"px ";
  newClip += (this.clipLeft+l)+"px)";
  this.clipTop = this.clipTop + t;
  this.clipRight = this.clipRight + r;
  this.clipBottom = this.clipBottom + b;
  this.clipLeft = this.clipLeft + l;
  this.css.clip = newClip;
  }

// wipe hides element
// reveal shows element
function wipeToLeft(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.show();
    }
  this.clipBy(0, -incr, 0, 0);
  (this.clipRight > 0) ? this.done = false : this.done=true;
  }

function revealToLeft(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.clipBy(0, 0, 0, this.w);
    this.show();
    }
  this.clipBy(0, 0, 0, -incr);
  (this.clipLeft > 0) ? this.done = false : this.done=true;
  }

function wipeToRight(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.show();
    }
  this.clipBy(0, 0, 0, incr);
  (this.clipLeft < this.w) ? this.done = false : this.done=true;
  }

function revealToRight(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.clipBy(0, -this.w, 0, 0);
    this.show();
    }
  this.clipBy(0, incr, 0, 0);
  (this.clipRight < this.w) ? this.done = false : this.done=true;
  }

function wipeItUp(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.show();
    }
  this.clipBy(0, 0, -incr, 0);
  (this.clipBottom > 0) ? this.done = false : this.done=true;
  }

function revealItUp(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.clipBy(this.h, 0, 0, 0);
    this.show();
    }
  this.clipBy(-incr, 0, 0, 0);
  (this.clipTop > 0) ? this.done = false : this.done=true;
  }

function wipeItDown(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.show();
    }
  this.clipBy(incr, 0, 0, 0);
  (this.clipTop < this.h) ? this.done = false : this.done=true;
  }

function revealItDown(incr)
  {
  if(this.wipeBegin) 
    {
    this.wipeBegin=false;
    this.clipBy(0, 0, -this.h, 0);
    this.show();
    }
  this.clipBy(0, 0, incr, 0);
  (this.clipBottom < this.h) ? this.done = false : this.done=true;
  }
