function alignObj(num)
  {

  this.hide();
  

  if(isDOM) docHeight = document.getElementsByTagName("html").item(0).offsetHeight;
  else if(isIE4 || isIE5) var docHeight = document.body.clientHeight;
  else if(isNav4) var docHeight = window.innerHeight;

  if(isDOM) docWidth = document.getElementsByTagName("html").item(0).offsetWidth;
  else if(isIE4 || isIE5) var docWidth = document.body.clientWidth;
  else if(isNav4) var docWidth = window.innerWidth;


  if(isGecko) { docWidth -= 3; docHeight -= 3; }
  else if(isIE6) { docWidth -= 23; docHeight -= 5; }
  else if(isIE7) { docWidth -= 23; docHeight -= 5; }
  else if(isIE4) docHeight -= 21;
  
  var x = 0; 
  var y = 0;

  switch(num)
  {
   
     case 1:
      // top-left -- don't do anything, x and y = 0
    break;
    case 2:
      // top-middle, y=0
      x = Math.round(docWidth/2 - this.w/2);
    break;
    case 3:
      // top-right, y=0
      x = docWidth - this.w;
    break;
    case 4:
      // middle-left, x=0
      y = Math.round(docHeight/2 - this.h/2);
    break;
    case 5:
      // middle-center
	 
      x = Math.round(docWidth/2 - this.w/2);
      y = Math.round(docHeight/2 - this.h/2)-15;
	  
    break;
    case 6:
      // middle-right
      x = docWidth - this.w;
      y = Math.round(docHeight/2 - this.h/2);
    break;
    case 7:
      // bottom-left, x=0
      y = docHeight - this.h;
    break;
    case 8:
      // bottom-middle
      x = Math.round(docWidth/2 - this.w/2);
      y = docHeight - this.h;
    break;
    case 9:
      // bottom-right
      x = docWidth - this.w;
      y = docHeight - this.h;
    break;

    default:
     
      this.show();
      return;
      break;
  }
  this.moveTo(x, y);
  this.show();
  }
ActiveElement.prototype.align = alignObj;



var isNav4 = false;
var isGecko = false;
var isNav = false
var isIE4 = false;
var isIE5 = false;
var isIE6 = false;
var isIE7 = false;
var isIE = false;
var isDOM = false;
if(navigator.appName=="Netscape")
  {
  isNav=true;
  if(parseInt(navigator.appVersion) >= 4 && parseInt(navigator.appVersion) < 5) isNav4 = true;
  if(parseInt(navigator.appVersion) >= 5) isGecko = true;
  }
else if(navigator.appName=="Microsoft Internet Explorer")
  {
  isIE=true;
  if(navigator.appVersion.indexOf("MSIE 4") != -1) isIE4=true;
  if(navigator.appVersion.indexOf("MSIE 5") != -1) isIE5=true;
  if(navigator.appVersion.indexOf("MSIE 6") != -1) isIE6=true;
    if(navigator.appVersion.indexOf("MSIE 7") != -1) isIE7=true;
  }
if(isGecko || isIE6) isDOM = true;
if(isGecko || isIE7) isDOM = true;

var origHeight, origWidth
function startResizeFix()
  {
  origHeight = (isNav4) ? window.outerHeight : document.body.offsetHeight;
  origWidth = (isNav4) ? window.outerWidth : document.body.offsetWidth;
  }
function resizeFix()
  {
  currHeight = (isNav4) ? window.outerHeight : document.body.offsetHeight;
  currWidth = (isNav4) ? window.outerWidth : document.body.offsetWidth;
  if(currHeight != origHeight || currWidth != origWidth) location.reload();
  }

function ActiveElement(obj, parent)
  {
  if(isGecko || isIE6 || isIE7)
    {
    this.name = obj;
    this.elem = document.getElementById(obj);
    this.css = this.elem.style;
    this.x = parseInt(this.css.left);
    this.y = parseInt(this.css.top);
    this.h = parseInt(this.css.height);
    this.w = parseInt(this.css.width);
    }
  else if(isNav4)
    {
    this.name = obj;
    this.css = (parent) ? eval("document." + parent + ".document.layers['" + obj + "']") : document.layers[obj];
    this.elem = this.css;
    this.x = this.css.left;
    this.y = this.css.top;
    this.h = this.css.clip.height;
    this.w = this.css.clip.width;
    this.elem.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP | Event.MOUSEMOVE | Event.CLICK);
    }
  else if(isIE5)
    {
    this.name = obj;
    this.css = document.all[obj].style;
    this.elem = document.all[obj];
    this.x = this.elem.offsetLeft;
    this.y = this.elem.offsetTop;
    this.h = this.elem.offsetHeight;
    this.w = this.elem.offsetWidth;
    }
  else if(isIE4)
    {
    this.name = obj;
    this.css = document.all[obj].style;
    this.elem = document.all[obj];
    this.x = this.css.pixelLeft;
    this.y = this.css.pixelTop;
    this.h = this.css.pixelHeight;
    this.w = this.css.pixelWidth;
    }
  }

function dynoWriteNav(html)
  {
  this.elem.document.open();
  this.elem.document.write(html);
  this.elem.document.close();
  }
function dynoWrite(html)
  {
  this.elem.innerHTML = html;
  }
ActiveElement.prototype.write = (!isNav4) ? dynoWrite : dynoWriteNav;


function moveItTo(x, y)
  {
  this.css.left = x;
  this.css.top = y;
  this.x = x;
  this.y = y;
  }
function moveItToIE(x, y)
  {
  this.css.pixelLeft = x;
  this.css.pixelTop = y;
  this.x = x;
  this.y = y;
  }
ActiveElement.prototype.moveTo = (isDOM || isNav4) ? moveItTo : moveItToIE;


function moveItBy(dX, dY)
  {
  this.css.left = this.x + dX;
  this.css.top = this.y + dY;
  this.x += dX;
  this.y += dY;
  }
function moveItByIE(dX, dY)
  {
  this.css.pixelLeft += dX;
  this.css.pixelTop +=  dY;
  this.x += dX;
  this.y += dY;
  }
ActiveElement.prototype.moveBy = (isDOM || isNav4) ? moveItBy : moveItByIE;


function setZIndex(zInd) 
  {
  this.css.zIndex = zInd;
  }
ActiveElement.prototype.setZ = setZIndex;


function showItNav()
  {
  this.css.visibility = "show";
  }
function showIt()
  {
  this.css.visibility = "visible";
  }
ActiveElement.prototype.show = (!isNav4) ? showIt : showItNav;


function hideItNav()
  {
  this.css.visibility = "hide";
  }
function hideIt()
  {
  this.css.visibility = "hidden";
  }
ActiveElement.prototype.hide = (!isNav4) ? hideIt : hideItNav;


function toggleVisNav()
  {
  (this.css.visibility == "show") ? this.css.visibility = "hide" : this.css.visibility = "show";
  }
function toggleVis()
  {
  (this.css.visibility == "visible") ? this.css.visibility = "hidden" : this.css.visibility = "visible";
  }
ActiveElement.prototype.toggle = (!isNav4) ? toggleVis : toggleVisNav;


function setBGColNav(color)
  {
  this.css.bgColor = color;
  }
function setBGCol(color)
  {
  this.css.backgroundColor = color;
  }
ActiveElement.prototype.setBGColor = (!isNav4) ? setBGCol : setBGColNav;

