function NewWin(URL, Name, Width, Height, Scrollbars)
{
   var Win;
    // Local variables
    var Setting = "";

    // If fetching screen dimensions possible...
    if (screen.width)
    {
        // Set X/Y pos for window to centre it
        XPos = (screen.width - Width) / 2;
        YPos = (screen.height - Height) / 2;
    }
    else
    {
        // Have new window at 0,0
        XPos = 0;
        YPos = 0;
    }

    // Create setting string based on variables calculated
    Settings = 'width=' + Width + ',height=' + Height + ',left=' + XPos + ',top=' + YPos;
    
    if (Scrollbars) {
          Settings += ',scrollbars=yes';   
    }

   // Open new window with given parameters
    Win = window.open(URL, Name, Settings);
    
    // If we can focus the window then do so!
    if(Win.window.focus)
    {
        Win.window.focus();
    }
    return Win;
}