// no auto-init < 1.2
 

// SECTIONS
var numFeatures = 10;
var numEssays = 0;


// Menu IDs for feature stories
var kAbalone = 0;
var kCreative = 2;
var kFish = 3;
var kMotion = 4;
var kOrigin = 5;
var kOwl = 6;
var kSpider = 7;
var kStars = 1;
var kSun = 8;
var kWarm = 9;


function Abalone() { return kAbalone; }
function Creative() { return kCreative; }
function Fish() { return kFish;}
function Motion() { return kMotion; }
function Origin() { return kOrigin; }
function Owl() { return kOwl;}
function Spider() { return kSpider; }
function Stars() { return kStars; }
function Sun() { return kSun; }
function Warm() { return kWarm; }



// Menu IDs for bookkeeping links
var kContents = 0;
var kAboutSciCom = 1;

function Contents() { return kContents; }
function AboutSciCom() { return kAboutSciCom; }



var kStop = -1;
function Stop() { return kStop; }

function MenuItem(name, author, illustrator, destination, authoranchor, illustratoranchor) {
     this.name = name;
     this.author = author;
     this.illustrator = illustrator;
     this.destination = destination;
     this.authoranchor = authoranchor;
     this.illustratoranchor = illustratoranchor;
}

var featureMenu = new Array();

// Initialize Feature menu
featureMenu[kAbalone] = new MenuItem('Battered to Extinction (Also Steamed, Stir Fried, and Eaten Raw)', 'Helen Fields', 'Rachel Rogge', 'abalone/index.html', 'fields', 'rogge');
featureMenu[kCreative] = new MenuItem('The Creativity Conundrum', 'Greta Lorge', 'Chris Field', 'creative/index.html', 'lorge', 'field');
featureMenu[kFish] = new MenuItem('Fish Tales', 'Nicole Stricker', 'Andrew Recher', 'fish/index.html', 'strickeer', 'recger');
featureMenu[kMotion] = new MenuItem('Mind Over Stomach', 'Emily Singer', 'Katherine Rizzo', 'motion/index.html', 'singer', 'rizzo');
featureMenu[kOrigin] = new MenuItem('Recipe for Life', 'Shawna Williams', 'Nicolle Rager', 'origin/index.html', 'williams', 'rager');
featureMenu[kOwl] = new MenuItem('Teaching an Old Owl New Tricks', 'Rachel Ehrenberg', 'Lucy Reading', 'owl/index.html', 'ehrenberg', 'reading');
featureMenu[kSpider] = new MenuItem('Along Came a Spider', 'Kate Ramsayer', 'Evan Barbour', 'spider/index.html', 'ramsayer', 'barbour');
featureMenu[kStars] = new MenuItem('The Light of Dr. Jean Brodie', 'Ernie Tretkoff', 'Nadia Strasser', 'stars/index.html', 'tretkoff', 'strasser');
featureMenu[kSun] = new MenuItem('Eye on the Sun', 'Jyllian Kemsley', 'Megan O&#0146;Dea', 'sun/index.html', 'kemsley', 'odea');
featureMenu[kWarm] = new MenuItem('Global Fever', 'Elisabeth Nadin', 'Holly Gray', 'warm/index.html', 'nadin', 'gray');


var directoryPrefix = new Array();
directoryPrefix[0] = ''
directoryPrefix[1] = '../'
directoryPrefix[2] = '../../'
directoryPrefix[3] = '../../../'

function DisplayTitle(article) {
    document.write(featureMenu[article].name)
}

function DisplayHeadline(article, directoryDepth) {
    document.write('<BR><IMG SRC="' + directoryPrefix[directoryDepth] +'images/spacer.gif" width="400" height="7"><BR>')
    document.write('<span class="headline">')
    document.write(featureMenu[article].name)
    document.write('</span>')
    document.write('<BR><IMG SRC="' + directoryPrefix[directoryDepth] +'images/spacer.gif" width="400" height="7"><BR>')
    document.write('<span class="byline">by ')

    // to change to links, change NAME to HREF
    document.write('<A CLASS="byline" NAME="../writers.html#' + featureMenu[article].authoranchor + '">' + featureMenu[article].author + '</A>')
    document.write('<BR>Illustration by ')
    document.write('<A CLASS="byline" NAME="../illustrators.html#' + featureMenu[article].illustratoranchor + '">' + featureMenu[article].illustrator + '</A>')
    document.write('<br><BR></span>')
}

function DisplayNav(article, directoryDepth) {
    var navString = ''
    var dividerString = ''
    if (article == -1) {
        dividerString = ' / illustrated by '
    }
    else {
        dividerString = '<BR>art:&nbsp;'
    }
//    navString += '<FONT FACE="verdana, geneva, helvetica" SIZE="1" COLOR="#990000">'
    
    document.write('<FONT COLOR="#AAAAAA" FACE="verdana,geneva,arial,helvetica" SIZE="1"><BR> <FONT COLOR="996633"><B>IN THIS ISSUE</B></FONT><P>')
    for (var i=0; i<featureMenu.length; i++) {
	navString += '<A HREF="' + directoryPrefix[directoryDepth] + featureMenu[i].destination + '" CLASS="navbar">'
	if (i == article) {
	    navString += '<IMG SRC="' + directoryPrefix[directoryDepth] +'images/redRightArrow.gif" WIDTH="8" HEIGHT="8" BORDER="0"> <B><u>' + featureMenu[i].name + '</B></U><BR>by ' + featureMenu[i].author + dividerString + featureMenu[i].illustrator + '</A><P>' // highlight article name
	}
	else navString += '<B><u>' + featureMenu[i].name + '</B></U><BR>by ' + featureMenu[i].author + dividerString + featureMenu[i].illustrator + '</A><P>'
    }
    

 

//    if (article != -1) {
//	navString += '<BR><A HREF="' + directoryPrefix[directoryDepth] + 'index.html" CLASS="navbar">table of contents</A><P>'
//    }
    if (article != -1) {
         navString += '<BR><A HREF="http://scicom.ucsc.edu/" CLASS="navbar">about the UCSC Science Communication Program</A><BR><BR><BR></FONT>'
    }
    document.write(navString)
}