//------------------------------------------------------------------------------
//     Function: popup
//  Description: Creates a pop-up window with a given url, width, height, and
//               optional window name. This function makes it simpler to create
//               pop-up windows, as the long string of window properties is not
//               required.
//------------------------------------------------------------------------------
function popup(url, width, height, name)
{
    var newwin;
    if (arguments.length == 3)
        newwin = window.open(url, "popup", "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,location=no,menubar=no,status=no,toolbar=no");
    else if (arguments.length == 4)
        newwin = window.open(url, name, "width=" + width + ",height=" + height + ",resizable=yes,scrollbars=yes,location=no,menubar=no,status=no,toolbar=no");
    newwin.focus();
    
    return newwin;
}
