/* ================================================================================================
  "SurvivalGuide.js" - JavaScript functions for Wadsworth Philosophy site "Student Survival Guide" 
                       module
  (c)2004 Wadsworth Publishing - all rights reserved
================================================================================================= */

/*==============================================--=============================================NOTES
General Description
  Each page of this module consists of a 
  ..top logo
  ..next row is graphic and global navigation (pages available on all pages)
  ..next row is nav Path - ie a horizontal list of branches back to SSG home page
  ..body with specific content

Architecture
  top logo, global nav, and nav path are generated by javascript
  this allows top of page to be generated by single js file; allowing for global changes without 
    re-writing all pages
  this also means that debugging is more complex because html code is generated by javascript and 
    hence not displayed in view source
  information for generating nav path is carried from page to page in the window.name property
  ..going forward to link
  ....globalNavBranchHOME()                     //branch from home page to global page
  ....globalNavBranch()                         //branch from sub page to global page
  ....navToContentLink()
  ..click on top nav path(display of path back to main)
  ....navToNavPathLink()
  ......goes to page selected from link on nav path
  ......generates shorted nav path for revisited page being opened
  
  when page is loaded the name is parsed

Click on top global nav btn from any page
..calls globalNavBranchHOME() -or- globalNavBranch() the difference being the path to the target 
  page 
..passes the id for the button/link selected

..globalNavBranchHOME()/globalNavBranch()
....sets links page to selected page in global menu (in same window)
....specifically sets the window name

....as page loads,
......the JavaScript function 'genTopGlobalNav()' generates the top navigation section
........the parameter passed flags greyed out global link for the page currently shown
......the JavaScript function 'displNavPath()' 
........the code parses the window name to set up a 'nav path' which is the html code for links to
        the pages sequentially visisted starting with the main page (Student Survival Guide)
........there is a call to genPathLink()
..........this compares the name given to the link and assigns parameters for navToNavPathLink()
..........HERE ALL PAGES THAT LINK TO OTHER PAGES MUST BE LISTED

..Selecting link to page while in any page derived from main
....calls navToNavPathLink()
......sets url(which was passed as parameter) to next page
......appends name of next page (which was passed as parameter) to window.name 
......note that window.name is not a peristant property and must be set AFTER 
      window.location.href is set each time a new page is loaded
      
..Selecting link in the top nav path
....calls navToNavPathLink()
......goes to page selected from link on nav path (url filename is passes as parameter)
......generates shorted nav path for revisited page being opened (compares link name passed as 
      parameter to the current window name to create the shortened version for the page being 
      opened)
......
================================================--================================================*/


//==============================================--==================================================
//==============================================--==================================GLOBAL VARIABLES
//==============================================--==================================================
//==============================================--==================================================



//==============================================--==================================================
//==============================================--=========================================FUNCTIONS
//==============================================--==================================================

//globalNavBranchHOME()===========================--================================================
//responds to click on global navigation links when in HOME page
//branches to one of html page that are selected from global navigation links
//.."PhilosophyProfessors.htm"
//.."PhilosophyStudyTips.htm"
//.."IntrinsicValueOfPhilosophy.htm"
//.."PhilosophyMajorOrMinor.htm"
//.."GraduateStudiesInPhilosophy.htm"
//.."ClubsAndOtherStuff.htm"
//.."StudentResourceCenter.htm"
//preconditon: 
//..click on teapot Global Nav buttons or Global Nav Text
//..currently in  Survival Guide home page("StudentSurvivalGuide.htm")
//parameter: "p_strNavID" - id of <img> or <a> tag
//==============================================--==================================================
function globalNavBranchHOME(p_strNavID)
{
  switch(p_strNavID)
  {
    case "btnImg_Prof":
      window.location.href="StudentSurvivalHTMLfiles/PhilosophyProfessors.htm";
      window.name = "Survival Guide Home" + "|" + "Your Professor";
      break;
    case "btnImg_StudyTips":
      window.location.href="StudentSurvivalHTMLfiles/PhilosophyStudyTips.htm";
      window.name = "Survival Guide Home" + "|" + "Study Tips";
      break;
    case "btnImg_Value":
      window.location.href="StudentSurvivalHTMLfiles/IntrinsicValue.htm"
      window.name = "Survival Guide Home" + "|" + "Intrinsic Value";
      break;
    case "btnImg_MajorOr":
      window.location.href="StudentSurvivalHTMLfiles/MajorOrMinor.htm"
      window.name = "Survival Guide Home" + "|" + "Major Or Minor";
      break;
    case "btnImg_Graduate":
      window.location.href="StudentSurvivalHTMLfiles/GraduateStudies.htm";
      window.name = "Survival Guide Home" + "|" + "Graduate Studies";
      break;
    case "btnImg_Clubs":
      window.location.href="StudentSurvivalHTMLfiles/ClubsAndOtherStuff.htm";
      window.name = "Survival Guide Home" + "|" + "Clubs And Other Stuff";
      break;
    case "btnImg_Resources":
      window.location.href="StudentSurvivalHTMLfiles/StudentResourceCenter.htm";
      window.name = "Survival Guide Home" + "|" + "Student Resource Center";
      break;

                                                //clicks on Nav Text
    case "btnText_Prof":
      window.location.href="StudentSurvivalHTMLfiles/PhilosophyProfessors.htm";
      window.name = "Survival Guide Home" + "|" + "Your Professor";
      break;
    case "btnText_StudyTips":
      window.location.href="StudentSurvivalHTMLfiles/PhilosophyStudyTips.htm";
      window.name = "Survival Guide Home" + "|" + "Study Tips";
      break;
    case "btnText_Value":
      window.location.href="StudentSurvivalHTMLfiles/IntrinsicValue.htm"
      window.name = "Survival Guide Home" + "|" + "Intrinsic Value";
      break;
    case "btnText_MajorOr":
      window.location.href="StudentSurvivalHTMLfiles/MajorOrMinor.htm"
      window.name = "Survival Guide Home" + "|" + "Major Or Minor";
      break;
    case "btnText_Graduate":
      window.location.href="StudentSurvivalHTMLfiles/GraduateStudies.htm";
      window.name = "Survival Guide Home" + "|" + "Graduate Studies";
      break;
    case "btnText_Clubs":
      window.location.href="StudentSurvivalHTMLfiles/ClubsAndOtherStuff.htm";
      window.name = "Survival Guide Home" + "|" + "Clubs And Other Stuff";
      break;
    case "btnText_Resources":
      window.location.href="StudentSurvivalHTMLfiles/StudentResourceCenter.htm";
      window.name = "Survival Guide Home" + "|" + "Student Resource Center";
      break;
    
    default:
      alert("ERROR: code error in global nav selection(" + p_strNavID + ")");
  }
}
//end globalNavBranchHOME()=========================--==============================================

//globalNavBranch()=================================--==============================================
//responds to click on global navigation links when in sub directory page
//branches to global html page
//.."PhilosophyProfessors.htm"
//.."PhilosophyStudyTips.htm"
//.."IntrinsicValueOfPhilosophy.htm"
//.."PhilosophyMajorOrMinor.htm"
//.."GraduateStudiesInPhilosophy.htm"
//.."ClubsAndOtherStuff.htm"
//.."StudentResourceCenter.htm"
//Navigation branches
//..back
//..home (../"StudentSurvivalGuide.htm")
//..forward
//preconditon: 
//..click on teapot Global Nav buttons or Global Nav Text
//..currently in sub directory below Survival Guide home page("StudentSurvivalGuide.htm")
//parameter: "p_strNavID" - id of <img> or <a> tag
//==============================================--==================================================
function globalNavBranch(p_strNavID)
{
//*** alert("in globalNavBranch() - p_strNavID: " + p_strNavID); //***debug  
  switch(p_strNavID)
  {
                                                //clicks on Teapot buttons
    case "btnImg_Prof":
      window.location.href="PhilosophyProfessors.htm";
      window.name = "Survival Guide Home" + "|" + "Your Professor";
      break;
    case "btnImg_StudyTips":
      window.location.href="PhilosophyStudyTips.htm";
      window.name = "Survival Guide Home" + "|" + "Study Tips";
      break;
    case "btnImg_Value":
      window.location.href="IntrinsicValue.htm";
      window.name = "Survival Guide Home" + "|" + "Intrinsic Value";
      break;
    case "btnImg_MajorOr":
      window.location.href="MajorOrMinor.htm"
      window.name = "Survival Guide Home" + "|" + "Major Or Minor";
      break;
    case "btnImg_Graduate":
      window.location.href="GraduateStudies.htm";
      window.name = "Survival Guide Home" + "|" + "Graduate Studies";
      break;
    case "btnImg_Clubs":
      window.location.href="ClubsAndOtherStuff.htm";
      window.name = "Survival Guide Home" + "|" + "Clubs And Other Stuff";
      break;
    case "btnImg_Resources":
      window.location.href="StudentResourceCenter.htm";
      window.name = "Survival Guide Home" + "|" + "Student Resource Center";
      break;
                                                //clicks on Nav Text
    case "btnText_Prof":
      window.location.href="PhilosophyProfessors.htm";
      window.name = "Survival Guide Home" + "|" + "Your Professor";
      break;
    case "btnText_StudyTips":
      window.location.href="PhilosophyStudyTips.htm";
      window.name = "Survival Guide Home" + "|" + "Study Tips";
      break;
    case "btnText_Value":
      window.location.href="IntrinsicValue.htm";
      window.name = "Survival Guide Home" + "|" + "Intrinsic Value";
      break;
    case "btnText_MajorOr":
      window.location.href="MajorOrMinor.htm"
      window.name = "Survival Guide Home" + "|" + "Major Or Minor";
      break;
    case "btnText_Graduate":
      window.location.href="GraduateStudies.htm";
      window.name = "Survival Guide Home" + "|" + "Graduate Studies";
      break;
    case "btnText_Clubs":
      window.location.href="ClubsAndOtherStuff.htm";
      window.name = "Survival Guide Home" + "|" + "Clubs And Other Stuff";
      break;
    case "btnText_Resources":
      window.location.href="StudentResourceCenter.htm";
      window.name = "Survival Guide Home" + "|" + "Student Resource Center";
      break;
      
                                                //forward-home-back navigation
/* ***
    case "btnImg_Back":
      window.history.back(); //***dev
      break;
    case "btnImg_Home":
      window.location.href="../StudentSurvivalGuide.htm";
      break;
    case "btnImg_Forward":
      window.history.forward();
      break;
*** */    
    default:
      alert("ERROR: code error in global nav selection(" + p_strNavID + ")");
  }
}
//end globalNavBranch()=========================--==================================================

//navToContentLink()============================--==================================================
//appends the new page name to the Window.name property
//navigates to next page in Survival Guide site 
//..NOT outside URL which opens in separate window
//..this is link in body content going to subsequent page in site
//note: window name is not persistant property and must be set when new next url opened in same 
//      window.  property must be set after the window.open() method
//called from onClick event of <a> link tag in sub pages
//..<a href="#" onClick="navToContentLink('Type of School', 'TypeOfSchool.htm')">Type Of School</a>
//prameters
//..p_strNextLinkName - name displayed for link (eg "Type Of School")
//..p_strNextSSG_URL - file name of next url (eg "TypeOfSchool.htm")
//==============================================--==================================================
function navToContentLink(p_strNextLinkName, p_strNextSSG_URL)
{
  var l_str = window.name;
//***alert("in  navToContentLink() - p_strNextSSG_URL: " + p_strNextSSG_URL); //***debug

  l_str += "|" + p_strNextLinkName;
  window.location.href = p_strNextSSG_URL
//*** alert("in  navToContentLink() - l_str: " + l_str); //***debug
  window.name = l_str;

  return; //<<<
}
//end navToContentLink()========================--==================================================

//pageInit()====================================--==================================================
//Initialize common page properties when loading 
//called from onLoad event
//preconditon:
//..page in sub directory 
//==============================================--==================================================
function pageInit()
{  
  return;
}
//end pageInit()================================--==================================================

//openSSGmain()=================================--==================================================
//opens page in separate window
//..no chrome
//..760w x 510w
//==============================================--==================================================
function openSSGmain(p_strURL, p_strWinName) 
{
  window.open(p_strURL,p_strWinName,"height=543,width=775,scrollbars=yes, toolbar=no, " +  
                                    "directories=no, menubar=no");
}
//end openSSGmain()=============================--==================================================

//openNewWinURL()===============================--==================================================
//opens URL in new window with all browser chrome and features
//used for opeining links to URLs outside of Wadsworth Student Survival Guide area
//==============================================--==================================================
function openNewWinURL(p_strURL)
{
  window.open(p_strURL,"","height=600,width=800,toolbar=yes, location=yes, " +  
                                    "directories=yes, status=yes, menubar=yes, scrollbars=yes, " + 
                                    "resizable=yes");
}
//end openNewWinURL()===========================--==================================================

//displNavPath()================================--==================================================
//generates nav path html segment
//writes it into document
//called from <script> tag in body
//preconditions:
//..path string delimited by "|" (eg "Survival Guide Main|YourProfessor")
//==============================================--==================================================
function displNavPath()
{
  var l_intStartNdx = 0;                        //char loc of start of current sub string
  var l_intEndNdx;                              //char loc of last letter of sub string
 
                                                //write out padding for start of path strings
  document.write("    <tr bgcolor=\"ffeeef\"> \n");
  document.write("      <td> \n");

  document.write("<img src=\"../StudentSurvivalGuideFiles/PinkDot.gif\" width=\"10px\" " + 
                       "height=\"1px\" border=\"0px\"></img>");


  //*** alert ("(in displNavPath()) - Nav Path: " + window.name); //***dev
  l_intEndNdx = window.name.indexOf("|");
  while ( l_intEndNdx != -1)
  {
    genPathLink(window.name.substring(l_intStartNdx, l_intEndNdx)); //writes out <a> link in html
    l_intStartNdx = l_intEndNdx + 1;
    l_intEndNdx = window.name.indexOf("|", l_intStartNdx);
    document.write("<font class=pathNav >|</font>&nbsp;");
  }
  
                                                //generate html for name of current page
  genInactiveLink(window.name.substring(l_intStartNdx, window.name.length));

  document.write("      </td> \n");
  document.write("    </tr> \n");
}
//end displNavPath()============================--==================================================

//genPathLink()=================================--==================================================
//generates <a> tag document html for link passed as parameter
//called from <script> --> displNavPath() --> genPathLink()
//links will be implemented by javaScript call to (not by href)
//preconditions
//..need to define links for pages that link to further pages (pages that are end nodes do not need 
//  to be defined
//..parameter is one of specified strings
//..calls generate html for pages in "StudentSurvivalHTMLfiles" directory
//==============================================--==================================================
function genPathLink(p_strLinkName)
{
  //<a href="../StudentSurvivalGuide.htm"><font class=pathNav >Survival Guide Home</font></a>&nbsp;

                                                //generate call to navToNavPathLink('someURL')
                                                //<a href="#" onClick="navToNavPathLink('someURL',
                                                //  'someLinkName);">someLinkName</a>
                                                //  this will be the link object
  l_strLink = "<a href=\"#\" onClick=\"navToNavPathLink('";  

  switch(p_strLinkName)
  {
    case ("Survival Guide Home"):
      l_strLink += "../StudentSurvivalGuide.htm";
      break;
    case ("Your Professor"):
      l_strLink += "PhilosophyProfessors.htm";
      break;
    case ("Type of School"):
      l_strLink += "TypeOfSchool.htm";
      break;
    case ("T.A. or Professor?"):
      l_strLink += "TAorProfessor.htm";
      break;
    case ("Type of Professor"):
      l_strLink += "TypesOfProfessors.htm";
      break;
    case ("Education"):
      l_strLink += "Education.htm";
      break;
    case ("Professors"):
      l_strLink += "Professors.htm";
      break;
    case ("Graduate Study in Philosophy"):
      l_strLink += "GraduateStudies.htm";
      break;
    case ("Study Tips"):
      l_strLink += "PhilosophyStudyTips.htm";
      break;
    case ("Who is Your Professor?"):
      l_strLink += "PhilosophyProfessors.htm";
      break;
    case ("Intrinsic Value"):
      l_strLink += "IntrinsicValue.htm";
      break;
    case ("Instrumental Value"):
      l_strLink += "InstrumentalValue.htm";
      break;
    case ("Jobs for Philosophers"):
      l_strLink += "JobsForPhilosophyMajors.htm";
      break;
    case ("Major Or Minor"):
      l_strLink += "MajorOrMinor.htm";
      break;
    case ("Graduate Studies"):
      l_strLink += "GraduateStudies.htm";
      break;
    case ("Graduate Degrees In Philosophy"):
      l_strLink += "GraduateDegreesInPhilosophy.htm";
      break;
    case ("Clubs And Other Stuff"):
      l_strLink += "ClubsAndOtherStuff.htm";
      break;
    case ("Student Resource Center"):
      l_strLink += "StudentResourceCenter.htm";
      break;
			
			
//***here - develop nav path links


  
    case ("x"):
      l_strLink += "x.htm";
      break;
      
    default:
      l_strLink = "xx');\"></a>";               //write dummy link - ie <a href="#"></a>
      document.write(l_strLink);
      alert("Error in genPathLink() parameter [" + p_strLinkName + "]");
      return; //<<< aborted return
  }
  
  l_strLink += "', '" + p_strLinkName + "');\"><font class=pathNav >" + p_strLinkName + 
               "</font></a>&nbsp;";
  //***alert(l_strLink); //***debug
  document.write(l_strLink);
  
  return; //<<< normal return
}
//end genPathLink()=============================--==================================================


//genTopGlobalNav()=============================--==================================================
//generate html code for top Thompson logo, cat gfx, Survival font heading and global nav btns
//called from <script> tag in pages that have branched from main page 
//preconditions
//..page generated as sub page to main (in  "StudentSurvivalHTMLfiles" directory))
//..parameter "p_strPageID" identifies page so that 
//==============================================--==================================================
function genTopGlobalNav(p_strPageID)
{
  var l_str = "";                                //html string to be written 
  
  //.....................................................overall page dimensions 760w x 510h
                                                 //logo row
  l_str += "    <tr><td> \n";
  l_str += "      <table width=\"760\" height=\"49\" bgcolor=\"#003090\" border=\"2\" \n";
  l_str += "             background=\"../StudentSurvivalGuideFiles/SSGbanner_bg.gif\"> \n";
  l_str += "        <tr> \n";
  l_str += "          <td><img src=\"../StudentSurvivalGuideFiles/logo_wads.gif\" ></img></td> \n";
  l_str += "        </tr> \n";
  l_str += "      </table> \n";
  l_str += "    </td></tr> \n";
                                                 //<!-- end logo row
        
                                                 //CAT GFX AND TOP NAV-->
  //  | cat 108px | Stu... title 208px | button links 444px(total) 444/7 == 63px ea(63.4..
  l_str += "    <tr><td> \n";
        
  l_str += "      <table width=\"760\" height=\"80\" bgcolor=\"#FFEEEF\" border=\"0\" align=\"left\" \n";
  l_str += "             cellspacing=\"0\" cellpadding=\"0\" \n";
  l_str += "             style=\"background:url(../StudentSurvivalGuideFiles/treeBranch_crop.gif); \n";
  l_str += "             background-repeat: no-repeat; background-position: top, right \" >  \n";
                                                     
  l_str += "        <tr>  \n";
  l_str += "          <td width=\"108\">  \n";
  l_str += "            <img src=\"../StudentSurvivalGuideFiles/CatInTreeSSG_50Res.jpg\"   \n";
  l_str += "                 width=\"108 \"height=\"80\"></img>  \n";
  l_str += "          </td>  \n";
  l_str += "          <td>  \n";
  l_str += "              <img src=\"../StudentSurvivalGuideFiles/SSG_title_comp_16c.gif\"  \n";
  l_str += "                   width=\"208\" height=\"18\"></img>  \n";
  l_str += "          </td>   \n";
        
  //................................................GLOBAL NAV BTNS
                                              
  l_str += getNavBtnHTML(p_strPageID, "profs");   //Your Professor btn
  l_str += getNavBtnHTML(p_strPageID, "study");   //Study Tips btn
  l_str += getNavBtnHTML(p_strPageID, "value");   //Intrinsic Value btn
  l_str += getNavBtnHTML(p_strPageID, "major");   //Major Or Minor btn
  l_str += getNavBtnHTML(p_strPageID, "gradu");   //Graduate Studies btn
  l_str += getNavBtnHTML(p_strPageID, "clubs");   //Clubs and Other Stuff btn
  l_str += getNavBtnHTML(p_strPageID, "resrc");   //Student Resources btn
            
            
  l_str += "        </tr>  \n";
  l_str += "      </table>  \n";
  l_str += "    </td></tr>  \n";
  
  document.write(l_str);
  return;
}
//end genTopGlobalNav()=========================--==================================================


//end getNavBtnHTML()===============================--==================================================
//return html code for single global nav button as string
//preconditions:
//..called from genTopGlobalNav()
//..applies to pages in "StudentSurvivalHTMLfiles" directory (ie pages subsequent to main)
//..parameter:
//...."p_strGLobalLinkName" identifies global nav link being generated
//...."p_strCurrLinkName" identifies the current page
//postcondition
//..string generated for global nav btn teapot gfx and text
//..if current page is one of global pages, then link is shown inactive
//  for example if on the "Your Professor" page, then the global link to "Your Professor" will be 
//  inactive
//==============================================--==================================================
function getNavBtnHTML(p_strCurrLinkName, p_strGLobalLinkName)
{
  var l_str = " \n";                            //string being generated
  var l_strLinkName = " \n";                    //test name displayed for link button
                                                //parameters for calls to globalNavBranch()
  var l_strBtnID = " \n";                       //..id of teapot button 
  var l_strTextID = " \n";                      //..id of text link
  var l_bBtnState = true;                       //state of link - active if true
  
  if (p_strCurrLinkName == p_strGLobalLinkName) //if currently in one of global pages
  {
    l_bBtnState = false;
  }
                             
  switch(p_strGLobalLinkName)                   //vars for this global link
  {
    case "profs":
      l_strLinkName = "Your Professor";
      l_strBtnID = "btnImg_Prof";
      l_strTextID = "btnText_Prof";
      break;
    case "study":
      l_strLinkName = "Study Tips";
      l_strBtnID = "btnImg_StudyTips";
      l_strTextID = "btnText_StudyTips";
      break;
    case "value":
      l_strLinkName = "Intrinsic Value";
      l_strBtnID = "btnImg_Value";
      l_strTextID = "btnText_Value";
      break;
    case "major":
      l_strLinkName = "Major Or Minor";
      l_strBtnID = "btnImg_MajorOr";
      l_strTextID = "btnText_MajorOr";
      break;
    case "gradu":
      l_strLinkName = "Graduate Studies";
      l_strBtnID = "btnImg_Graduate";
      l_strTextID = "btnText_Graduate";
      break;
    case "clubs":
      l_strLinkName = "Clubs and Other Stuff";
      l_strBtnID = "btnImg_Clubs";
      l_strTextID = "btnText_Clubs";
      break;
    case "resrc":
      l_strLinkName = "Student Resource Center";
      l_strBtnID = "btnImg_Resources";
      l_strTextID = "btnText_Resources";
      break;
      
    default:
    alert("ERROR in generating global buttons\n" + "getNavBtnHTML()");
      l_strLinkName = "err";
      l_strBtnID = "btnImg_err";
      l_strTextID = "btnText_err";
  }
  

  l_str += "          <td width=\"63\" align=\"center\" valign=\"top\">  \n";
  l_str += "            <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\">  \n";
  l_str += "              <tr><td> "
  l_str += "                  <div width=\"63\" height=\"20\">&nbsp;</div>   \n"; //button padding
  l_str += "              </td></tr>  \n";
 
  l_str += "              <tr><td align=\"center\">  \n";
  
  if (l_bBtnState == true)                          //active graphic button
  {
    l_str += "                <a href=\"#\" id=\"" + l_strBtnID + "\">  \n";  //teapot gfx btn
    l_str += "                  <img id=\"" + l_strBtnID + "\"  \n";
    l_str += "                       src=\"../StudentSurvivalGuideFiles/Btn_TeaPot_1NORM.gif\"  \n";
    l_str += "                       width=\"25\" height=\"17\" class=\"teapotImage\"  \n";
    l_str += "                       alt=\"" + l_strLinkName + "\"  \n";
    l_str += "                       onMouseOver=\"this.src=\'../StudentSurvivalGuideFiles/Btn_TeaPot_2ROLL.gif\'\"  \n";
    l_str += "                       onMouseOut=\"this.src=\'../StudentSurvivalGuideFiles/Btn_TeaPot_1NORM.gif\'\"  \n";
    l_str += "                       onMouseDown=\"this.src=\'../StudentSurvivalGuideFiles/Btn_TeaPot_3CLIK.gif\'\"  \n";
    l_str += "                       onClick=\"globalNavBranch(this.id)\"></img>  \n";
    l_str += "                </a>  \n";
  } else                                           //inactive graphic button
  {
    l_str += "                <img id=\"" + l_strBtnID + "\"  \n";
    l_str += "                     src=\"../StudentSurvivalGuideFiles/Btn_TeaPot_0GREY.gif\"  \n";
    l_str += "                     width=\"25\" height=\"17\" class=\"teapotImage\"></img> \n";
  }

  l_str += "              </td></tr>  \n";
  l_str += "              <tr><td align=\"center\">  \n";
  if (l_bBtnState == true)                          //active text link
  {
    l_str += "                  <a id=\"" + l_strTextID + "\" href=\"#\"  \n";
    l_str += "                     onClick=\"globalNavBranch(this.id)\">  \n";
    l_str += "                    <font class=topnav >" + l_strLinkName + "</font>  \n"; //text link
    l_str += "                  </a>  \n";
  } else                                            //inactive text link
  {
    l_str += "                  <font class=topnavInactive >" + l_strLinkName + "</font>  \n"; 
  }
  
  l_str += "              </td></tr>  \n";
  l_str += "            </table>  \n";
  l_str += "          </td>  \n";

  return l_str;
}
//end getNavBtnHTML()===========================--==================================================

//genInactiveLink()=============================--==================================================
//generates document html for current page
//this will be italic name of current page and not a link
//called from <script> in page : displNavPath()
//preconditions
//..parameter is one of specified strings
//..calls generate html for pages in "StudentSurvivalHTMLfiles" directory
//==============================================--==================================================
function genInactiveLink(p_strLinkName)
{
  //<font class="topnavInactive">Your Professor</font>
  l_strCurrLink = "<font class=\"topnavInactive\">" + p_strLinkName + "</font>";
  document.write(l_strCurrLink);
  return; //<<<
}
//end genInactiveLink()=========================--==================================================

//navToNavPathLink()============================--==================================================
//navigate to url in nav path - when clicking on top nav path link
//eg: Student Survival Guide | Your Professor | Type Of School ...<curr inactive link>
//generates new nav path
//..parse present window name and truncate to link that was selected
//==============================================--==================================================
function navToNavPathLink(p_strURL, p_strName)
{
  //*** alert("in navToNavPathLink(): " + p_strURL + " - " + p_strName); //***dev

  var l_intStartNdx = 0;                        //char loc of start of current sub string
  var l_intEndNdx;                              //char loc of last letter of sub string
  var l_strNewPath = "";                        //string for next window name aka nav path 
  var l_strThisLinkName = "";                   //string for current nav path link being added
 
   
  l_intEndNdx = window.name.indexOf("|")
  while ( l_intEndNdx != -1)
  {
                                                //get name of link from current window name
    l_strThisLinkName = window.name.substring(l_intStartNdx, l_intEndNdx);
                                      
    l_strNewPath += l_strThisLinkName;          //add to new path string
    if(l_strThisLinkName == p_strName)          //test if this is one selected
    {
      l_intEndNdx = -1;                         //DONE - leave loop
    } else                                      //not the link selected, add next
    {                                        
      l_intStartNdx = l_intEndNdx + 1;
      l_intEndNdx = window.name.indexOf("|", l_intStartNdx);
      if(l_intEndNdx != -1)
      {
        l_strNewPath += "|";
      }
    }
  }
  
  //*** alert("in navToNavPathLink() - l_strNewPath: " + l_strNewPath); //***dev
  window.location.href = p_strURL;
  window.name = l_strNewPath;
  
  return;
}
//end navToNavPathLink()========================--==================================================

//==============================================--==================================================
//==============================================--==================================================
//==============================================--==================================================


//34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
//    10        20        30        40        50        60        70        80        90       100