var newwin = null;
if(top.location != window.location)
  top.location.replace(window.location.href);

function genericpopwin(url, wid, hi, scroll) {
  new_spec = wid + "_" + hi + scroll;
  scrolling = scroll? "yes": "no";
  if (scroll && document.all && (navigator.userAgent.indexOf("Mac") > -1)) wid = wid+17;
  newwin=window.open(url,new_spec,"WIDTH=" + wid + ",HEIGHT=" + hi + ",scrollBars=" + scrolling + ",resizable=no,screenX=100,screenY=100,left=100,top=100");
  newwin.focus();
}

function launchwin(winurl,winname,winfeatures) {
  newwin = window.open(winurl,winname,winfeatures);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchFullWin(winurl,winname) {
  var winl = 0;//screen.width / 2;
  var wint = 0;//screen.height / 2;
  newwin = window.open(winurl,winname,'scrollbars=yes,resizable=yes,menubar=yes,toolbar=yes,top=' + wint + ',left=' + winl + ',width=' + screen.availWidth + ',height=' + screen.availHeight);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchCenteredWin(url, name, width, height, otherfeatures) {
  var str = "height=" + height + ",innerHeight=" + height;
  str += ",width=" + width + ",innerWidth=" + width;
  if (window.screen) {
    var ah = screen.availHeight - 30;
    var aw = screen.availWidth - 10;
    var xc = (aw - width) / 2;
    var yc = (ah - height) / 2;
    str += ",left=" + xc + ",screenX=" + xc;
    str += ",top=" + yc + ",screenY=" + yc;
  }
  newwin = window.open(url, name, str + ',' + otherfeatures);
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchNewsWin(winurl,winname) {
  newwin = window.open(winurl,winname,'scrollbars=yes,resizable=yes,width=800,height=600');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchStoreWin() {
  newwin = window.open('http:\/\/www.2advanced.com/equipment/index.html','Equipment','scrollbars=yes,resizable=yes,width=790,height=385');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}

function launchWallpaper(winurl,winname) {
  newwin = window.open(winurl,winname,'scrollbars=no,resizable=no,width=515,height=385');
  if(parseInt(navigator.appVersion) >= 4) {
    setTimeout('newwin.focus();',250);
  }
}
