// requires that email.js has been included, but all pages should do this anyway

function createLoginArgs()  // so these can be changed on the fly
{
    document.loginForm.action="http://www.biketouringtips.com/login.php?destination=" + loginArgs;
    return true;
}

function convertInput()
{
    if (document.loginForm.loginName.value != "" || document.loginForm.password.value != "") {
        document.loginForm.username.value = encode(document.loginForm.loginName.value);
        document.loginForm.pswd.value = encode(document.loginForm.password.value);
        return true;
    }
    else {
        return false;
    }
}
// to prevent IE from putting newlines on both sides of the search button form, I had to add all the extra <tr>s
document.write('<table width=100%>');
document.write('    <tr>');
document.write('        <td align=left rowspan=5>');
url = "http://www.biketouringtips.com/index.html?username=" + encodeURI(argumentList['username']);
document.write('            <a href="' + url + '"><img border=0 src="http://www.biketouringtips.com/website.banner.bmp"></a>');
document.write('        </td>');
document.write('    </tr><tr>');
document.write('        <td align=left valign=top class=topLogoLink>');
if (argumentList['username'] && argumentList['username'] != "" && argumentList['username'] != "undefined") {
    name = decode(argumentList['username']);
    name = name.substr(0, name.length - 4);
    document.write("Welcome, <b>" + name + "</b>");
document.write('    </td></tr><tr>');
document.write('        <td align=left valign=top class=topLogoLink>');
//    document.write('<br>');
    url = "http://www.biketouringtips.com/manageAccount.html?username=" + encodeURI(argumentList['username']);
    document.write('<a href="' + url +'" class=topLogoLink>Manage Account</a>')
}
else {
    document.write("<a href='http://www.biketouringtips.com/login.html?destination=" + loginArgs + "' class=topLogoLink>Login</a>");
document.write('    </td></tr><tr>');
document.write('        <td align=left valign=top class=topLogoLink>');
    document.write('<a href="http://www.biketouringtips.com/createRegistration.php" class=topLogoLink>Sign Up for Free</a>');
}
document.write('    </td></tr><tr>');
document.write('        <td align=left valign=top class=topLogoLink>');
document.write("<a href='javascript:m(\"topLogo\")' class=topLogoLink>Contact Ray</a>");
document.write('    </td></tr>');
document.write('</table>');
document.write('<table width=100% class=searchBGColor>');
document.write('    <tr>');
document.write('        <td align=left>');
document.write('            <a href="http://www.biketouringtips.com?username=' + argumentList['username'] + '" class=topMenuLink>Home</a>');
document.write('        </td>');
document.write('        <td align=center>');
document.write('            <span id=searchLinkSpot><a href="http://www.biketouringtips.com/rss.code/rssfeed.php" class=searchLink>What' + 
               "'" + 's New/RSS Feed</a></span>');
document.write('        </td>');
document.write('        <td align=center>');
document.write('            <span><a href="http://www.biketouringtips.com/searchMenu.php?username=' +
               argumentList['username'] + '" class=searchLink>Search Menu</a>');
document.write('        </td>');
document.write('        <td align=right>');
// javascript commands
urlPlan = "http://www.biketouringtips.com/tourPlanMainPage.php?username=" + argumentList['username'];
urlEntry = "http://www.biketouringtips.com/tipEntry.php?username=" + argumentList['username'];
urlJournal = "http://www.biketouringtips.com/login.php?loginCmd=testLogin&destination=journalEntry.php&username="  + argumentList['username'];

document.write('            <a href="' + urlPlan+ '" class=addLink>Plan a Tour</a>');
document.write("            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
document.write('            <a href="' + urlEntry + '" class=addLink>Add a Tip</a>');
document.write("            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
document.write('            <a href="' + urlJournal + '" class=addLink>Create a Journal</a>');
document.write('        </td>');
document.write('    </tr>');
document.write('</table>');


