var punder=new Array();
punder[0]="/u/1.html";

// window size
var w = '610';
var h = '600';

var p = 'scrollbars=no,resizable=yes,toolbar=no,menubar=yes,status=yes,' +
        'location=no,left=25,top=25,height=' + h + ',width=' + w;

// Specifying 1 will cause it to load only once per session
var once_ses = 1;

function get_cookie(Name) {
  var search = Name + "=";
  var rv = "";
  if(document.cookie.length > 0){
    offset = document.cookie.indexOf(search);
    if (offset != -1){ // if the cookie exists
      offset += search.length;
      end = document.cookie.indexOf(";", offset); // set the index of beginning value
      if (end == -1) end = document.cookie.length; //set the index of the end of cookie value
      rv = unescape(document.cookie.substring(offset, end));
    }
  }
  return rv;
}

function load_popup(){
  win2=window.open(punder[Math.floor(Math.random()*(punder.length))],"bw",p);
  win2.blur();
  window.focus();
}

if(!once_ses)
  load_popup()
else{
  if(get_cookie('punder')==''){
    load_popup();
    document.cookie="punder=yes";
  }
}

