var winfeatures;

   winfeatures = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
   winfeatures = winfeatures + ',width=' + (screen.availWidth - 10).toString();
   winfeatures = winfeatures + ',height=' + (screen.availHeight - 122).toString();
   winfeatures = winfeatures + ',screenX=0,screenY=0,left=0,top=0';

var once_per_session=0

function Set_Cookie( name, value, expires, path, domain, secure ) 
{
var today = new Date();
today.setTime( today.getTime() );
if ( expires )
{
expires = expires * 1000 * 60;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      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 loadornot(){
if (get_cookie('popunder')==''){
loadpopunder()
document.cookie="popunder=yes"
}
}

function loadpopunder(){
  if (get_cookie('popunder')==''){
    win2=window.open(punder,"tpun"+punderp,winfeatures)
    win2.blur()
    win2.moveTo(0,0);
    win2.resizeTo( screen.availWidth, screen.availHeight );
    window.focus();    
    Set_Cookie( 'popunder', 'yes', 5, '/', '', '');
  }
}
/*
if (once_per_session==0)
loadpopunder()
else
loadornot()
*/