
var DL_bIE = document.all ? true : false;
var DL_bMac = (navigator.appVersion.indexOf("Mac") != -1);
var DL_bGecko = (navigator.product == "Gecko");
var DL_bNS6Plus = false;
var DL_bNS7 = false;
var DL_bMozNS7 = false;
if(DL_bGecko)
{
	DL_bNS6Plus = (navigator.vendor.indexOf("Netscape") != -1);
	if(DL_bNS6Plus)
	{
		DL_bNS7 = (parseInt(navigator.vendorSub) >= 7);
	}
	else
	{
		DL_bMozNS7 = (parseInt(navigator.productSub) >= 20011221);
	}
}

var DL_bGeckoNS7 = (DL_bNS7 || DL_bMozNS7);
var DL_Allow = ((DL_bIE && !DL_bMac) || DL_bGecko);

function getElement(sId)
{
	return DL_bIE ? document.all(sId) : document.getElementById(sId);
}


function moveBox()
{
	var eBlueBox = getElement("bluebox");
	var eRedBox = getElement("redbox");
	var nRedBoxLeft = DL_GetElementLeft(eRedBox, true);
	var nRedBoxTop  = DL_GetElementTop(eRedBox, true);
	eBlueBox.style.left = nRedBoxLeft + "px";
    eBlueBox.style.top  = nRedBoxTop  + "px";
}

function resetBox()
{
	var eBlueBox = getElement("bluebox");
	var eDiv = getElement("divBlueBox");
    eBlueBox.style.visibility = "visible"

	eBlueBox.style.left = DL_GetElementLeft(eDiv, false) + "px";
	eBlueBox.style.top = DL_GetElementTop(eDiv, false) + "px";
}

function DL_GetElementLeft(eElement)
{
   if (!eElement && this)                    // if argument is invalid
   {                                         // (not specified, is null or is 0)
      eElement = this;                       // and function is a method
   }                                         // identify the element as the method owner

   var nLeftPos = eElement.offsetLeft;       // initialize var to store calculations
   var eParElement = eElement.offsetParent;  // identify first offset parent element

   while (eParElement != null)
   {                                         // move up through element hierarchy
      if(DL_bIE)                             // if browser is IE, then...
      {
         if(eParElement.tagName == "TD")     // if parent a table cell, then...
         {
            nLeftPos += eParElement.clientLeft; // append cell border width to calcs
         }
      }

      nLeftPos += eParElement.offsetLeft;    // append left offset of parent
      eParElement = eParElement.offsetParent; // and move up the element hierarchy
   }                                         // until no more offset parents exist
   return nLeftPos;                          // return the number calculated
}











function DL_GetElementTop(eElement)
{
   if (!eElement && this)                    // if argument is invalid
   {                                         // (not specified, is null or is 0)
      eElement = this;                       // and function is a method
   }                                         // identify the element as the method owner

   var nTopPos = eElement.offsetTop;         // initialize var to store calculations
   var eParElement = eElement.offsetParent;  // identify first offset parent element

   while (eParElement != null)
   {                                         // move up through element hierarchy
      if(DL_bIE)                             // if browser is IE, then...
      {
         if(eParElement.tagName == "TD")     // if parent a table cell, then...
         {
            nTopPos += eParElement.clientTop; // append cell border width to calcs
         }
      }

      nTopPos += eParElement.offsetTop;      // append top offset of parent
      eParElement = eParElement.offsetParent; // and move up the element hierarchy
   }                                         // until no more offset parents exist
   return nTopPos;                           // return the number calculated
}

function DL_OnLoad()
{
    resetBox();
}

if(!DL_Allow)
{
    moveBox =  new Function();
    resetBox = new Function();
    DL_OnLoad = new Function();
}

onload = DL_OnLoad;
