
  onresize = setPosition;
  //hard coded left.  I should pass this into the function from teh page, but
  //I have too much to finish before I leave.  
  var initialLeft = 10;
  var divName = 'bigAd';
  var theDelay = 1;
  var theTimer = setTimeout('vanishAd()', 1000 * theDelay);
  clearTimeout(theTimer);  
  
  function setTimer(){
    theTimer = setTimeout('vanishAd()', 1000 * theDelay);
  }

  function clearTimer(){
    clearTimeout(theTimer);
  }
        
  function vanishAd(){
    setPosition();
    if(document.getElementById){
      theDiv = document.getElementById(divName);    
      theDiv.style.visibility = 'hidden';      
    }
    else if(document.layers){
      theDiv = document.layers[divName];    
      theDiv.visibility = "hide";
    }  
  }
          
  function getWindowWidth(){
    var retValue = 0;
    if(window.innerWidth){
      retValue = window.innerWidth;
    }
    else if(document.body && document.body.clientWidth){
      retValue = document.body.clientWidth;
    }
    
    return retValue;
  }

  function setPosition(){
    //document.theForm.theField.value = getWindowWidth();
    var windowWidth = getWindowWidth();
    if(windowWidth > 770){
      var theOffset = windowWidth - 770;
      if(theOffset%2 != 0){
        theOffset++;
      }
      theOffset = theOffset/2;
	  
	  //theOffset = 0;
      
      if(document.getElementById){
        theDiv = document.getElementById(divName);
        newLeft = initialLeft+theOffset
        theDiv.style.left = newLeft+"px";
      }  
      else if(document.layers){
        theDiv = document.layers[divName];
        newLeft = initialLeft+theOffset
        theDiv.left = newLeft;
      }    
    }
    else{
      if(document.getElementById){
        theDiv = document.getElementById(divName);
        theDiv.style.left = initialLeft;
      }  
      else if(document.layers){
        theDiv = document.layers[divName];
        theDiv.left = initialLeft;
      }
    }
  }
  
  function showAd(sDiv, lLeft, lTop){
	divName = sDiv;
	initialLeft = lLeft;
    clearTimer();
    setPosition();
    if(document.getElementById){   
      theDiv = document.getElementById(divName);    
      theDiv.style.visibility = 'visible';
	  theDiv.style.top = lTop;
    }
    else if(document.layers){
      theDiv = document.layers[divName];    
      theDiv.visibility = "show";
	  theDiv.top = lTop;
    }
  }
