/*
                   NSS Space Ambassadors Web Site - Menu Functions

                          Written 2010 by Randall Severy
                          Copyright 2010 CyberTeams, Inc.
*/

function logout()
{
    var today = new Date();
    var expires_date = new Date(today.getTime() - 3600000);
    document.cookie = 'SpaceAmbassador=;path=/;expires=' + expires_date.toGMTString();
    document.location.href = 'index.html';
}

function get_cookie(cookie_name)
{
    if (document.cookie.length > 0) {
       cookie_start=document.cookie.indexOf(cookie_name + "=");
       if (cookie_start != -1) {
          cookie_start = cookie_start + cookie_name.length + 1;
          cookie_end = document.cookie.indexOf(";",cookie_start);
          if (cookie_end == -1) cookie_end = document.cookie.length;
          return unescape(document.cookie.substring(cookie_start,cookie_end));
       }
    }
    return "";
}

function check_cookie()
{
    if (get_cookie('SpaceAmbassador') != '') {
       var account_nav = document.getElementById('account-nav');
       account_nav.style.display = '';
    }
}


