/**
 * Set the mode for the home page in a long-living cookie
 *
 * @var string mode [boating|fishing|default]
 */
function setHomeMode(mode) {
    
    // mode selectors are a toggle, so selecting the current
    // home mode will unset it back to default
    if (mode == getHomeMode()) {
        // remove cookie
        eraseCookie('homeMode');
        return;
    }
    
    createCookie('homeMode',mode,365);
}

/**
 * Get the mode for the home page
 *
 * @return string mode [boating|fishing|default]
 */
function getHomeMode() {
    var homeMode = readCookie('homeMode');
    return homeMode ? homeMode : 'default';
}

/**
 * Sets the state (of the United States) that the user is
 * in (based on GeoIP), or has selected as their default state
 */
function setHomeState(state) {
    createCookie('userState', state, 365);
}

/**
 * Get the user's current state (of the United States)
 *
 * @return string|false state
 */
function getHomeState() {
    var userState = readCookie('userState');
    return userState ? userState : false;
}

