
function popup(url, name, w, h)
{
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
 
 if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  } 
  
if (! window.focus)return true;
var href;
if (typeof(url) == 'string')
   href=url;
else
   href=url.href;

  var win = window.open(href,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=no, resizable=no');
  
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
  
return false;
}


if (isOpera){
    var m = document.getElementsByTagName("a");
    for (key in m)

    {
      current=m[key];
      if (!MGgetCookie('MG_popunder') && !current.onclick ){

         current.target="_blank";
         current.onclick="return mgopera(event)";
      }
    }
}


if (isIE6){
    var m = document.getElementsByTagName("a");
    for (i=0;i<m.length;i++)

    {
        var current=m[i];
         if (!MGgetCookie('MG_popunder') && !current.onclick){

            current.target = '';
            current.onclick = function(){mgopenie();};
         }

    }
}
if (isIE7){
    var m = document.getElementsByTagName("a");
    for (i=0;i<m.length;i++)

    {
        var current=m[i];
        if (!MGgetCookie('MG_popunder') && !current.onclick){

           current.target = '';
           current.onclick = function(){mgopenie7();};
        }

    }
}