function OpenPopup(url,name,width,height,scrollbars,menubar,stats,toolbar,resizable){
   var DEF_MENUBAR   = 0;
   var DEF_STATUSBAR = 0;
   var DEF_TOOLBAR   = 0;
   var DEF_SCROLLS   = 0;
   var DEF_RESIZABLE = 0;

   if (typeof url == "undefined"){
      alert("Incorect use of OpenPopup! url param must be suplied!\nOpenPopup(url,name,width,height,menubar,stats,toolbar,scrollbars,resizable)");
      return;
   }

   if (typeof name == "undefined"){
      alert("Incorect use of OpenPopup! name param must be suplied!\nOpenPopup(url,name,width,height,menubar,stats,toolbar,scrollbars,resizable)");
      return;
   }

   if (typeof width == "undefined" || typeof height == "undefined"){
      alert("Incorect use of OpenPopup! width and height params must be suplied!\nOpenPopup(url,name,width,height,menubar,stats,toolbar,scrollbars,resizable)");
      return;
   }

   // define window params
   var win_menubar   = (menubar    || DEF_MENUBAR)   ? "yes" : "no";
   var win_status    = (stats      || DEF_STATUSBAR) ? "yes" : "no";
   var win_toolbar   = (toolbar    || DEF_TOOLBAR)   ? "yes" : "no";
   var win_scrolls   = (scrollbars || DEF_SCROLLS)   ? "yes" : "no";
   var win_resize    = (resizable  || DEF_RESIZABLE) ? "yes" : "no";

   // form open string
   var win_str = "height=" + height + ",width=" + width + ",menubar=" + win_menubar + ",stats=" + win_status + ",toolbar=" + win_toolbar + ",scrollbars=" + win_scrolls + ",resizable=" + win_resize;

   // get client resolution and calc window position
   var scr_width  = screen.width;
   var scr_height = screen.height;

   var win_x = scr_width/2 - width/2;
   var win_y = scr_height/2 - height/2;


   var win = window.open(url, name, win_str);
   win.moveTo(win_x,win_y);
   win.focus();

   return win;
}

function OpenPopupNR(url,name,width,height,scrollbars,resizable,menubar,stats,toolbar){
    OpenPopup(url,name,width,height,scrollbars,menubar,stats,toolbar,resizable);
}