
fSHLoaded = false;
function hMM_mainmenu()
{

var htmlString = ""+NL+
"<table class=mainmenu align=center>"+NL+
"<tr>"+NL+
"  <td><img src=\"images/labels/mainmenu.gif\" border=0></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td class=mainmenu_instructions colspan=2>"+NL+
"Click on one of the chapters below and let the electronic tutor help you master the material.</td>"+NL+
"<tr>"+NL+
"<tr>"+NL+
"  <td height=10>&nbsp;</td>"+NL+
"  <td>&nbsp;</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td>"+NL+
"    <table border=0 cellspacing=4>";

    // loaded into the frameset, write out main menu
    for (var i=STARTLEVEL1_IDX; i < SHELL_BOOK_INFO["chaptertitles"].length; i++)
    {
      var iCaption = i > 0 ? SHELL_BOOK_INFO.levels[1]+" "+i : SHELL_BOOK_INFO.contenttext.MM_PREBOOK;
      var iHREF    = i > 0 ? "chaptermenu.htm?chapter="+i+a_state : "precoursemenu.htm"+q_state;
      var theTitles= i > 0 ? SHELL_BOOK_INFO["chaptertitles"][i] : SHELL_BOOK_INFO.linktext.MM_PREBOOK;
      htmlString += "<tr><td class=mainmenu_caption>"+iCaption+"&nbsp;</td><td nowrap><a class=mainmenu href=\""+iHREF+
                    "\">"+theTitles+"</a>"+"</td></tr>";
    }
    htmlString += "<tr><td class=mainmenu_caption>"+SHELL_BOOK_INFO.contenttext.MM_SELFTEST+
               "&nbsp;</td><td nowrap><a class=mainmenu href=\"javascript:SHELL_HANDLERS.MMselftest();\">"+
               SHELL_BOOK_INFO.linktext.MM_SELFTEST+"</a>"+"</td></tr>";
    htmlString += "<tr><td class=mainmenu_caption>"+SHELL_BOOK_INFO.contenttext.MM_STANDARD+
               "&nbsp;</td><td nowrap><a class=mainmenu href=\"javascript:SHELL_HANDLERS.MMstandard();\">"+
               SHELL_BOOK_INFO.linktext.MM_STANDARD+"</a>"+"</td></tr>";

htmlString += ""+NL+
"    </table>"+NL+
"  </td>"+NL+
"</tr>"+NL+
"</table>"+NL;
if(SHELL_IS_FROMCD)
htmlString +="<iframe src=\"sub_mainmenu.htm"+q_state+"\" name=\"sub_mainmenu\" width=1 height=1 style=\"visibility:hidden\">"+NL+
"</iframe>";

return htmlString;
}
function hMM_mainmenu_exit()
{
var htmlString = ""+NL+
"<!-- Exit button -->"+NL+
"<tr>"+NL+
"  <td align=\"center\" height=\"36\" class=\"mainmenu_bottom\">"+NL+
"  <a class=\"mainmenu\" href=\"javascript:window.close(self);\" title=\"Exit\">"+NL+
"  <img name=\"exitbutton\" src=\"images/navbtns/exit_off.gif\" border=\"0\" alt=\"Exit\" "+NL+
" onmouseover=\"document.images['exitbutton'].src=btnExit_on.src; window.status='Exit';return true;\" "+NL+
" onmouseout=\"document.images['exitbutton'].src=btnExit.src; window.status='';\"></a>"+NL+
"  </td>"+NL+
"</tr>";
return htmlString;
}
function hMM_selftest()
{
/*var thePath = SHELL_CONTENT_PATH+"randomproblems.htm?type=S-SELF";
randprobswin = window.open(thePath,"randprobs","status=no,toolbar=no,menubar=no,width=800,height=600");
if (randprobswin.focus) !NS4 ? randprobswin.focus() : setTimeout("randprobswin.focus()",1000);
*/
document.location = SHELL_CONTENT_PATH+"selftestmenu.htm"+q_state;
}
function hMM_standard()
{
document.location = SHELL_CONTENT_PATH+"standardmenu.htm"+q_state;
}
function hMM_standardmenu()
{
var st = goTrackingInfo.currstate;
var htmlString = ""+NL+
"<table class=standardmenu align=center>"+NL+
"<tr><td height=10>&nbsp;</td></tr>"+NL+
"<tr>"+NL+
"  <td align=center nowrap><h3><span class=\"standardmenu_header\">"+SHELL_BOOK_INFO.contenttext.MM_STANDARDMENU+
"</span></h3>"+
"</td>"+NL+
"</tr>"+NL;
if(SHELL_IS_FROMCD)
htmlString +="<tr>"+NL+
"  <td align=center height=20>"+NL+
"<form><input type=button value='Check For Updates' onclick='iCheck_For_Update()' style='width:140'>"+NL+
"&nbsp;&nbsp;<input type=button value='Find Updates' onclick='iInstall_Update()' style='width:140'>"+NL+
"</form>"+NL+
"</td>"+NL+
"</tr>"+NL;
htmlString +="<tr>"+NL+
"  <td align=center>"+NL+
"<h3>"+State_Standards_Name[st]+"</h3>"+NL+
"</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td>"+NL+
"    <table border=0 cellspacing=2 cellpadding=4>";
 if(typeof Standards_Number[st] != "undefined"){
   var iHREF;
   for(i=1; i<Standards_Number[st].length;i++){
      iHREF = SHELL_CONTENT_PATH+"standardlesson.htm?standard="+i+a_state; 
      htmlString += ""+NL+
"      <tr><td class=\"standardmenu_caption\" nowrap valign=top>"+Standards_Number[st][i]+"&nbsp;</td>"+NL+
"          <td class=\"standardmenu_caption\" valign=top><a class=\"standardmenu\" href=\""+iHREF+"\">"+
           Standards_Title[st][i]+"</a></td>"+NL+
"      </tr>"+NL;
   }
 }
htmlString += "    </table>"+NL+
"  </td>"+NL+
"</tr>"+NL+
"</table>"+NL;
if(SHELL_IS_FROMCD)
htmlString +="<iframe src=\"sub_standardmenu.htm" + q_state + "\" name=\"sub_standardmenu\" width=1 height=1 style=\"visibility:hidden\">"+NL+
"</iframe>"+NL+
"<iframe src=\"blank.htm\" name=\"sub_installstandard\" width=1 height=1 style=\"visibility:hidden\">"+NL+
"</iframe>";

return htmlString;
}
function hSM_standardlesson(){
  var iHREF;
  var params = iGetParams();
  var standard = params["standard"];
  iHREF = SHELL_CONTENT_PATH+"standardlesson.htm?standard="+standard+a_state;
  document.location = iHREF;
} 
function hMM_standardlesson(){
  var state = goTrackingInfo.currstate;
  var params = iGetParams();
  var standard = params["standard"];

  var htmlString = ""+NL+
"<table class=lessonmenu align=center>"+NL+
"<tr><td height=10 colspan=2>&nbsp;</td></tr>"+NL+
"<!--<tr>"+NL+
"  <td align=center colspan=2><h3><span class=\"lessonmenu_header\">"+SHELL_BOOK_INFO.linktext.MM_STANDARD+"</span></h3></td>"+NL+
"</tr>-->"+NL+	
"<tr>"+NL+
"  <td valign=top class=\"lessonmenu_caption\" nowrap>"+NL+ Standards_Number[state][standard] + 
"&nbsp;</td><td valign=top class=\"lessonmenu_caption\" >" + Standards_Title[state][standard]+NL+
"</td>"+NL+
"</tr>"+NL+
"<!--<tr><td height=5 colspan=2>&nbsp;</td></tr>-->"+NL+
"<tr>"+NL+
"  <td colspan=2>"+NL+
"    <table border=0 cellspacing=2 cellpadding=2>";
 if(typeof Standards_Correlation[state][standard] != "undefined" && Standards_Correlation[state][standard].length > 0){
   var lesson;
   var iCaption; 
   var iHREF;
   htmlString += Standards_Correlation[state][standard].length > 1 ?
     "<tr>"+NL+"<td colspan=2>Click on one of the lessons below and let the electronic tutor help you master the "+ 
     "material.</td>"+NL+"</tr>"+NL : "<tr>"+NL+"<td colspan=2>Click on the lesson below and let the electronic tutor "+
     "help you master the material.</td>"+NL+
     "</tr>"+NL;
   htmlString += "<tr><td height=5 colspan=2>&nbsp;</td></tr>"+NL;
   for(i=0; i<Standards_Correlation[state][standard].length;i++){
      lesson = Standards_Correlation[state][standard][i].split(".");
      if( typeof SHELL_BOOK_INFO.lessontitles[lesson[0]] != "undefined" && 
          typeof SHELL_BOOK_INFO.lessontitles[lesson[0]][lesson[1]] != "undefined" ){ 
        iCaption = SHELL_BOOK_INFO.lessontitles[lesson[0]][lesson[1]];
        iHREF = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+lesson[0]+"&lesson="+lesson[1]+"&standard="+standard+a_state; 
        htmlString += ""+NL+
"      <tr><td class=\"lessonmenu_caption\" valign=top width=15% nowrap>Lesson "+
           Standards_Correlation[state][standard][i]+"&nbsp;</td>"+NL+
       "<td class=\"lessonmenu_caption\" valign=top><a class=\"lessonmenu\" href=\""+iHREF+"\">"+
           iCaption+"</a></td>"+NL+
"      </tr>"+NL;
      }
   }
 }
htmlString += "    </table>"+NL+
"  </td>"+NL+
"</tr>"+NL+
"</table>";

return htmlString;
}
function hMM_prebook()
{
var htmlString = ""+NL+
"<table class=precoursemenu align=center>"+NL+
"<tr><td height=10>&nbsp;</td></tr>"+NL+
"<tr>"+NL+
"  <td><h3><span class=\"precoursemenu_header\">"+SHELL_BOOK_INFO.linktext.MM_PREBOOK+"</span></h3></td>"+NL+
"</tr>"+NL+	
"<tr>"+NL+
"  <td class=precoursemenu_instructions>"+NL+
"Click on one of the topics below and let the electronic tutor help you master the material.</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td>"+NL+
"    <table border=0 cellspacing=4>";

    var lAllTopics = SHELL_BOOK_INFO["prebooktitles"];
    var lCorrelatedTopics = SHELL_BOOK_INFO["prebookiis"];
    var lTopicsToShow = lAllTopics;
    var lTopicNumbers = new Array();
    var lTopicNumbersToShow = new Array();
    for (var i=STARTLEVELPREBOOK_IDX; i < lAllTopics.length; i++)
      lTopicNumbers[i] = i;
    // only show correlated topics if requested from a lesson menu (chapter and lesson passed on the url)
    if (isChapterValid && isLessonValid)
    {
      lTopicsToShow = new Array();
      for (var i=STARTLEVELPREBOOK_IDX; i < lCorrelatedTopics.length; i++)
      {
        var iCorrelatedTopic = lCorrelatedTopics[i];
        for (var j=0; j < iCorrelatedTopic.length; j++)
        {
          var jCorrelatedLesson = iCorrelatedTopic[j];
          var splitAtDot = jCorrelatedLesson.split(".");
          var c = splitAtDot[0];
          var l = splitAtDot[1];
          if (chapter==c && lesson==l)
          {
            lTopicNumbersToShow[lTopicNumbersToShow.length] = lTopicNumbers[i];
            lTopicsToShow[lTopicsToShow.length] = lAllTopics[i];
          }
        }
      }
    }

    var fNotEmpty = lTopicsToShow.length > 0;
    // if no correlated topics for the requested lesson, show all of them
    if (!fNotEmpty)
      lTopicsToShow = lAllTopics;
                                                                                                                                 
    var startIDX = isChapterValid && isLessonValid && fNotEmpty ? 0 : STARTLEVELPREBOOK_IDX;
                                                                                                                                 
    // write out precourse menu topics
    for (var i=startIDX; i < lTopicsToShow.length; i++)
    {
      var iCaption = isChapterValid && isLessonValid && fNotEmpty ? "Topic "+lTopicNumbersToShow[i] : "Topic "+i;
      var iHREF    = isChapterValid && isLessonValid && fNotEmpty ? SHELL_CONTENT_PATH+"precourse.htm?topic="+lTopicNumbersToShow[i]+"&chapter="+chapter+"&lesson="+lesson+a_state : SHELL_CONTENT_PATH+"precourse.htm?topic="+i+a_state;
      if(typeof params["standard"] != "undefined") {
         iHREF += fNotEmpty ? "&standard="+params["standard"] : "&chapter="+chapter+"&lesson="+lesson+"&standard="+params["standard"];
      }
      var has_problem = false;
      var tpn = isChapterValid && isLessonValid && fNotEmpty ? lTopicNumbersToShow[i] : i;
      if( typeof SHELL_BOOK_INFO["ntemplates"] != "undefined" && SHELL_BOOK_INFO["ntemplates"][0][tpn] && SHELL_BOOK_INFO["ntemplates"][0][tpn] > 0) has_problem = true;
      if(has_problem)
        htmlString += "<tr><td class=precoursemenu_caption nowrap>"+iCaption+"&nbsp;</td><td><a class=precoursemenu href=\""+iHREF+"\">"+lTopicsToShow[i]+"</a>"+"</td></tr>";
      else
        htmlString += "<tr><td class=precoursemenu_caption nowrap>"+iCaption+"&nbsp;</td><td>"+lTopicsToShow[i]+"</td></tr>";
    }
                                                                                                                                 
    if (isChapterValid && isLessonValid)
    {
       var iHREF  = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+chapter+"&lesson="+lesson+a_state;
       if(typeof params["standard"] != "undefined") iHREF += "&standard="+params["standard"];
       htmlString += "<tr><td height=50 class=precoursemenu_caption>"+SHELL_BOOK_INFO["contenttext"].TLM_RETURN+"&nbsp;</td><td height=50><a class=precoursemenu href='"+iHREF+"'>"+SHELL_BOOK_INFO["linktext"].TLM_RETURN+"</a></td></tr>";
    }

 htmlString +=""+
"   </table>"+NL+
"  </td>"+NL+
"</tr>"+NL+
"</table>";

return htmlString;
}
function hMM_selectchapterN(nChapter)
{
var htmlString = ""+NL+
"<table class=chaptermenu align=center border=0>"+NL+
"<tr>"+NL+
"  <td width=60 valign=\"middle\">"+NL+
"    <table width=60 height=60><tr><td class=\"shelltracking\" id=\"trackingcircle\"><div class=\"shelltracking\" id=\"trackingtxt\"></div></td></tr></table>"+NL+
"  </td>"+NL+
"  <td width=540><h3><br><span class=chaptermenu_header>Chapter "+goTrackingInfo.currchapter+" - Menu</span><br>"+goTrackingInfo.ltrackingtext+"</h3></td>"+NL+
"  <td>"+NL+
"    <form name=frmNavigate " +
"onSubmit='javascript:if ( frmNavigate.boxChapter.value != goTrackingInfo.currchapter) { SHELL_HANDLERS."+BC_NEXTCHAP.handler+"(); } return false'>"+NL+
"      <table cellpadding=0 cellspacing=0 border=0>"+NL+
"      <tr nowrap>"+NL+
"        <td><a href=\"javascript:SHELL_HANDLERS."+BC_PREVCHAP.handler+"()"+"\" onmouseover=\"document.btnleft.src=BTN_LEFT_ON.src\" onmouseout=\"document.btnleft.src=BTN_LEFT.src\"><img alt=\"Go to previous chapter\" name=\"btnleft\" src=\"images/navbtns/left_off.gif"+"\" border=0 align=absmiddle></a></td>"+NL+
"        <td>&nbsp;</td>"+NL+
"        <td>Chapter&nbsp;</td>"+NL+
"        <td><input class=navbox name=boxChapter type=text size=1 maxlength=2 value=\""+goTrackingInfo.currchapter+"\"></td>"+NL+
"        <td nowrap>&nbsp;of " + (SHELL_BOOK_INFO.chaptertitles.length-1) + "</td>"+NL+
"        <td>&nbsp;</td>"+NL+
"        <td><a href=\"javascript:SHELL_HANDLERS."+BC_NEXTCHAP.handler+"()"+"\" onmouseover=\"document.btnright.src=BTN_RIGHT_ON.src\" onmouseout=\"document.btnright.src=BTN_RIGHT.src\"><img alt=\"Go to next chapter\" name=\"btnright\" src=\"images/navbtns/right_off.gif"+"\" border=0 align=absmiddle></a></td>"+NL+
"      </tr>"+NL+
"      </table>"+NL+
"    </form>"+NL+
"  </td>"+NL+
"</tr>"+NL+	
"<tr>"+NL+
"  <td colspan=3>Click on one of the lessons below and let the electronic tutor help you master the material.</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
var lTitles = SHELL_BOOK_INFO.lessontitles[nChapter];	
if (typeof(lTitles)!="undefined"){
  for (var i=STARTLEVEL2_IDX; i < lTitles.length; i++){
    var iHREF   = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+nChapter+"&lesson="+i+a_state;
    htmlString += "<tr><td colspan=3 class=chaptermenu_caption nowrap>"+SHELL_BOOK_INFO.levels[2]+" "+i+
         "&nbsp;&nbsp;&nbsp;&nbsp;"+"<a class=chaptermenu href=\""+iHREF+"\">"+lTitles[i]+"</a>"+"</td></tr>";
  }
  htmlString += ""+
"<tr>"+NL+
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3 nowrap><a class=chaptermenu href=\"javascript:SHELL_HANDLERS.CNMchaptertest("+nChapter+")\">"+SHELL_BOOK_INFO.linktext.CNM_CHAPTERTEST+"</a></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.CNM_CHAPTERTEST+"</td>"+NL+
"</tr>"+NL;
}else{
  htmlString += "<tr><td colspan=2>Lessons coming soon.</td></tr>"  
}
htmlString += ""+
"</table>";

return htmlString;
}
function hCM_chaptermenu_exit()
{
var htmlString = ""+
"<!-- Exit button -->"+NL+
"<tr>"+NL+
"  <td align=\"center\" height=\"36\" class=\"chaptermenu_bottom\">"+NL+
"    <a class=\"chaptermenu\" href=\"javascript:window.close(self);\" title=\"Exit\"><img name=\"exitbutton\" "+NL+
" src=\"images/navbtns/exit_off.gif\" border=\"0\" alt=\"Exit\" onmouseover=\"document.images['exitbutton'].src=btnExit_on.src; "+NL+
"window.status='Exit';return true;\" onmouseout=\"document.images['exitbutton'].src=btnExit.src; window.status='';\"></a>"+NL+
"  </td>"+NL+
"</tr>";
return htmlString;
}
function h_backtoMM()
{
document.location = SHELL_CONTENT_PATH+"mainmenu.htm"+q_state;
iUpdate_Tracking(-1,-1,-1);
}
function hTLM_selecttopicN(nTopic,nChapter,nLesson)
{
var htmlString = ""+NL+
"<table class=chaptermenu align=center border=0>"+NL+
"<tr>"+NL+
"  <td width=60 valign=\"middle\">"+NL+
"    <table width=60 height=60><tr><td class=\"shelltracking\" id=\"trackingcircle\"><div class=\"shelltracking\" id=\"trackingtxt\"></div></td></tr></table>"+NL+
"  </td>"+NL+
"  <td width=540><h3><br><span class=precourse_header>Pre-Course Topic "+nTopic+" - Menu</span><br>"+SHELL_BOOK_INFO.prebooktitles[nTopic]+"</h3></td>"+NL+
"  <td>"+NL;

if(typeof params["standard"] != "undefined"){
  htmlString += "&nbsp;";
}else{
  htmlString += ""+
"    <form name=frmNavigate "+
"onSubmit='javascript:if ( frmNavigate.boxTopic.value != goTrackingInfo.currtopic) { SHELL_HANDLERS."+BC_NEXTTOPIC.handler+"(); } return false'>"+NL+
"      <table cellpadding=0 cellspacing=0 border=0>"+NL+
"      <tr>"+NL+
"        <td><a href=\"javascript:SHELL_HANDLERS."+BC_PREVTOPIC.handler+"()"+"\" onmouseover=\"document.btnleft.src=BTN_LEFT_ON.src\" onmouseout=\"document.btnleft.src=BTN_LEFT.src\"><img alt=\"Go to previous topic\" name=\"btnleft\" src=\"images/navbtns/left_off.gif"+"\" border=0 align=absmiddle></a></td>"+NL+
"        <td>&nbsp;</td>"+NL+
"        <td nowrap>Topic&nbsp;</td>"+NL+
"        <td><input class=navbox name=boxTopic type=text size=1 maxlength=2 value=\""+goTrackingInfo.currtopic+"\"></td>"+NL+
"        <td nowrap>&nbsp;of " + (SHELL_BOOK_INFO.prebooktitles.length-1) + "</td>"+NL+
"        <td>&nbsp;</td>"+NL+
"        <td><a href=\"javascript:SHELL_HANDLERS."+BC_NEXTTOPIC.handler+"()"+"\" onmouseover=\"document.btnright.src=BTN_RIGHT_ON.src\" onmouseout=\"document.btnright.src=BTN_RIGHT.src\"><img alt=\"Go to next topic\" name=\"btnright\" src=\"images/navbtns/right_off.gif"+"\" border=0 align=absmiddle></a></td>"+NL+
"      </tr>"+NL+
"      </table>"+NL+
"    </form>"+NL;
}
                                                                                                                
htmlString += ""+
"  </td>"+NL+
"</tr>"+NL+	
"<tr><td height=10>&nbsp;</td></tr>"+NL;
var has_animation = false;
if(mm_animations != "undefined"){
   if (nChapter){
      if ( mm_animations[nChapter][nLesson] > 0) has_animation = true;
   }else{
      if ( mm_animations[0][nTopic] > 0) has_animation = true;
   }
}
if(has_animation){
htmlString += ""+
"<tr>"+NL+
"  <td colspan=3>";
if (nChapter && nLesson)
htmlString += "<a class=precoursemenu href=\"javascript:SHELL_HANDLERS.TCNMlearnthetopic("+nTopic+")\">"+SHELL_BOOK_INFO.linktext.TNM_II+"</a>";
else
htmlString += "<a class=precoursemenu href=\"javascript:SHELL_HANDLERS.TNMlearnthetopic("+nTopic+")\">"+SHELL_BOOK_INFO.linktext.TNM_II+"</a>";
htmlString += "</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.TNM_II+"</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+    
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
}
var has_problem = false;
if( typeof SHELL_BOOK_INFO["ntemplates"] != "undefined"){
   if (nChapter){
       if(SHELL_BOOK_INFO["ntemplates"][nChapter][nLesson] && SHELL_BOOK_INFO["ntemplates"][nChapter][nLesson] > 0) has_problem = true;
   }else{
       if(SHELL_BOOK_INFO["ntemplates"][0][nTopic] && SHELL_BOOK_INFO["ntemplates"][0][nTopic] > 0) has_problem = true;
   }
}
if(has_problem){
htmlString += ""+
"<tr>"+NL+
"  <td colspan=3><a class=precoursemenu href=\"javascript:SHELL_HANDLERS.TNMtrytheexercises("+nTopic+")\">"+SHELL_BOOK_INFO.linktext.TNM_RANDPROBS+"</a></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.TNM_RANDPROBS+"</td>"+NL+
"</tr>"+NL;
}
htmlString += ""+
"</table>"+NL;

return htmlString;
}
function h_backtoTLM()
{
document.location = SHELL_CONTENT_PATH+"precoursemenu.htm"+q_state;
}
function hTNM_gotoprevtopic()
{
var nCurrTopic   = goTrackingInfo.currtopic; 
var nNewTopic    = document.frmNavigate.boxTopic.value;
var xTopics = SHELL_BOOK_INFO.prebooktitles.length-1;
var isValid = iValidate_Integer_Input(nNewTopic);
isValid = isValid ? iValidate_Integer_Range(nNewTopic, STARTLEVELPREBOOK_IDX, xTopics) : isValid; 
if (isValid)
{
if (nNewTopic=="")
nNewTopic = nCurrTopic;
nCurrTopic = nCurrTopic==nNewTopic ? parseInt(nCurrTopic)-1 : nNewTopic;
if (nCurrTopic > STARTLEVELPREBOOK_IDX-1)
document.location = SHELL_CONTENT_PATH+"precourse.htm?topic="+nCurrTopic+a_state;
else
{
var label = SHELL_BOOK_INFO.levels[3].toLowerCase();
alert("You are at the first "+label+".");
}
}
else
{
alert("Error:  Invalid value in text box"+NL+"Please enter a valid number in the text box");
if (document.frmNavigate.boxTopic.focus)
document.frmNavigate.boxTopic.focus();
if (document.frmNavigate.boxTopic.select)
document.frmNavigate.boxTopic.select();
}
}
function hTNM_gotonexttopic()
{
var nCurrTopic = goTrackingInfo.currtopic; 
var nNewTopic  = document.frmNavigate.boxTopic.value;
var xTopics = SHELL_BOOK_INFO.prebooktitles.length-1;
var isValid = iValidate_Integer_Input(nNewTopic);
isValid = isValid ? iValidate_Integer_Range(nNewTopic, STARTLEVELPREBOOK_IDX, xTopics) : isValid; 
if (isValid)
{
if (nNewTopic=="")
nNewTopic = nCurrTopic;
nCurrTopic = nCurrTopic==nNewTopic ? parseInt(nCurrTopic)+1 : nNewTopic;
if (nCurrTopic <= xTopics)
document.location = SHELL_CONTENT_PATH+"precourse.htm?topic="+nCurrTopic+a_state;
else
{
var label = SHELL_BOOK_INFO.levels[3].toLowerCase();
alert("You are at the last "+label+".");
}
}
else
{
alert("Error:  Invalid value in text box"+NL+"Please enter a valid number in the text box");
if (document.frmNavigate.boxTopic.focus)
document.frmNavigate.boxTopic.focus();
if (document.frmNavigate.boxTopic.select)
document.frmNavigate.boxTopic.select();
}
}
function hTNM_learnthetopic(nTopic)
{
if(typeof params["standard"] != "undefined"){
  document.location = SHELL_CONTENT_PATH+"ii.htm?chapter=0"+"&lesson="+nTopic+a_state+"&standard="+params["standard"];
}else{
  document.location = SHELL_CONTENT_PATH+"ii.htm?chapter=0"+"&lesson="+nTopic+a_state;
}
}
function hTCNM_learnthetopic(nTopic)
{
if(typeof params["standard"] != "undefined"){
  document.location = SHELL_CONTENT_PATH+"ii.htm?topic="+nTopic+"&chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+a_state+"&standard="+params["standard"];
}else{
  document.location = SHELL_CONTENT_PATH+"ii.htm?topic="+nTopic+"&chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+a_state;
}
}
function hTNM_trytheexercises(nTopic)
{
/*
var thePath = SHELL_CONTENT_PATH+"randomproblems.htm?chapter=0&section="+nTopic+"&type=S-SEC";
randprobswin = window.open(thePath,"randprobs","status=no,toolbar=no,menubar=no,width=800,height=600");
if (randprobswin.focus) !NS4 ? randprobswin.focus() : setTimeout("randprobswin.focus()",1000);
*/
if(typeof params["standard"] != "undefined"){
  document.location = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+"&topic="+nTopic+"&type=S-SEC"+a_state+"&standard="+params["standard"];
}else{
  document.location = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+"&topic="+nTopic+"&type=S-SEC"+a_state;
}
}
function h_backtoTNM()
{
if(typeof params["standard"] != "undefined"){
  document.location = SHELL_CONTENT_PATH+"precourse.htm?topic="+goTrackingInfo.currtopic+a_state+"&standard="+params["standard"];;
}else{
  document.location = SHELL_CONTENT_PATH+"precourse.htm?topic="+goTrackingInfo.currtopic+a_state;
}
}
function h_backtoTCM()
{
if(typeof params["standard"] != "undefined"){
  document.location = SHELL_CONTENT_PATH+"precoursemenu.htm?topic="+goTrackingInfo.currtopic+"&chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+a_state+"&standard="+params["standard"];
}else{
  document.location = SHELL_CONTENT_PATH+"precoursemenu.htm?topic="+goTrackingInfo.currtopic+"&chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+a_state;
}
}
function hTCNMIIbacktoTCNM()
{
if(typeof params["standard"] != "undefined"){
  document.location = SHELL_CONTENT_PATH+"precourse.htm?topic="+goTrackingInfo.currtopic+"&chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+a_state+"&standard="+params["standard"];
}else{
  document.location = SHELL_CONTENT_PATH+"precourse.htm?topic="+goTrackingInfo.currtopic+"&chapter="+goTrackingInfo.currchapter+"&lesson="+goTrackingInfo.currlesson+a_state;
}
}
function h_backtoLNM()
{
 var params = iGetParams();

 if(typeof params["standard"] != "undefined"){
   document.location = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+goTrackingInfo.currchapter+"&lesson="+
      goTrackingInfo.currlesson+a_state+"&standard="+params["standard"];
 }else{
   document.location = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+goTrackingInfo.currchapter+"&lesson="+
      goTrackingInfo.currlesson+a_state;
 }
}
function hCNM_gotoprevchapter()
{
var nCurrChapter = goTrackingInfo.currchapter; 
var nNewChapter  = document.frmNavigate.boxChapter.value;
var xChapters = SHELL_BOOK_INFO.chaptertitles.length-1;
var isValid = iValidate_Integer_Input(nNewChapter);
isValid = isValid ? iValidate_Integer_Range(nNewChapter, 1, xChapters) : isValid; 
if (isValid)
{
if (nNewChapter=="")
nNewChapter = nCurrChapter;
nCurrChapter = nCurrChapter==nNewChapter ? parseInt(nCurrChapter)-1 : nNewChapter;
if (nCurrChapter > 0)
document.location = SHELL_CONTENT_PATH+"chaptermenu.htm?chapter="+nCurrChapter+a_state;
else
{
var label = SHELL_BOOK_INFO.levels[1].toLowerCase();
alert("You are at the first "+label+".");
}
}
else
{
alert("Error:  Invalid value in text box"+NL+"Please enter a valid number in the text box");
if (document.frmNavigate.boxChapter.focus)
document.frmNavigate.boxChapter.focus();
if (document.frmNavigate.boxChapter.select)
document.frmNavigate.boxChapter.select();
}
}
function hCNM_gotonextchapter()
{
var nCurrChapter = goTrackingInfo.currchapter; 
var nNewChapter  = document.frmNavigate.boxChapter.value;
var xChapters = SHELL_BOOK_INFO.chaptertitles.length-1;
var isValid = iValidate_Integer_Input(nNewChapter);
isValid = isValid ? iValidate_Integer_Range(nNewChapter, 1, xChapters) : isValid; 
if (isValid)
{
if (nNewChapter=="")
nNewChapter = nCurrChapter;
nCurrChapter = nCurrChapter==nNewChapter ? parseInt(nCurrChapter)+1 : nNewChapter;
if (nCurrChapter <= xChapters)
document.location = SHELL_CONTENT_PATH+"chaptermenu.htm?chapter="+nCurrChapter+a_state;
else
{
var label = SHELL_BOOK_INFO.levels[1].toLowerCase();
alert("You are at the last "+label+".");
}
}
else
{
alert("Error:  Invalid value in text box"+NL+"Please enter a valid number in the text box");
if (document.frmNavigate.boxChapter.focus)
document.frmNavigate.boxChapter.focus();
if (document.frmNavigate.boxChapter.select)
document.frmNavigate.boxChapter.select();
}
}
function hCNM_chaptertest(nChapter)
{
/*
var thePath = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+nChapter+"&type=T-POST";
randprobswin = window.open(thePath,"randprobs","status=no,toolbar=no,menubar=no,width=800,height=600");
if (randprobswin.focus) !NS4 ? randprobswin.focus() : setTimeout("randprobswin.focus()",1000);
*/
document.location = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+nChapter+"&type=T-POST"+a_state;
}
function hCNM_selectlessonN(nLesson)
{
var nChapter = goTrackingInfo.currchapter;
var iiHREF         = SHELL_CONTENT_PATH+"ii.htm?chapter="+nChapter+"&lesson="+nLesson+a_state;
var precourseHREF  = SHELL_CONTENT_PATH+"precoursemenu.htm?chapter="+nChapter+"&lesson="+nLesson+a_state;
var practiceHREF   = "javascript:SHELL_HANDLERS.LNMtrytheexercises("+nLesson+")";
var mwHREF         = SHELL_CONTENT_PATH+"mw.htm?chapter="+nChapter+"&lesson="+nLesson+a_state;
if(typeof params["standard"] != "undefined"){
  iiHREF         += "&standard="+params["standard"];
  mwHREF         += "&standard="+params["standard"];
  precourseHREF  += "&standard="+params["standard"];
}
var htmlString = ""+NL+
"<table class=lessonmenu align=center border=0>"+NL+
"<tr>"+NL+
"  <td width=60 valign=\"middle\">"+NL+
"    <table width=60 height=60><tr><td class=\"shelltracking\" id=\"trackingcircle\"><div class=\"shelltracking\" id=\"trackingtxt\"></div></td></tr></table>"+NL+
"  </td>"+NL+
"  <td width=540><br><h3><span class=lessonmenu_header>Lesson "+goTrackingInfo.currchapter+"."+nLesson+" - Menu</span><br>"+goTrackingInfo.ltrackingtext+"</h3></td>"+NL+
"  <td>"+NL;

if(typeof params["standard"] != "undefined"){
  htmlString += "&nbsp;";
}else{
  htmlString += ""+
"    <form name=frmNavigate "+
"onSubmit='javascript:if ( frmNavigate.boxLesson.value != goTrackingInfo.currlesson) { SHELL_HANDLERS."+BC_NEXTLESSON.handler+"();} return false'>"+NL+
"      <br>"+NL+
"      <table cellpadding=0 cellspacing=0 border=0>"+NL+
"      <tr nowrap>"+NL+
"        <td><a href=\"javascript:SHELL_HANDLERS."+BC_PREVLESSON.handler+"()"+"\" onmouseover=\"document.btnleft.src=BTN_LEFT_ON.src\" onmouseout=\"document.btnleft.src=BTN_LEFT.src\"><img alt=\"Go to previous lesson\" name=\"btnleft\" src=\"images/navbtns/left_off.gif"+"\" border=0 align=absmiddle></a></td>"+NL+
"        <td>&nbsp;</td>"+NL+
"        <td>Lesson&nbsp;</td>"+NL+
"        <td><input class=navbox name=boxLesson type=text size=1 maxlength=2 value=\""+goTrackingInfo.currlesson+"\"></td>"+NL+
"        <td nowrap>&nbsp;of " + (SHELL_BOOK_INFO.lessontitles[goTrackingInfo.currchapter].length-1) + "</td>"+NL+
"        <td>&nbsp;</td>"+NL+
"        <td><a href=\"javascript:SHELL_HANDLERS."+BC_NEXTLESSON.handler+"()"+"\" onmouseover=\"document.btnright.src=BTN_RIGHT_ON.src\" onmouseout=\"document.btnright.src=BTN_RIGHT.src\"><img alt=\"Go to next lesson\" name=\"btnright\" src=\"images/navbtns/right_off.gif"+"\" border=0 align=absmiddle></a></td>"+NL+
"      </tr>"+NL+
"      </table>"+NL+
"    </form>"+NL;
}

htmlString += ""+
"  </td>"+NL+
"</tr>"+NL+	
"<tr>"+NL+    
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
if(mm_animations != "undefined" && mm_animations[nChapter][nLesson] > 0){
htmlString += ""+
"<tr>"+NL+
"  <td colspan=3 class=lessonmenu_caption><a class=lessonmenu href=\""+iiHREF+"\">"+SHELL_BOOK_INFO.linktext.LNM_II+"</a></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.LNM_II+"</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+    
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
}
if( typeof SHELL_BOOK_INFO["ntemplates"] != "undefined" && SHELL_BOOK_INFO["ntemplates"][nChapter][nLesson] && 
    SHELL_BOOK_INFO["ntemplates"][nChapter][nLesson] > 0) {
htmlString += ""+
"<tr>"+NL+
"  <td colspan=3 class=lessonmenu_caption><a class=lessonmenu href=\""+practiceHREF+"\">"+SHELL_BOOK_INFO.linktext.LNM_RANDPROBS+"</a></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.LNM_RANDPROBS+"</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+    
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
}
if(typeof flip_cards[nChapter][nLesson] != "undefined" && flip_cards[nChapter][nLesson] > 0) {
htmlString += ""+
"<tr>"+NL+
"  <td colspan=3 class=lessonmenu_caption><a class=lessonmenu href=\""+mwHREF+"\">"+SHELL_BOOK_INFO.linktext.LNM_MATCHINGWORDS+"</a></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.LNM_MATCHINGWORDS+"</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+    
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
}
if(NSECTIONS[0] > 0){ 
htmlString += ""+
"<tr>"+NL+
"  <td colspan=3 class=lessonmenu_caption><a class=lessonmenu href=\""+precourseHREF+"\">"+SHELL_BOOK_INFO.linktext.LNM_LRT+"</a></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=3>"+SHELL_BOOK_INFO.contenttext.LNM_LRT+"</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+    
"  <td colspan=3 height=10>&nbsp;</td>"+NL+
"</tr>"+NL;
}
htmlString += ""+
"</table>"+NL;
return htmlString;
}
function h_backtoCNM()
{
document.location = SHELL_CONTENT_PATH+"chaptermenu.htm?chapter="+goTrackingInfo.currchapter+a_state;
}
function hLNM_gotoprevlesson()
{
var nCurrChapter = goTrackingInfo.currchapter; 
var nCurrLesson  = goTrackingInfo.currlesson; 
var nNewLesson   = document.frmNavigate.boxLesson.value;
var xLessons = SHELL_BOOK_INFO.lessontitles[nCurrChapter].length-1;
var isValid = iValidate_Integer_Input(nNewLesson);
isValid = isValid ? iValidate_Integer_Range(nNewLesson, STARTLEVEL2_IDX, xLessons) : isValid; 
if (isValid)
{
if (nNewLesson=="")
nNewLesson = nCurrLesson;
nCurrLesson = nCurrLesson==nNewLesson ? parseInt(nCurrLesson)-1 : nNewLesson;
if (nCurrLesson > 0)
document.location = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+nCurrChapter+"&lesson="+nCurrLesson+a_state;
else
{
var label = SHELL_BOOK_INFO.levels[2].toLowerCase();
alert("You are at the first "+label+".");
}
}
else
{
alert("Error:  Invalid value in text box"+NL+"Please enter a valid number in the text box");
if (document.frmNavigate.boxLesson.focus)
document.frmNavigate.boxLesson.focus();
if (document.frmNavigate.boxLesson.select)
document.frmNavigate.boxLesson.select();
}
}
function hLNM_gotonextlesson()
{
var nCurrChapter = goTrackingInfo.currchapter; 
var nCurrLesson  = goTrackingInfo.currlesson; 
var nNewLesson  = document.frmNavigate.boxLesson.value;
var xLessons = SHELL_BOOK_INFO.lessontitles[nCurrChapter].length - 1;  
var isValid = iValidate_Integer_Input(nNewLesson);
isValid = isValid ? iValidate_Integer_Range(nNewLesson, STARTLEVEL2_IDX, xLessons) : isValid; 
if (isValid)
{
if (nNewLesson=="")
nNewLesson = nCurrLesson;
nCurrLesson = nCurrLesson==nNewLesson ? parseInt(nCurrLesson)+1 : nNewLesson;
if (nCurrLesson <= xLessons)
document.location = SHELL_CONTENT_PATH+"lessonmenu.htm?chapter="+nCurrChapter+"&lesson="+nCurrLesson+a_state;
else
{
var label = SHELL_BOOK_INFO.levels[2].toLowerCase();
alert("You are at the last "+label+".");
}
}
else
{
alert("Error:  Invalid value in text box"+NL+"Please enter a valid number in the text box");
if (document.frmNavigate.boxLesson.focus)
document.frmNavigate.boxLesson.focus();
if (document.frmNavigate.boxLesson.select)
document.frmNavigate.boxLesson.select();
}
}
function hLNM_learnthetopic(nLesson)
{
var nTopic   = goTrackingInfo.currtopic;
var nChapter = goTrackingInfo.currchapter;
var theHeading = nChapter==0 ? "Topic "+nLesson : "Lesson "+nChapter+"."+nLesson;
theHeading = nTopic > -1 ? "Topic "+nTopic  : theHeading;
var iiContentFileName = goTrackingInfo.currchapter+"_"+goTrackingInfo.currlesson+SHELL_II_CONTENT_FILE;
if (nTopic > -1)
iiContentFileName = "0_"+nTopic+SHELL_II_CONTENT_FILE;

var theURL = SHELL_II_PATH + SHELL_BOOK_INFO["bookcode"] + "/ch" + goTrackingInfo.currchapter+"_sec"+goTrackingInfo.currlesson + "_part1.swf";
var htmlString = ""+NL+
"<table class=iimenu align=center border=0>"+NL+
"<tr>"+NL+
"  <td width=60 valign=\"middle\">"+NL+
"    <table width=60 height=60><tr><td class=\"shelltracking\" id=\"trackingcircle\"><div class=\"shelltracking\" id=\"trackingtxt\"></div></td></tr></table>"+NL+
"  </td>"+NL+
"  <td width=540 height=10><br><h3><span class=lessonmenu_header>"+theHeading+" - Interactive Instructor</span><br>"+goTrackingInfo.ltrackingtext+"</h3></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"flash_help_container\">"+NL+
                                                                                                                                         
    "<IFRAME SRC=\""+ theURL + "\" NAME=\"flipcard\" ID=\"flipcard\" TITLE=\"\" width=\"" +
      SHELL_II_IFRAME_WIDTH +NL+
    "\" height=\"" + SHELL_II_IFRAME_HEIGHT + "\" frameborder=\"0\" marginwidth=\"1\" marginheight=\"1\">"+NL+
    "    <!-- Alternate content for non-supporting browsers -->"+NL+
    "    "+NL+
    "</IFRAME>"+NL+

"</div></td>"+NL+
"</tr>"+NL;

   var iHREF, rtText;
   if(typeof params["standard"] != "undefined") {
      iHREF = isTopicValid ? "javascript:SHELL_HANDLERS.TCNMIIbacktoTCNM()" : "javascript:SHELL_HANDLERS.IIbacktoLNM()";
      rtText = isTopicValid ? SHELL_BOOK_INFO["linktext"].TNM_RETURN : SHELL_BOOK_INFO["linktext"].TLM_RETURN;
   }else{
      if(nChapter==0){
        iHREF = "javascript:SHELL_HANDLERS.IIbacktoTNM()";
        rtText = SHELL_BOOK_INFO["linktext"].TNM_RETURN
      }else if (isTopicValid){
        iHREF = "javascript:SHELL_HANDLERS.TCNMIIbacktoTCNM()";
        rtText = SHELL_BOOK_INFO["linktext"].TNM_RETURN
      }else{
        iHREF = "javascript:SHELL_HANDLERS.IIbacktoLNM()";
        rtText = SHELL_BOOK_INFO["linktext"].TLM_RETURN
      }
   }

htmlString += "<tr><td colspan=2 height=50><a class=precoursemenu href="+iHREF+">"+rtText+"</a></td></tr>";

htmlString += "<tr>"+NL+
"  <td colspan=2 height=10>&nbsp;</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"flash_help_link\"><a href=\"javascript:SHELL_HANDLERS.MWflashhelp()\"><font size=-1>"+NL+
SHELL_BOOK_INFO.linktext.TNM_MWGETFLASH+"</font></a></div></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"flash_help_text\"><font size=-1>"+SHELL_BOOK_INFO.contenttext.TNM_MWGETFLASH+"</font></div></td>"+NL+
"</tr>"+NL+
"</div>"+NL+
"</table>"+NL;
return htmlString;
}
function hLNM_trytheexercises(nLesson)
{
/*
var nChapter = goTrackingInfo.currchapter;
var thePath = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+nChapter+"&section="+nLesson+"&type=S-SEC";
randprobswin = window.open(thePath,"randprobs","status=no,toolbar=no,menubar=no,width=800,height=600");
if (randprobswin.focus) !NS4 ? randprobswin.focus() : setTimeout("randprobswin.focus()",1000);
*/
 if(typeof params["standard"] != "undefined"){
    document.location = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+goTrackingInfo.currchapter+
      "&lesson="+nLesson+"&type=S-SEC"+a_state+"&standard="+params["standard"];
 }else{
    document.location = SHELL_CONTENT_PATH+"randomproblems.htm?chapter="+goTrackingInfo.currchapter+
      "&lesson="+nLesson+"&type=S-SEC"+a_state;
 }
}
function hLNM_matchingwords(nLesson)
{
var nChapter = goTrackingInfo.currchapter;
var mwID       = "c"+goTrackingInfo.currchapter+"l"+nLesson+"_mw";
var mwFileName = SHELL_MW_PATH+mwID+".txt";
var htmlString = ""+NL+
"<table class=mwmenu align=center border=0>"+NL+
"<tr>"+NL+
"  <td width=60 valign=\"middle\">"+NL+
"    <table width=60 height=60><tr><td class=\"shelltracking\" id=\"trackingcircle\"><div class=\"shelltracking\" id=\"trackingtxt\"></div></td></tr></table>"+NL+
"  </td>"+NL+
"  <td width=540 height=10><br><h3><span class=mwmenu_header>Lesson "+goTrackingInfo.currchapter+"."+nLesson+" - Vocabulary Flip Cards</span><br>"+goTrackingInfo.ltrackingtext+"</h3></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"shockwave_help_container\">"+NL+
get_director(SHELL_MW_TEMPLATE,SHELL_DIRMOVIE2_WIDTH,SHELL_DIRMOVIE2_HEIGHT,mwID,mwFileName)+"</div></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+    
"  <td colspan=2 height=10>&nbsp;</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"shockwave_help_link\"><a href=\"javascript:SHELL_HANDLERS.MWshockwavehelp()\"><font size=-1>"+NL+
SHELL_BOOK_INFO.linktext.TNM_IIGETSHOCKWAVE+"</font></a></div></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"shockwave_help_text\"><font size=-1>"+SHELL_BOOK_INFO.contenttext.TNM_IIGETSHOCKWAVE+"</font></div></td>"+NL+
"</tr>"+NL+
"</table>"+NL;
return htmlString;
}

function hLNM_flashflipcards(nLesson)
{
var nChapter = goTrackingInfo.currchapter;
var ch  = nChapter < 10 ? "ch0"+goTrackingInfo.currchapter : "ch"+goTrackingInfo.currchapter;
var chdir = nChapter < 10 ? "Ch0"+goTrackingInfo.currchapter : "Ch"+goTrackingInfo.currchapter;
var se  = nLesson < 10 ? "0"+nLesson : nLesson;
var fcFileName = "flip_" + ch + "_" + se + ".xml";
var fcFilePath = SHELL_FC_TEMPLATE + "?passedxml=" + chdir + "/" + fcFileName;
var fcID = "flashcards";
var theURL = SHELL_FC_HTMLPAGE;
var htmlString = ""+NL+
"<table class=mwmenu align=center border=0>"+NL+
"<tr>"+NL+
"  <td width=60 valign=\"middle\">"+NL+
"    <table width=60 height=60><tr><td class=\"shelltracking\" id=\"trackingcircle\"><div class=\"shelltracking\" id=\"trackingtxt\"></div></td></tr></table>"+NL+
"  </td>"+NL+
"  <td width=540 height=10><br><h3><span class=mwmenu_header>Lesson "+goTrackingInfo.currchapter+"."+nLesson+" - Vocabulary Flip Cards</span><br>"+goTrackingInfo.ltrackingtext+"</h3></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"flash_help_container\">"+NL+

    "<IFRAME SRC=\""+ theURL + "\" NAME=\"flipcard\" ID=\"flipcard\" TITLE=\"\" width=\"" +
      SHELL_FC_IFRAME_WIDTH +NL+
    "\" height=\"" + SHELL_FC_IFRAME_HEIGHT + "\" frameborder=\"0\" marginwidth=\"1\" marginheight=\"1\">"+NL+
    "    <!-- Alternate content for non-supporting browsers -->"+NL+
    "    "+NL+
    "</IFRAME>"+NL+
"<script language='Javascript'>"+NL+
"function get_flash_html(){"+NL+
"   var html_str = get_flash(\""+fcFilePath+"\",\""+SHELL_FLASHMOVIE_WIDTH+"\",\""+SHELL_FLASHMOVIE_HEIGHT+"\",\""+fcID+"\");"+NL+
"   return html_str;"+NL+
"}"+NL+
"</script>"+NL+
"</div></td>"+NL+
"</tr>"+NL;

   var iHREF, rtText;
   if(typeof params["standard"] != "undefined") {
      iHREF = "javascript:SHELL_HANDLERS.IIbacktoLNM()";
   }else{
      iHREF = "javascript:SHELL_HANDLERS.MWbacktoLNM()";
   }
   rtText = SHELL_BOOK_INFO["linktext"].TLM_RETURN
                                                                                                                        
htmlString += "<tr><td colspan=2 height=50><a class=precoursemenu href="+iHREF+">"+rtText+"</a></td></tr>";

htmlString += "<tr>"+NL+
"  <td colspan=2 height=10>&nbsp;</td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"flash_help_link\"><a href=\"javascript:SHELL_HANDLERS.MWflashhelp()\"><font size=-1>"+NL+
SHELL_BOOK_INFO.linktext.TNM_MWGETFLASH+"</font></a></div></td>"+NL+
"</tr>"+NL+
"<tr>"+NL+
"  <td colspan=2><div id=\"flash_help_text\"><font size=-1>"+SHELL_BOOK_INFO.contenttext.TNM_MWGETFLASH+"</font></div></td>"+NL+
"</tr>"+NL+
"</table>"+NL;
return htmlString;
}

function hSTM_createselftest(){
                                                                                                                                 
  var form = st_list.document.st_form;
  if(iNo_STLesson_checked(form)){
     alert( "No " + SHELL_BOOK_INFO["levels"][1].toLowerCase() +" or " +
     SHELL_BOOK_INFO["levels"][2].toLowerCase() + " is selected.");
     //return false;
  }else{
     var startc = STARTLEVEL1_IDX;
     var endc = STARTLEVEL1_IDX == 0 ? NCHAPTERS - 1 : NCHAPTERS;
     var cbname;
     var starts = STARTLEVEL2_IDX;
     var ends;
     var c,s;
     var parm_str = "";
     for (c=startc; c<=endc; c++){
        ends = NSECTIONS[c];
        for(s=starts;s<=ends;s++){
          cbname = "c"+c+"s"+s;
          if ( SHELL_BOOK_INFO["ntemplates"][c][s] && SHELL_BOOK_INFO["ntemplates"][c][s] > 0 && form.elements[cbname].checked){
            parm_str += parm_str == "" ? "" : ",";
            parm_str += c+"-"+s;
          }
        }
     }

/*
  iGetDiv("st_instruction", st_title.document).style.visibility = "hidden";

  //alert(parm_str);
  var theURL = SHELL_TEMPLATES_PATH + "viewer/standalone.html?type=S-SELF&book="+
        SHELL_BOOK_INFO["bookcode"]+"&chapsect="+parm_str+a_state;
  st_list.document.open();
  st_list.document.write("<html>"+NL+
    "<head>"+NL+
    "<link rel=stylesheet href='shell_styles.css' type='text/css'>"+NL+
    "</head>"+NL+
    "<body class=lessonmenu margintop=\"0\" marginleft=\"0\" marginheight=\"0\" marginwidth=\"0\">"+NL+
    "<table align=center>"+NL+
    "<tr>"+NL+
    "<td align=\"center\">"+NL+
    "<IFRAME SRC=\""+ theURL + "\" NAME=\"viewer\" ID=\"viewer\" TITLE=\"Bernoulli Viewer\" width=\"" + 
      SHELL_VIEWER_IFRAME_WIDTH +NL+
    "\" height=\"" + SHELL_VIEWER_IFRAME_HEIGHT + "\" frameborder=\"0\" marginwidth=\"1\" marginheight=\"1\">"+NL+
    "    <!-- Alternate content for non-supporting browsers -->"+NL+
    "    The Bernoulli Viewer"+NL+
    "</IFRAME>"+NL+
    "</td>"+NL+
    "</tr>"+NL+
    "</table>"+NL+
    "</body></html>");

  st_list.document.close();

  //blank out button page
  st_button.document.open();
  st_button.document.clear();
  st_button.document.write("<html><body></body></html>");
  st_button.document.close();
*/

    var params = iGetParams();

    if(typeof params["standard"] != "undefined"){
       document.location = SHELL_CONTENT_PATH+"randomproblems.htm?type=S-SELF&book="+
         SHELL_BOOK_INFO["bookcode"]+"&chapsect="+parm_str+a_state+"&standard="+params["standard"];
    }else{
       document.location = SHELL_CONTENT_PATH+"randomproblems.htm?type=S-SELF&book="+
        SHELL_BOOK_INFO["bookcode"]+"&chapsect="+parm_str+a_state;
    }
  }
}

function h_shockwavehelp(){
 var help_string = shockwave_install_help();
 iGetDiv("shockwave_help_container").innerHTML = ""+NL+
 "<!--<a href=\"javascript:self.history.back();\" class=\"sysreq\"><b>Back</b></a>-->"+NL+
 shockwave_install_help()+NL+
 "<!--<a href=\"javascript:self.history.back();\" class=\"sysreq\"><b>Back</b></a>-->"+NL;
 iGetDiv("shockwave_help_link").style.visibility = "hidden";
 iGetDiv("shockwave_help_text").style.visibility = "hidden";
}
function h_flashhelp(){
 var help_string = flash_install_help();
 iGetDiv("flash_help_container").innerHTML = ""+NL+
 "<!--<a href=\"javascript:self.history.back();\" class=\"sysreq\"><b>Back</b></a>-->"+NL+
 flash_install_help()+NL+
 "<!--<a href=\"javascript:self.history.back();\" class=\"sysreq\"><b>Back</b></a>-->"+NL;
 iGetDiv("flash_help_link").style.visibility = "hidden";
 iGetDiv("flash_help_text").style.visibility = "hidden";
}
function h_backtoUSMAP()
{
document.location = SHELL_CONTENT_PATH+"usmap.htm";
iUpdate_Tracking(-1,-1,-1);
}
function h_Select_State(st){
   if(st == "-1") return;
   iSet_state_cookie(st);
   document.location = SHELL_CONTENT_PATH+"mainmenu.htm?state=" + st;
}
fSHLoaded = true;

