var popunder=new Array()
popunder[0]="http://www.vastvision.com/vv1.html"
var winfeatures="width=600,height=389,scrollbars=0,resizable=0,toolbar=0,location=0,menubar=0,status=0,directories=0"
var popfrequency="2 hours"
var dt=new Date();
var buster=dt.getSeconds()+dt.getMinutes()*100+document.location.href.length;
function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) {
      offset += search.length
      end = document.cookie.indexOf(";", offset);
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
function resetcookie(){
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()-10)
document.cookie = "tcpopunder=;path=/;expires=" + expireDate.toGMTString()
}
function loadornot(){
if (get_cookie('tcpopunder')==''){
loadpopunder()
var expireDate = new Date()
expireDate.setHours(expireDate.getHours()+parseInt(popfrequency))
document.cookie = "tcpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString()
}
}
function loadpopunder(){
var win2=window.open('','eCardica1'+buster, winfeatures);
win2.location=popunder[Math.floor(Math.random()*(popunder.length))];
window.focus()
}
if (popfrequency=="always"){
resetcookie()
loadpopunder()
}
else{
if (get_cookie('tcpopunder')!=parseInt(popfrequency))
resetcookie()
loadornot()
}