xScreen =  screen.width;
yScreen = screen.height - 100;

function InA (mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+'no' + ', fullscreen=' + 'no' + ', titlebar=' + 'yes' + ', resizable =' + 'no'
var popunder= "dfge1234"

if (get_cookie('popunder')=='')
{
   var win = window.open(mypage, myname, winprops)
   document.cookie="popunder=yes"

   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
   win.blur ();
   window.focus ();
}
}

function OpenWindow(mypage, myname, w, h) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+'no' + ', fullscreen=' + 'no' + ', titlebar=' + 'yes' + ', resizable =' + 'no'

var win = window.open(mypage, myname, winprops)
}

function NewAg (inURL)
{
    window.location.href = inURL;
}

function get_cookie(Name) 
{
  var search = Name + "="
  var returnvalue = "";
  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) // set the index of the end of cookie value
         end = document.cookie.length;
         returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}
