function OpenWindow(theURL,winName,winCenter,x,y,features) {

  var param = "width=" + x + ",height=" + y + ( features=="" ? "" : "," + features );

  var win = window.open(theURL,winName,param);

  if (theURL.indexOf('http:// ') == -1) {

    if (winCenter==1) {win.moveTo((screen.width-x)/2,(screen.height-y)/2);}

    if (winCenter==3) {win.moveTo(0,0);}

    win.focus();

  }

}
