function openNewWindow(fileName,windowName,theWidth,theHeight,theScrollBar,resizable,location,status,menubar,toolbar) {
    if (windowName == "newMessageWindow")  {
      //generate random window ID
      windowName = new String(Math.round(Math.random() * 100000));
    }
    if (theScrollBar != 1) theScrollBar = 0;
    if (resizable != 1) resizable = 0;
    if (location != 1) location = 0;
    if (status != 1) status = 0;
    if (menubar != 1) menubar = 0;
    if (toolbar != 1) toolbar = 0;
    window.open(fileName,windowName,"toolbar="+toolbar+",location="+location+",directories=0,status="+status+",menubar="+menubar+",scrollbars="+theScrollBar+",resizable="+resizable+",width="+theWidth+",height="+theHeight)
}


