/* File Name: navbar.js
 * Description: Methods to create the navigation bar.   
 * Created: 03-20-2003    SGraffuis
 * Modifications:
 */

/* Method Name: printNavBar
 * Description: Print the html for the navigation bar based 
 *              on the parameter received.   
 * Created: Date 03-20-2003    SGraffuis;
 * Modifications:
 */
var topPath = "top";
var albumPath = "albums/";
var albumXPath = "albums/X";
var imagePath = "images/"
var album=""

function printNavBar(location)
{
    setPaths(location);
    //document.write(topPath);
    //document.write(albumPath);
    //document.write(imagePath);
    
    document.write("<td class=\"nav_bar_top\"><img src=\""+ imagePath + "fern.gif\">");
    document.write("  <table class=\"nav_bar\">");
    document.write("      <tr><td class=\"nav_bar\"><a class=\"nav_bar\" href=\"" + topPath + "index.html\"><img src=\""+ imagePath + "grsites_com/button_home.jpg\" alt=\"Home\"></a></td></tr>");
    ///if (topPath == "") {
        printMainBar();
    ///} else {
        ///printAlbumBar();
    ///} 
    document.write("  </table>");
    document.write("</td>");

}

function setPaths(location)
{
    if (location == topPath) {
        topPath="";
        return;
    } else {
        topPath = "";
    }
    
    if (location == albumPath){
        var relLoc = "../";
        albumPath = "";
        topPath = relLoc + topPath;    
        imagePath = relLoc + imagePath;
    } else if (location == albumXPath){
        var relLoc = "../../";
        albumXPath = "";
        albumPath = "../";
        topPath = relLoc + topPath;    
        imagePath = relLoc + imagePath;
    } else {
        var relLoc = location;
        albumXPath = "";
        albumPath = "../";
        topPath = relLoc + topPath;    
        imagePath = relLoc + imagePath;
        album=location;
    }
 
}

function printMainBar(){
    
    /* JAVA HELP */
    document.write("<tr><td class=\"nav_bar\"><a class=\"nav_bar\" href=\"/java_info.html\"><img src=\"" + imagePath + "grsites_com/button_java.jpg\" alt=\"Java Help\"/></a></td></tr>");
    
    /* HTML HELP */
    document.write("<tr><td class=\"nav_bar\"><a class=\"nav_bar\" href=\"/html_info.html\"><img src=\"" + imagePath + "grsites_com/button_html.jpg\" alt=\"HTML Help\"/></a></td></tr>");
}

function printPages(numPages)
{
    var i;
    //document.write("<ul>");
    for(i=1; i<=numPages;i++){
      if (i<10) {
        page="0" + i;
      }
      document.write("<br /><a class=\"nav_bar\" href=\"" + albumPath + album + "/" + "page_" + page +".html\">Page " + i + "</a>");
    }
    //document.write("</ul>");
}


