// Check if the visitor viewed the popup
// else set popupViewed to 1
// return true for viewed/false for not viewed
function popupViewed () {
  if (getCookie('popupViewed') == 1)
    return true;
  else {
    setPopupCookie('popupViewed', 1);
    return false;
  }
}

// Closes the popup window
function closeHover () {
  document.all.hoverAd.style.visibility = "hidden";
  return true;
}

// Opens the popup window and places this in the middle
function openHover() {
  var x = 0;
  var y = 0;
  //IE height and width
  x = document.body.clientWidth/2;
  y = document.body.clientHeight/2;
  //NS height and width
  if (x == 0) x = window.innerWidth/2;
  if (y == 0) y = window.innerHeight/2;
  //set height and width
  document.all.hoverAd.style.left = (x-480);  /* 480 */
  document.all.hoverAd.style.top  = (y-195);  /* 195 */
  document.all.hoverAd.style.visibility = "visible";
  return true;
}

//popup
function popUp () {
  if (!popupViewed())
    openHover();
}

