
suitClass.prototype.window = function(url, strName, w, h, toolbool) {  //version 1.2

  if (!strName) strName = "SUITWindow";

  if (!w) w = suit.pConvertWindowSize("70%","width");
  else w = suit.pConvertWindowSize(w,"width");

  if (!h) h = suit.pConvertWindowSize("50%","height");
  else h = suit.pConvertWindowSize(h,"height");

  if (toolbool != false) toolbool = true;

  var win, winleft, wintop, winprops, strBr;

  strBr = suit.pBrowser();

  winleft = (screen.availWidth - w)/2; // let's put it dead center on the screen
  wintop = (screen.availHeight - h)/2;

// start building string of window properties

  winprops = "height=" + h + ",width=" + w;

  // the next two lines are for positioning the window in the
  // center of the screen -- commented out by default

  if (strBr == "ns4") winprops += ",screenX=" + winleft + ",screenY=" + wintop;
  else winprops += ",left=" + winleft + ",top=" + wintop;

  winprops += ",scrollbars,resizable";
  
  if (toolbool == true) winprops += ",menubar,toolbar,location,status";

// end string of window properties

  win = window.open(url, strName, winprops);
  win.focus();
}

suitClass.prototype.pConvertWindowSize = function(strIn, strAxis) {
  var intReturn;
  strIn = strIn.toString();
  if (strIn.indexOf("%") != -1) {
    intReturn = 0.01 * parseInt(strIn.substring(0,strIn.length-1)); // converting percent string to decimal int
    if (strAxis == "width") intReturn = screen.availWidth * intReturn;
    if (strAxis == "height") intReturn = screen.availHeight * intReturn;
  }
  else intReturn = parseInt(strIn);
  return intReturn;
}

