// JavaScript Document

// window position
function getScreenWIDTH(){
    if(document.layers||document.all)
      return screen.width
  }

function getScreenHEIGHT(){
    if(document.layers||document.all)
      return screen.height 
  }

var winHeight =getScreenHEIGHT()/2;
var winWidth =getScreenWIDTH()/2;

function resizeWin(){
 var uName = navigator.userAgent;
 if (uName.indexOf("Safari") > -1) widthPx-=2;heightPx-=1
}



function popupWin2(url){

 widthPx = screen.width;
    heightPx = screen.height;
    resizeWin();
    x = (screen.width  - widthPx) / 2;
    y = (screen.height - heightPx) / 2;

 if(window.opener != "undefined" && window.opener != null){
  window.opener.close();
 }

 var popupW =
 window.open(url,"popupB","left="+x+",top="+y+",width="+widthPx+",height="+heightPx+",directories=no,resizable=yes,menubar=no,toolbar=no,scrollbars=yes,status=no");
 popupW.focus();
}


