/********************************
 * site-specific settings       *
 ********************************/

/********************************
 * site-specific functions      *
 ********************************/

var defaultSeason = 'fall';
function selectSeasonTab(season) {
    var seasons = [ 'fall', 'winter', 'spring' ];
    
    if (typeof(season) == 'undefined') season = readCookie('season');
    if (typeof(season) == 'undefined' || !season || season == 'undefined') season = defaultSeason;
    
    // first unselect all tabs
    // yuck, we need to be all-browser for this, don't we...
    for (var i = 0; i < seasons.length; i++) {
        document.getElementById('tab_' + seasons[i]).style.display = 'none';
        document.images['img_' + seasons[i]].src = '/images/interface/tab_' + seasons[i] + '.gif';
    }
    
    // select the specified tab
    document.getElementById('tab_' + season).style.display = '';
    document.images['img_' + season].src = '/images/interface/tab_' + season + '_hover.gif';
    
    writeCookie('season', season, '/');
}

function writeCookie(name, value, path, expires, domain, secure) {
    // set time, it's in milliseconds
    var now = new Date();
    now.setTime(now.getTime());
    
    // expires is measured in days from now
    if (typeof(expires) != 'undefined') expires = expires;
    var expires_date = new Date(now.getTime() + expires);
    
    document.cookie = name + "=" +escape( value ) +
    ( typeof(expires) != 'undefined' ? ";expires=" + expires_date.toGMTString() : "" ) + 
    ( typeof(path) != 'undefined' ? ";path=" + path : "" ) + 
    ( typeof(domain) != 'undefined' ? ";domain=" + domain : "" ) +
    ( typeof(secure) != 'undefined' ? ";secure" : "" );
}
