
/*******************************************************************************
 *                                                                             *
 * evans easynet - utility 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 addBookmark(title, url)
{
    if (window.sidebar)
    {
        // firefox
        window.sidebar.addPanel(title, url, "");
    }
    else if ( document.all )
    {
        // MSIE
        window.external.AddFavorite( url, title);
    }
    else
    {
        alert("Sorry, your browser doesn't support this.");
    }
}

function generatePassword(maxLength)
{
    var chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    var password = "";
    if (maxLength == "")
    {
        maxLength  == 6;
    }
    for (var i = 0; i < maxLength; i++)
    {
        password += chars.charAt(chars.length * Math.random());
    }
    return password;
}
