var gPageIndex=0;var gLastPageIndex=-1;var gTerminated=false;var winPopup=null;var winGlossary=null;var API=null;var gInteractionsTotal=-1;var bCourseComplete=false;var nCourseScore;var bFinal=true;if(navigator.appName.toLowerCase().indexOf("explorer")>-1){var mdi=textSizes[1],sml=textSizes[2];}else{var mdi=textSizes[3],sml=textSizes[4];}function initialize(){initTOC();initAPI(window);LMSInitialize();reDisplay(tocTab[fetchpage()][0],true);toc.focus();}function terminate(){if(!gTerminated){gTerminated=true;savepage();LMSFinish();}}function setPage(url){if(bFinal){return url;}else{urlparts=url.split("/");finalurl="";var length=urlparts.length-1;var i;for(i=0;i<length;i++){finalurl=finalurl+urlparts[i]+"/";}finalurl=finalurl+"storyboard_"+urlparts[length];return finalurl;}}function reDisplay(currentNumber,currentIsExpanded){toc.document.open();var dir=window.location.href.substring(0,window.location.href.lastIndexOf('\/'))+"/";var baseref="<base href=\""+dir+"\">\n";var s="<html>\n<head>\n"+baseref;s+="<link href='style_toc.css' rel='stylesheet' type='text/css'>\n";s+="<SCRIPT>\nif (window.addEventListener)\n\twindow.addEventListener(\"keypress\",trapKeyNS,false);\nelse\n\tdocument.onkeydown = trapKeyIE;\nfunction trapKeyNS(evt)\n{\n\tparent.keyNavigate(evt.keyCode);\n}\nfunction trapKeyIE()\n{\n\tparent.keyNavigate(event.keyCode);\n}\n<\/SCRIPT>\n</head>\n";s+="<body style=\"margin-left:0.5em\" bgcolor=\""+backColor+"\">\n<table border=0 cellspacing=1 cellpadding=0>\n";var currentNumArray=currentNumber.split(".");var currentLevel=currentNumArray.length-1;var scrollY=0,addScroll=true,theHref="";for(i=0;i<tocTab.length;i++){thisNumber=tocTab[i][0];var isCurrentNumber=(thisNumber==currentNumber);if(isCurrentNumber){theHref=tocTab[i][2];theHref=setPage(theHref);if(theHref!="")content.location.href=dir+theHref;rememberpage(i);}var thisNumArray=thisNumber.split(".");var thisLevel=thisNumArray.length-1;var toDisplay=true;if(thisLevel>0){for(j=0;j<thisLevel;j++){toDisplay=(j>currentLevel)?false:toDisplay&&(thisNumArray[j]==currentNumArray[j]);}}thisIsExpanded=toDisplay&&(thisNumArray[thisLevel]==currentNumArray[thisLevel]);if(currentIsExpanded){toDisplay=toDisplay&&(thisLevel<=currentLevel);if(isCurrentNumber)thisIsExpanded=false;}if(toDisplay){if(addScroll)scrollY+=((thisLevel<2)?mdi:sml)*25;if(isCurrentNumber)addScroll=false;var isLeaf=(i==tocTab.length-1)||(thisLevel>=tocTab[i+1][0].split(".").length-1);img=(isLeaf)?"leaf":(thisIsExpanded)?"minus":"plus";s+="<tr>";for(k=1;k<=thisLevel;k++){s+="<td>&nbsp;</td>";}s+="<td valign=top><a href=\"javaScript:parent.reDisplay('"+thisNumber+"',"+thisIsExpanded+");\"><img src=\"images/"+img+".gif\" width=13 height=12 border=0></a></td><td colspan="+(nCols-thisLevel)+"><a href=\"javaScript:\parent.reDisplay('"+thisNumber+"',"+thisIsExpanded+")\" style=\"font-family: "+fontLines+";"+((thisLevel<=mLevel)?"font-weight:bold":"")+"; font-size:"+((thisLevel<=mLevel)?mdi:sml)+"em; color: "+((isCurrentNumber)?currentColor:normalColor)+"; text-decoration:none\">"+((showNumbers)?(thisNumber+" "):"")+tocTab[i][1]+"</a></td></tr>";}}s+="</table>\n</body>\n</html>";toc.document.write(s);toc.document.close();if(toc.innerHeight){toc.scrollTo(0,scrollY-mdi*25);}else{if((scrollY+mdi*25)>toc.document.body.offsetHeight)toc.scrollTo(0,scrollY);}}function previous(){if(gPageIndex>0){reDisplay(tocTab[gPageIndex-1][0],false);}}function next(){if(gPageIndex<(tocTab.length-1)){reDisplay(tocTab[gPageIndex+1][0],false);}}function keyNavigate(key){if(key==37||key==38)previous();if(key==39||key==40)next();}function important(){showPopup("important");}function caution(){showPopup("caution");}function example(){showPopup("example");}function glossary(){winGlossary=window.open("glossary.htm","glossary","left=100,top=50,height=300,width=600,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");winGlossary.focus();}function showPopup(bookmark){var url=parent.content.location.href;urlparts=url.split("/");finalurl="";var length=urlparts.length-1;var i;for(i=0;i<length;i++){finalurl=finalurl+urlparts[i]+"/";}finalurl=finalurl+"popup_"+urlparts[length]+"#"+bookmark;winPopup=window.open(finalurl,"popup","left=100,top=50,height=300,width=600,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");winPopup.focus();}function fetchpage(){var lastData=LMSGetValue("cmi.suspend_data");if(LMSGetLastError()=="0"){if(lastData!=""){arrayAll=lastData.split("\u00bd");var nLength=arrayAll.length;for(i=0;i<nLength;i++){arraySingle=arrayAll[i].split("\u00be");var j=arraySingle[0];if(j=="")break;tocTab[j][4]=arraySingle[1];tocTab[j][5]=arraySingle[2];tocTab[j][6]=arraySingle[3];}}}var lastPage=LMSGetValue("cmi.core.lesson_location");if(lastPage=="")return 0;return lastPage;}function savepage(){if(bCourseComplete){LMSSetValue("cmi.core.score.min","0");LMSSetValue("cmi.core.score.max","100");LMSSetValue("cmi.core.score.raw",nCourseScore);LMSSetValue("cmi.core.lesson_status","passed");LMSSetValue("cmi.core.exit","");}else{LMSSetValue("cmi.core.exit","suspend");LMSSetValue("cmi.core.lesson_status","incomplete");}LMSSetValue("cmi.core.lesson_location",gPageIndex+"");var lastData="";for(i=0;i<nArray;i++){if(tocTab[i][4]!=""){lastData=lastData+i+"\u00be"+tocTab[i][4]+"\u00be"+tocTab[i][5]+"\u00be"+tocTab[i][6]+"\u00bd";}}LMSSetValue("cmi.suspend_data",lastData);LMSSetValue("cmi.core.session_time",getSessionTime());}function rememberpage(index){gLastPageIndex=gPageIndex;gPageIndex=index;}function findAPI(win){while((win.API==null)&&(win.parent!=null)&&(win.parent!=win)){win=win.parent;}API=win.API;}function initAPI(win){findAPI(win);if((API==null)&&(win.opener!=null)){findAPI(win.opener);}}function LMSInitialize(){if(API==null)return "false";var result=API.LMSInitialize("");return result;}function LMSFinish(){if(API==null)return "false";var result=API.LMSFinish("");API==null;return result;}function LMSGetValue(name){if(API==null)return "";var value=API.LMSGetValue(name);var errCode=API.LMSGetLastError();if(errCode!="0"){return "";}else{return value;}}function LMSSetValue(name,value){if(API==null)return "";var result=API.LMSSetValue(name,value+"");return result;}function LMSGetLastError(){if(API==null){return "401";}return API.LMSGetLastError();}function SetInteraction(type,response,correct,weight){var iString;tocTab[gLastPageIndex][4]=response;tocTab[gLastPageIndex][5]=correct;tocTab[gLastPageIndex][6]=type;if(gInteractionsTotal==-1){gInteractionsTotal=LMSGetValue("cmi.interactions._count");if(LMSGetLastError()!="0"){gInteractionsTotal=0;}}iString="cmi.interactions."+gInteractionsTotal+".";LMSSetValue(iString+"id",tocTab[gLastPageIndex][0]);LMSSetValue(iString+"type",type);LMSSetValue(iString+"student_response",response);LMSSetValue(iString+"weighting",weight);if(type=="true-false"||type=="choice"||type=="sequencing"){LMSSetValue(iString+"correct_responses.0.pattern",correct);if(response==correct)LMSSetValue(iString+"result","correct");else LMSSetValue(iString+"result","wrong");}else{LMSSetValue(iString+"result","neutral");}gInteractionsTotal++;}function GetInteraction(){return tocTab[gPageIndex][4];}function GetLastSpeculation(){var level=GetPageLevel(gPageIndex);for(i=gPageIndex-1;i>0;i--){if(level==GetPageLevel(i)){if(tocTab[i][6]=="fill-in"){return tocTab[i][4];}}else{return "";}}}function GetPageLevel(index){var parts=tocTab[index][0].split(".");if(parts.length==1){return-1;}parts.length=parts.length-1;return parts.join();}dateStart=new Date();timeStart=dateStart.getTime();function getSessionTime(){dateNow=new Date();timeNow=dateNow.getTime();timeElapsed=Math.round((timeNow-timeStart)/1000);hh=Math.floor(timeElapsed/3600);timeElapsed-=hh*3600;mm=Math.floor(timeElapsed/60);timeElapsed-=mm*60;ss=timeElapsed;if(hh<10)hh="0"+hh;if(mm<10)mm="0"+mm;if(ss<10)ss="0"+ss;return hh+":"+mm+":"+ss;}