// no auto-init < 1.2
 

// SECTIONS
var numFeatures = 10;
var numEssays = 0;


// Menu IDs for feature stories
var kSeal = 0;
var kLobster = 1;
var kSub = 2;
var kMind = 3;
var kWarm = 4;
var kSeafood = 5;
var kEarth = 6;
var kDNA = 7;
var kCancer = 8;
var kPlankton = 9;


function Seal() { return kSeal; }
function Sub() { return kSub; }
function Mind() { return kMind;}
function Seafood() { return kSeafood; }
function Earth() { return kEarth; }
function Warm() { return kWarm; }
function Lobster() { return kLobster;}
function DNA() { return kDNA; }
function Cancer() { return kCancer; }
function Plankton() { return kPlankton; }



// 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[kSeal] = new MenuItem('Listening to the Bones', 'Kendall K. Morgan', 'Elizabeth Murdoch', 'seal/index.html', 'morgan', 'murdoch');
featureMenu[kSub] = new MenuItem('Alone in the Deep', 'Kendall Powell', 'Mary Sievert', 'sub/index.html', 'powell', 'sievert');
featureMenu[kMind] = new MenuItem('Mind Meld', 'Kristin Cobb', 'Giovanni Maki', 'mind/index.html', 'cobb', 'maki');
featureMenu[kSeafood] = new MenuItem('The Seafood Dilemma', 'Genevieve Bookwalter', 'Tara Dalton', 'seafood/index.html', 'bookwalter', 'dalton');
featureMenu[kEarth] = new MenuItem('Echoes from the Core', 'Daniel Bachtold', 'Katura Reynolds', 'earth/index.html', 'bachtold', 'reynolds');
featureMenu[kWarm] = new MenuItem('A Hot Bet on Ice', 'Sean Griffing', 'Jack (John) Muir Laws', 'warm/index.html', 'griffing', 'laws');
featureMenu[kLobster] = new MenuItem('Sniff. Sniff. How Does a Lobster&#0146;s Nose Know?', 'Christian Heuss', 'Cornelia Blik', 'lobster/index.html', 'heuss', 'blik');
featureMenu[kDNA] = new MenuItem('How to Speed-Read a Gene', 'Cameron Walker', 'Alicia Calle', 'dna/index.html', 'walker', 'calle');
featureMenu[kCancer] = new MenuItem('Make <I>This </I>(and Maybe You Have a Cure for Cancer)', 'Linley Erin Hall', 'Jennifer Kane', 'cancer/index.html', 'hall', 'kane');
featureMenu[kPlankton] = new MenuItem('The Big View on Tiny Algae', 'Desiree Scorcia', 'Karina Helm', 'plankton/index.html', 'scorcia', 'helm');


// Menu IDs for essays
var kThoughts = 0;
var kWalk = 1;
var kSpecialize = 2;

function Specialize() { return kSpecialize + featureMenu.length; }
function Walk() { return kWalk + featureMenu.length; }
function Thoughts() { return kThoughts + featureMenu.length; }


var essayMenu = new Array();

// Initialize Essay menu
essayMenu[kSpecialize] = new MenuItem('Scientific Corners', 'Linley Erin Hall', ' ', 'specialize/index.html', 'hall', ' ');
essayMenu[kWalk] = new MenuItem('Into the Woods', 'Cameron Walker', ' ', 'walk/index.html', 'walker', ' ');
essayMenu[kThoughts] = new MenuItem('The Thought Collector', 'Kendall Powell', ' ', 'thoughts/index.html', 'powell', ' ');


var directoryPrefix = new Array();
directoryPrefix[0] = ''
directoryPrefix[1] = '../'
directoryPrefix[2] = '../../'
directoryPrefix[3] = '../../../'

function DisplayTitle(article) {
    document.write('<FONT SIZE="6" FACE="Impact, Verdana, Helvetica, Arial" COLOR="#880000">')
    if (article < featureMenu.length) {
	document.write(featureMenu[article].name)
	document.write('</FONT><BR><FONT SIZE="2" FACE="verdana,arial,geneva,helvetica,times" COLOR="#666666">By ')
	document.write('<A HREF="../writers.html#' + featureMenu[article].authoranchor + '">' + featureMenu[article].author.toUpperCase() + '</A>')
	document.write('<BR>ILLUSTRATIONS by ')
	document.write('<A HREF="../illustrators.html#' + featureMenu[article].illustratoranchor + '">' + featureMenu[article].illustrator.toUpperCase() + '</A>')

    } else {
	article = article - featureMenu.length
	document.write(essayMenu[article].name)
	document.write('</FONT><BR><FONT SIZE="2" FACE="verdana,arial,geneva,helvetica,times" COLOR="#666666">By ')
	document.write('<A HREF="../writers.html#' + essayMenu[article].authoranchor + '">' + essayMenu[article].author.toUpperCase() + '</A>')
    }
    document.write('</FONT>')
}

function DisplayHiLoSwitch1(article) {
}

function DisplayHiLoSwitch2(article) {
}

function DisplayNav(article, directoryDepth) {
    var navString = ''
//    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><B>features</B><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/doubleRightArrow.gif" WIDTH="10" HEIGHT="7" BORDER="0"> <B><u>' + featureMenu[i].name + '</B></U><BR>by ' + featureMenu[i].author + '</A><P>' // highlight article name
	}
	else navString += '<B><u>' + featureMenu[i].name + '</B></U><BR>by ' + featureMenu[i].author + '</A><P>'
    }
    
    navString += '<BR><B>essays</B><P>'
    for (i=0; i<essayMenu.length; i++) {
	navString += '<A HREF="' + directoryPrefix[directoryDepth] + essayMenu[i].destination + '" CLASS="navbar">'
	if (i == article - featureMenu.length) {
	    navString += '<IMG SRC="' + directoryPrefix[directoryDepth] +'images/doubleRightArrow.gif" WIDTH="10" HEIGHT="7" BORDER="0"> <B><u>' + essayMenu[i].name + '</B></U><BR>by ' + essayMenu[i].author + '</A><P>' // highlight article name
	}
	else navString += '<B><u>' + essayMenu[i].name + '</B></U><BR>by ' + essayMenu[i].author + '</A><P>'
    }
 
 

    if (article != -1) {
	navString += '<BR><A HREF="' + directoryPrefix[directoryDepth] + 'index.html" CLASS="navbar">table of contents</A><P>'
    }
    navString += '<BR><A HREF="http://scicom.ucsc.edu/" CLASS="navbar">about the UCSC Science Communication Program</A><BR><BR><BR></FONT>'
    document.write(navString)
}