
/*******************************************************************************
 *                                                                             *
 * m2r - utility javascript functions                                          *
 *                                                                             *
 *******************************************************************************/

function openWin(strFile, strName, intWidth, intHeight)
{
    // opens popup window
    var strProperties = 'toolbar=no,width=' + Math.round(intWidth) + ',height=' + Math.round(intHeight) + ',left=30,top=150,' + 'status=no,scrollbars=yes,resizable=yes,menubar=no';
    tmpWin = window.open(strFile,strName,strProperties);
    tmpWin.focus();
}

function appendHTTP(url)
{
    // appends http:// to url is not already present
    var re = /^http:\/\//i;
    if (!url.match(re))
    {
        url = "http://" + url;
    }
    return url;
}