// scripts for navigation links 

// two arrays hold (1) filesnames and (2) link text
// the two must be parallel in construction, and the order matters
// cannot go down into subdirectories: links will break
var linkfiles = new Array("file01", "file02", "file03", "file04", "file05");
var linktexts = new Array("academic astonishment", "culture shock", "expectations", "making friends", "being an outsider");
var linkclasses = new Array ("level2_a", "level2_b", "level2_c", "level2_d", "level2_e");


// generic tags defined here
var tr2 =  '<\/tr>\n<tr>';               // close TR, then open TR 
var tableclose = '<\/tr>\n<\/table>';    // close table; includes close TR
var tdclose =  '<\/td>';                 // generic close TD
var linkStart1 = '<a href=\"';           // beginning of A HREF tag
var linkStart1a = '<a href=\"http:\/\/projects.jou.ufl.edu\/ktrammell\/project1\/';           // beginning of A HREF tag
var linkStart2 = '.htm\">';              // end of A HREF tag
var linkEnd = '<\/a>';                   // closing /A tag
var p = '<p>';                           // open P tag
var px = '<\/p>';                        // closing /P tag
var br = '<br>';                         // BR tag

// specific tags defined here
// TABLE tag will be followed by TR
var table01 = '<table width=\"90%\" border=\"0\" cellspacing=\"0\" cellpadding=\"10\">\n<tr>';
var table02 = '<table width=\"700\" border=\"0\" align=\"center\" cellpadding=\"10\" cellspacing=\"0\">\n<tr>';
var td01a = '<td width=\"20\%\" align=\"center\" valign=\"top\" class=\"';
// insert class between 01a and 01b 
var td01b = '\">';
var td02a = '<td width=\"25\%\" align=\"center\" valign=\"top\" class=\"';
var td03a = '<td colspan=\"4\" align=\"center\" valign=\"top\" class=\"';

var downarrow = '<img src=\"images\/arrow_topdown.gif\" width=\"23\" height=\"16\">';
var uparrow = '<img src=\"images\/arrow_up.gif\" width=\"23\" height=\"16\">';

// footer tags and text

var toppage   = td02a + "toppage"   + td01b + linkStart1a + "index" + linkStart2         + "Top Page" + linkEnd + tdclose + "\n";
var reporters = td02a + "reporters" + td01b + linkStart1a + "reporterslist" + linkStart2 + "Reporters" + linkEnd + tdclose + "\n";
var subjects  = td02a + "subjects"  + td01b + linkStart1a + "subjectslist" + linkStart2  + "Students Interviewed" + linkEnd + tdclose + "\n";
var about     = td02a + "about"     + td01b + linkStart1a + "about" + linkStart2         + "About This Story" + linkEnd + tdclose + "\n";

var toppage2   = td02a + "toppage"   + td01b + linkStart1 + "index" + linkStart2         + "Top Page" + linkEnd + tdclose + "\n";
var reporters2 = td02a + "reporters" + td01b + linkStart1 + "reporterslist" + linkStart2 + "Reporters" + linkEnd + tdclose + "\n";
var subjects2  = td02a + "subjects"  + td01b + linkStart1 + "subjectslist" + linkStart2  + "Students Interviewed" + linkEnd + tdclose + "\n";
var about2     = td02a + "about"     + td01b + linkStart1 + "about" + linkStart2         + "About This Story" + linkEnd + tdclose + "\n";

var reporters3 = td02a + "reporters" + td01b + uparrow + tdclose + "\n";
var subjects3  = td02a + "subjects"  + td01b + uparrow + tdclose + "\n";
var about3     = td02a + "about"     + td01b + uparrow + tdclose + "\n";

var ident     = "Web site created by students in Reporting and Writing for Online Media, a course in the College of Journalism and Communications at the University of Florida, in Fall 2003.";
ident         = ident + "<br>All writing copyright \&copy\; 2003 by the individual authors. <BR>Design and site structure copyright \&copy\; 2003 by Mindy McAdams & Kaye Trammell";
var identcell = td03a + "footertext" + td01b + ident + tdclose + "\n";

// -------------------------------------------------------
// here's the stuff that generates the code for the navigation links
// call the function on the page at the spot where the list of links should appear
var navlist = "";
// the function called on the page is writeNav: 
function writeNav(docFilename)  {
   if (docFilename == "lev3") {
      linkStart1 = linkStart1a;
   }
   for (i = 0; i < linkfiles.length; i++) {  // linkfiles is the array, at top
      if (linkfiles[i] == docFilename) { 
         navlist = navlist + td01a + linkclasses[i] + td01b + downarrow + tdclose + '\n';
      } else {
         navlist = navlist + td01a + linkclasses[i] + td01b + linkStart1 + linkfiles[i] + linkStart2 + linktexts[i] + linkEnd + tdclose + '\n';
      }
   }
   document.write(navlist);
} 
// -------------------------------------------------------
// here's the stuff that generates the code for the footer table
// call the function on the page at the spot where the list of links should appear
var footertable = "";
// the function called on the page is writeFooter: 
function writeFooter(docFilename)  {
   if (docFilename == "lev3") {
	   footertable = table02 + toppage + subjects + reporters + about + tr2 + identcell + tableclose;
   } else if (docFilename == "about") {
	   footertable = table02 + toppage2 + subjects2 + reporters2 + about3 + tr2 + identcell + tableclose;
   } else if (docFilename == "rep") {
	   footertable = table02 + toppage2 + subjects2 + reporters3 + about2 + tr2 + identcell + tableclose;
   } else if (docFilename == "sub") {
	   footertable = table02 + toppage2 + subjects3 + reporters2 + about2 + tr2 + identcell + tableclose;
   } else {
	   footertable = table02 + toppage2 + subjects2 + reporters2 + about2 + tr2 + identcell + tableclose;
   }
   document.write(footertable);
} 

// -------------------------------------------------------


// this was created by Mindy McAdams for the Fall 2002 class & used by Kaye Trammell for the Fall 2003 class
// end of script page
