//basic popup window w/default size and centering- js

function popupBasic(url,popWidth,popHeight,scrollbars,popX,popY){

     //default or specified size

     popWidth = typeof(popWidth) != 'undefined' ? popWidth : 800;

     popHeight = typeof(popHeight) != 'undefined' ? popHeight : 618;

     

     //center positioning

     var screenWidth = screen.availWidth-10;

     var screenHeight = screen.availHeight-30;

     var centerX = (screenWidth-popWidth)/2;

     var centerY = (screenHeight-popHeight)/2;

     

     //centered or specified position

     popX = typeof(popX) != 'undefined' ? popX : centerX;

     popY = typeof(popY) != 'undefined' ? popY : centerY;

     

     //default on scrollbars

     scrollbars = typeof(scrollbars) != 'undefined' ? scrollbars : "no";

     

     newwindow=window.open(url,'_blank','width='+popWidth+',height='+popHeight+',left='+popX+',top='+popY+',scrollbars='+scrollbars+',resizable=yes');

     if (window.focus) {newwindow.focus()}

     

     return false;

}

