function logout(form, forward) {
    document.cookie = "auth=; path=/; expires=-1";
    window.location = (typeof forward == "undefined") ? "/" : forward;
}

function truncate(str, length) {
    return (str.length <= length) ? str : str.substr(0, length) + ". . .";
}

function clearTB(id) {
    document.getElementById(id).value = "";
}