var extraAd;
var theTop;
var old;


var oldonload = window.onload; 
if (typeof window.onload != 'function') { 
    window.onload = function () {
        extraAd =  document.getElementById("ExtraAd");
	    if (extraAd) {
	        theTop = extraAd.offsetTop;
	        extraAd.style.zIndex = 1;
	        //alert(extraAd.offsetTop);
	        old = theTop;
	        moveAd();
	        }
        }
  } else { 
    window.onload = function() { 
      if (oldonload) { 
        oldonload(); 
     } 
    extraAd =  document.getElementById("ExtraAd"); 
	if (extraAd) {
	    theTop = extraAd.offsetTop;
	    extraAd.style.zIndex = 1;
	    //alert(extraAd.offsetTop);
	    old = theTop;
	    moveAd();
	    }
   } 
  } 

function MainMove()
{
        extraAd =  document.getElementById("ExtraAd");
	    if (extraAd) {
	        theTop = extraAd.offsetTop;
	        old = theTop;
	        moveAd();
	        }
}


function moveAd()
{
	if (window.innerHeight)
	{
		  pos = window.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
	{
		pos = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		  pos = document.body.scrollTop;
	}
	if (pos < theTop) pos = theTop;
	else pos += 0;
	if (pos == old)
	{
	    extraAd =  document.getElementById("ExtraAd"); 
		extraAd.style.top = pos + "px";
		extraAd.style.zIndex = 1;
	}
	old = pos;
	temp = setTimeout('moveAd()',200);
}
