//DOM Element Manipulation Code & Browser Compatability------------
//-----------------------------------------------------------------
//These methods are used to promote cross browser compatibality   

IE4 = (document.all && document.getElementById) ? true : false;
NS6 = (!document.all && document.getElementById) ? true : false;

IE4orNS6=(document.all || NS6 ) ? true : false;

NS4=(document.layers);

NS = (NS4 || NS6) ? true : false;
IE = (document.all) ? true : false;  

function DOMGetElement(o) {
  if (IE4orNS6)   return document.getElementById(o);
  else if (IE4)   return document.all[o];
  else if (document.layers)
  { 
	  var temp = eval(('document.'+o));
	  if(!temp)
		  return document.layers[o];
	  else
		  return temp;
  }
  return null;
}

function DOMWindowGetXOffset() {
  if (IE4)           return document.body.scrollLeft;
  else if (IE4orNS6) return window.pageXOffset;
  else if (NS4)      return window.pageXOffset;
}

function DOMWindowGetYOffset() {
  if (IE4)              return document.body.scrollTop;
  else if (IE4orNS6)    return window.pageYOffset;
  else if (NS4)         return window.pageYOffset;
}

function DOMElementSetTopPos(o,val) {
  if (IE4orNS6)   o.style.top = val;
  else if (IE4)   o.style.top = val;
  else if (NS4)   o.pageY = val;
}

function DOMElementSetLeftPos(o,val) {
  if (IE4orNS6)   o.style.left = val;
  else if (IE4)   o.style.left = val;
  else if (NS4)   o.pageX = val;
}

function DOMElementGetTopPos(o) {
  if (IE4orNS6)   return parseInt(o.style.top);
  else if (IE4)   return parseInt(o.style.top);
  else if (NS4)   return parseInt(o.pageY);
}

function DOMElementGetLeftPos(o) {
  if (IE4orNS6)   return parseInt(o.style.left);
  else if (IE4)   return parseInt(o.style.left);
  else if (NS4)   return parseInt(o.pageX);
}

function DOMWindowGetInnerWidth() {
  if (IE4)           return document.body.clientWidth;
  else if (IE4orNS6)   return window.innerWidth;
  else if (NS4)           return window.innerWidth;
}

function DOMWindowGetInnerHeight() {
  if (IE4)          return document.body.clientHeight;
  else if (IE4orNS6)  return window.innerHeight;
  else if (NS4)          return window.innerHeight;
}

function DOMElementGetHeight(o) {
  if (IE4)                 return o.clientHeight;
  else if (IE4orNS6) return parseInt(o.offsetHeight);
  else if (NS4)         return o.document.height;
}

function DOMElementGetWidth(o) {
  if (IE4)                 return o.clientWidth;
  else if (IE4orNS6) return parseInt(o.offsetWidth);
  else if (NS4)         return o.document.width;
}

function moveDOMElement(elementName, newLeft, newTop) 
{
    var o = DOMGetElement(elementName);
    DOMElementSetLeftPos(o, newLeft);
    DOMElementSetTopPos(o, newTop);
}


//END DOM Code Compatability---------------------------------------
//-----------------------------------------------------------------
