
//============================================================================

  
//These parameters will be set by the php engine

  SPEED=5;
  BASE_HTML='http://www.dhtml-ads.com/testpage.php';
  AD_VISIBLE_HEIGHT=80;
  AD_TOTAL_HEIGHT=60;
  INITIAL_DELAY=1000;
  REDIRECTION_LINK='';
  AD_IMAGE='http://www.dhtml-ads.com/generator/images/lady1.gif';
  AD_BACKGROUND_COLOR='#680403';
  AD_TITLE='';
  AD_TITLE_COLOR='#FFFFFF';
  AD_TEXT="";
  AD_TEXT_COLOR='#FFFFFF';
//============================================================================

  
  function showPopInAd(){
    if (getCookie('dontshowthisagain')!=1) initPopIn();
  }

  function initPopIn(){
    //Get browser inner height & width
    browserInnerWidth=window.width;
    browserInnerHeight=window.height;
    //if browser supports window.innerWidth
    if (window.innerWidth){
      browserInnerHeight=window.innerHeight;
      browserInnerWidth=window.innerWidth;
    }
    //else if browser supports document.all (IE 4+)
    else if (document.all){
      browserInnerHeight=document.body.clientHeight;
      browserInnerWidth=document.body.clientWidth;
    }

    //Set popin ad width=100%
    document.getElementById('lyrPopIn').style.width=browserInnerWidth;
    document.getElementById('lyrPopIn').style.top=browserInnerHeight;
    setTimeout('popIn()',INITIAL_DELAY);

  }

  function popIn(){
    if (parseInt(document.getElementById('lyrPopIn').style.top) > browserInnerHeight-AD_VISIBLE_HEIGHT){
        document.getElementById('lyrPopIn').style.top=parseInt(document.getElementById('lyrPopIn').style.top)-SPEED;
        setTimeout('popIn()',10);
    } else {
      document.getElementById('baseHtml').style.height=browserInnerHeight-AD_TOTAL_HEIGHT;
    }

  }

  function adjustAdPosition(){
    //Get browser inner height & width
    browserInnerWidth=window.width;
    browserInnerHeight=window.height;
    //if browser supports window.innerWidth
    if (window.innerWidth){
      browserInnerHeight=window.innerHeight;
      browserInnerWidth=window.innerWidth;
    }
    //else if browser supports document.all (IE 4+)
    else if (document.all){
      browserInnerHeight=document.body.clientHeight;
      browserInnerWidth=document.body.clientWidth;
    }

    document.getElementById('baseHtml').style.height=browserInnerHeight-AD_TOTAL_HEIGHT+10;
    document.getElementById('lyrPopIn').style.width=browserInnerWidth;
    document.getElementById('lyrPopIn').style.top=browserInnerHeight-AD_TOTAL_HEIGHT-10;
  }

  function popOut(){
    document.getElementById('lyrPopIn').style.top=9999;
    document.getElementById('baseHtml').style.height=browserInnerHeight;
  }

