//Darn you IE: http://msdn2.microsoft.com/en-us/library/ms536438.aspx
document.expando = true;
if (window.ActiveXObject) {
 window.innerWidth=window.screen.availWidth;
 document.getElementsByName = function(name) {
  var found = [];
  for(i = 0; i < document.all.length; i++){
   if(document.all(i).attributes && document.all(i).attributes.getNamedItem("name") && document.all(i).attributes.getNamedItem("name").value==name) {
   	found.push(document.all(i));
   }
  }
  return found;
 }
}

/**
* Grabbed a bunch of code from http://www.webreference.com/dhtml/diner/realpos2/2.html
*/
function getRealLeftOffset(object) {
	if (window.ActiveXObject) {
		var nLeftPos = object.offsetLeft;          // initialize var to store calculations
		var eParElement = object.offsetParent;     // identify first offset parent element  
		while (eParElement != null)
		{                                            // move up through element hierarchy
			nLeftPos += eParElement.offsetLeft;      // appending left offset of each parent
			eParElement = eParElement.offsetParent;  // until no more offset parents exist
		}
		return nLeftPos;
	} else {
		return object.offsetLeft;
	}
}

/**
* Grabbed a bunch of code from http://www.webreference.com/dhtml/diner/realpos2/2.html
*/
function getRealTopOffset(object) {
	if (window.ActiveXObject) {
		var nTopPos = object.offsetTop;          // initialize var to store calculations
		var eParElement = object.offsetParent;     // identify first offset parent element  
		while (eParElement != null)
		{                                            // move up through element hierarchy
			nTopPos += eParElement.offsetTop;      // appending left offset of each parent
			eParElement = eParElement.offsetParent;  // until no more offset parents exist
		}
		return nTopPos;		
	} else {
		return object.offsetTop;
	}
}

