function newCookie(name,value,days) {
 var cookieduration = 24; //cookie duration interval (in hours)

 if (cookieduration) {
   var date = new Date();
   date.setTime(date.getTime()+(cookieduration*60*60*1000));
   var expires = "; expires="+date.toGMTString(); }
   else var expires = "";
   document.cookie = name+"="+value+expires+"; path=/"; }

function readCookie(name) {
   var nameCG = name + "=";
   var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
  if (c.indexOf(nameCG) == 0) return c.substring(nameCG.length,c.length); }
    return null; }

function eraseCookie(name) {
  newCookie(name,"",1); }

function pu(adurl,adname,w,h) {
  var num = readCookie(adname)
  if (num < 1) { 
  newCookie(adname,'flagcookie1');
  x = parseInt(screen.width) / 2 - w / 2;
  y = parseInt(screen.height) / 2 - h / 2;
 SW=window.open(adurl,adname,'toolbar=no,status=no,width='+w+',height='+h+',scrollbars=no,top='+y+',left='+x);
  SW.blur();
  window.focus();
 }
}

// calling this script:
//  <SCRIPT language="JavaScript" SRC="popunder.js"></SCRIPT>
//  <body onLoad="pu('http://www.gratis.com.br/odalisca.mv','odalisca','600','570');">

