Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <HTML>
- <HEAD>
- <LINK REL="stylesheet" TITLE="default" HREF="../../templates/safetylearning/style.css" />
- <LINK REL="stylesheet" TITLE="default" HREF="../../templates/safetylearning/viewerint.css" />
- <TITLE></TITLE>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- var blSectionBarrier = false;
- var blOnlyNavWhenLoaded = true;
- var blFreeRoam = false;
- var blReviewSectionOnly = false;
- var blNavPrevDisabled = false;
- var blNavNextDisabled = false;
- var blEnableForce = false;
- var blIsAssessment = false;
- var bAssessmentModule = false;
- //updated by UL for Flash Fuctions
- var audioVolume=100;
- var transOpen="false";
- var backenb;
- var nextend = true;
- //
- var frag;
- function debugLog (strContent) {
- if (parent.hiddenLoaded) {parent.hiddenFrame.addLog(strContent);}
- }
- function addMenuItem(intSectionID, strSectionText) {
- if (parent.intMaxSection > intSectionID) {
- strClass="menuItemBox MenuTabTextUnSelected ";
- }else if (parent.intMaxSection == intSectionID) {
- strClass="menuItemBox MenuTabSelected MenuTabTextSelected";
- }else{
- strClass="menuItemBox MenuTabTextUnSelected";
- }
- return "<TR><TD onclick=\"javascript:loadPage("+intSectionID+",1,true);\" id=s"+intSectionID+" class =\"menuItemBox MenuTabTextUnSelected\">"+strSectionText+"</TD></TR>";
- }
- function addSummaryItem (intSectionID, intPageID, strSectionText) {
- strClass="menuItemLink";
- return "<TR><TD onclick=\"javascript:loadPage("+intSectionID+","+intPageID+",true);\" ID=\"s"+intPageID+"\" id=s"+intSectionID+" class =\"menuItemBox MenuTabTextUnSelected\">"+strSectionText+"</TD></TR>";
- }
- function buildMenu() {
- oMenu=document.getElementById('menuTableBody');
- sTableHeight = "";
- var iPercent = ((parent.oSections.length *20)-5);
- if(iPercent <=0)
- sTableHeight = " style=\"height:10%;\"";
- else
- if(iPercent <=60)
- sTableHeight = " style=\"height:" + iPercent + "%;\"";
- strMenu="<TABLE ID=\"menuTable\" CLASS=\"menuTable\" CELLPADDING=\"0\" CELLSPACING=\"1\" BORDER=\"0\" " + sTableHeight + "><TR><TD CLASS=\"menuTitle menuTitleBg\">Menu";
- if( parent.blSummary && blReviewSectionOnly) strMenu=strMenu+"<br> <font size = 2> Summary </font>";
- strMenu=strMenu+"</TD></TR>";
- if (!blReviewSectionOnly) {
- for (i=0; i < parent.oSections.length; i++) {
- if (parent.oSections[i].enabled) {strMenu+=addMenuItem((i+1),parent.oSections[i].sectionName);}
- }
- if (parent.blSummary) {strMenu+=addMenuItem((parent.oSections.length+1), "Summary");}
- if (parent.blChecklist) {strMenu+=addMenuItem((parent.oSections.length+2), "Checklist");}
- if (parent.blSelfTest) {strMenu+=addMenuItem((parent.oSections.length+3), "Selftest");}
- } else if (parent.blSummary) {
- }
- strMenu+="</TABLE>";
- oMenu.innerHTML=strMenu;
- }
- function saveProgress(n) {
- if (n<11) { // Waits 10 deciseconds (1 second) for the hidden frame to load.
- if (!parent.hiddenLoaded) {
- debugLog("saveProgress("+n+"); failed");
- setTimeout("saveProgress("+(n+1)+");", 100);
- }else{
- if (parent.intMaxSection>=parent.oSections.length+4) {blCompleted=1;}else{blCompleted=0;}
- debugLog("saveProgress("+n+"); saving Module[218] Section["+parent.intMaxSection+"] Page["+parent.intMaxPage+"] Completed["+blCompleted+"]");
- parent.hiddenFrame.setPage(218, parent.intMaxSection, parent.intMaxPage, blCompleted);
- }
- }
- }
- function saveVideoProgress(n,bookmark) {
- if (n<11) { // Waits 10 deciseconds (1 second) for the hidden frame to load.
- if (!parent.hiddenLoaded) {
- debugLog("saveVideoProgress("+n+","+bookmark+"); failed");
- setTimeout("saveVideoProgress("+(n+1)+","+bookmark+");", 100);
- }else{
- if (parent.intMaxSection>=parent.oSections.length+4) {blCompleted=1;}else{blCompleted=0;}
- debugLog("saveVideoProgress("+n+","+bookmark+"); saving Module[218] Section["+parent.intMaxSection+"] ["+bookmark+"] Completed["+blCompleted+"]");
- if (parent.hiddenFrame.setVideoPage) parent.hiddenFrame.setVideoPage(218, parent.intMaxSection, bookmark, blCompleted);
- }
- }
- }
- function canMenuNav(intSection, intPage) {
- intTrueSection=parent.intCurrentSection;
- blCanNav = true;
- if (parent.intMaxSection<intSection && !blFreeRoam) {blCanNav=false;}
- if (!blCanNav) {
- if (intTrueSection > 0 && intTrueSection <= parent.oSections.length) { // Regular Sections
- if (intSection==parent.intMaxSection+1 && intPage==1 && parent.intMaxPage>=parent.oSections[intSection-2].pages) {blCanNav=true;}
- }
- if (intTrueSection == parent.oSections.length+1) { // Summary Section
- }
- }
- debugLog("canMenuNav("+intSection+", "+intPage+"); : returns "+blCanNav+";");
- if (bAssessmentModule)
- blCanNav = true;
- return blCanNav;
- }
- function loadPage(intSection, intPage, blMenuNav) {
- debugLog ("");
- blNoNav=false;
- parent.hiddenFrame.intCycle=0;
- if (blMenuNav && intSection>1) {blNoNav = !canMenuNav(intSection, intPage);}else{blNoNav=false;}
- parent.navFrame.blCPS=false; parent.navFrame.resetFrameset();
- if (parent.blClassroom) {parent.cpsFrame.resetInput();}
- strURL="";
- if (blNoNav && !blReviewSectionOnly)
- {
- alert('Cannot begin section '+intSection+', because section '+parent.intCurrentSection+' needs to be completed');
- }
- else if(blMenuNav && parent.blLockInSelfTest && parent.intCurrentSection == parent.oSections.length+3)
- {
- alert('Can not revisit sections once you have started the self test');
- }
- else
- {
- if (intSection == parent.oSections.length+1) { //Summary
- blIsAssessment = false;
- parent.intCurrentSection=intSection;
- parent.intCurrentPage=intPage;
- pageLoading();
- strURL = "translate.php?c=dseflashint&s="+intSection+"&p="+intPage;
- }else if (intSection == parent.oSections.length+2 && !blReviewSectionOnly) { //Checklist
- blIsAssessment = true;
- strURL = "translate.php?v=checklist&c=dseflashint&p="+parent.intCurrentPage;
- parent.intCurrentSection=intSection;
- parent.intCurrentPage=intPage;
- }else if (intSection == parent.oSections.length+3 && !blReviewSectionOnly) { //Self Test
- blIsAssessment = true;
- strURL = "translate.php?v=selftest&c=dseflashint&p="+parent.intCurrentPage;
- parent.intCurrentSection=intSection;
- parent.intCurrentPage=intPage;
- }else if (intSection > parent.oSections.length+3 && !blReviewSectionOnly) { //Completion Page
- blIsAssessment = true;
- parent.intCurrentSection=intSection;
- parent.intCurrentPage=intPage;
- strURL = "translate.php?v=finish&c=dseflashint";
- }else if (intSection > 0 && intSection <= parent.oSections.length && !blReviewSectionOnly) {
- blIsAssessment = false;
- if ((intPage > 0 && intPage <= parent.oSections[intSection-1].pages) || (parent.oSections[intSection-1].video)) { //Regular Page
- if (parent.blNew) {intSection=1; intPage=1; parent.blNew=false;}
- parent.intCurrentSection=intSection;
- parent.intCurrentPage=intPage;
- pageLoading();
- strURL = "translate.php?c=dseflashint&s="+intSection+"&p="+intPage;
- if (parent.oSections[intSection-1].video)
- strURL+="&video=true";
- }
- else{
- navNext();
- }
- }
- if (strURL.length>0) {
- if (parent.intClassID>0) {strURL+="&cid="+parent.intClassID;}
- parent.navNextFunction = "";
- parent.mainFrame.location.href = strURL;
- }
- blSavePage = false;
- if (parent.intCurrentSection > parent.intMaxSection) {parent.intMaxSection=parent.intCurrentSection; parent.intMaxPage=1; blSavePage=true;}
- if (parent.intCurrentSection == parent.intMaxSection && parent.intCurrentPage > parent.intMaxPage) {parent.intMaxPage=parent.intCurrentPage; blSavePage=true;}
- if (intSection <= parent.oSections.length) {
- if (blSavePage && !parent.oSections[intSection-1].video) {saveProgress(0);}
- }else{
- if (blSavePage) {saveProgress(0);}
- }
- if (isNextAvailable() && !blOnlyNavWhenLoaded && (!blIsAssessment || parent.blClassroom)) {navNextEnable();}else{navNextDisable();}
- if (isPrevAvailable() && (!blIsAssessment || parent.blClassroom)) {navPrevEnable();}else{navPrevDisable();}
- }
- debugLog ("loadPage("+intSection+", "+intPage+", "+blMenuNav+"); [URL:"+strURL+"]");
- debugLog ("current status: section="+parent.intCurrentSection+" page="+parent.intCurrentPage+"; maximum status: section="+parent.intMaxSection+" page="+parent.intMaxPage+";");
- refreshMenu();
- }
- function isNextAvailable() {
- if (parent.intCurrentSection>0) {
- if (parent.intCurrentSection <= parent.oSections.length ) {
- if (parent.intCurrentPage < parent.oSections[parent.intCurrentSection-1].pages+1) {
- return true;
- }else if (!blSectionBarrier) {
- if (parent.intCurrentSection < parent.oSections.length) {return true;}
- if (parent.intCurrentSection == parent.oSections.length && (parent.blSummary || parent.blSelfTest || parent.blChecklist)) {return true;}
- }
- }else{
- if (parent.intCurrentSection == parent.oSections.length+1 && parent.blSummary) {
- if (parent.intCurrentPage < parent.oSections.length) {return true;}
- if (!blSectionBarrier) {
- if (parent.blSelfTest || parent.blChecklist) {return true;}
- }
- }
- if (parent.intCurrentSection == parent.oSections.length+2 && parent.blChecklist) {return true;}
- if (parent.intCurrentSection == parent.oSections.length+3 && parent.blSelfTest) {return true;}
- }
- }else{
- return true;
- }
- return false;
- }
- function isPrevAvailable() {
- if (parent.intCurrentPage > 1) {
- return true;
- }else if (!blSectionBarrier) {
- if (parent.intCurrentSection > 1) {return true;}
- }
- return false;
- }
- function navNext() {
- if (!blNavNextDisabled && ((blOnlyNavWhenLoaded && parent.pageLoaded) || !blOnlyNavWhenLoaded)) {
- if (parent.navNextFunction.length > 0) {doNavNextFunction();return true;}
- if (parent.intCurrentSection <= parent.oSections.length && parent.intCurrentPage < parent.oSections[parent.intCurrentSection-1].pages+1) {
- parent.intCurrentPage++;
- }else if ((parent.intCurrentSection == parent.oSections.length+1 && parent.blSummary) && (parent.intCurrentPage < parent.oSections.length)) {
- parent.intCurrentPage++;
- }else if (!blSectionBarrier && !blReviewSectionOnly) {
- parent.intCurrentSection++;
- if (parent.intCurrentSection == parent.oSections.length+1 && !parent.blSummary) {parent.intCurrentSection++;}
- if (parent.intCurrentSection == parent.oSections.length+2 && !parent.blChecklist) {parent.intCurrentSection++;}
- if (parent.intCurrentSection == parent.oSections.length+3 && !parent.blSelfTest) {parent.intCurrentSection++;}
- if (parent.intCurrentSection > parent.oSections.length+3) {
- // Completed this module
- // Show finishing page
- }else{
- parent.intCurrentPage=1;
- }
- }
- loadPage(parent.intCurrentSection, parent.intCurrentPage, false);
- if (blOnlyNavWhenLoaded) {
- pageLoading();
- }
- }
- }
- function doNavNextFunction() {
- if (parent.navNextFunction.length > 0) {
- eval(parent.navNextFunction);
- parent.navNextFunction='';
- }
- }
- function navPrev() {
- if (!blNavPrevDisabled) {
- if (parent.intCurrentPage > 1) {
- parent.intCurrentPage--;
- }else if (!blSectionBarrier) {
- if (parent.intCurrentSection > 1 && parent.intCurrentSection <= parent.oSections.length) {
- parent.intCurrentSection--;
- parent.intCurrentPage = parent.oSections[parent.intCurrentSection-1].pages;
- }
- //if (parent.intCurrentSection == parent.oSections.length+1 && !parent.blSummary) {parent.intCurrentSection--;}
- //if (parent.intCurrentSection == parent.oSections.length+2 && !parent.blChecklist) {parent.intCurrentSection--;}
- }
- loadPage(parent.intCurrentSection, parent.intCurrentPage, false);
- }
- }
- function navPrevDisable() {
- if (!blNavPrevDisabled || blEnableForce) {
- blNavPrevDisabled = true;
- //parent.navFrame.navPrevLink.className="navButtonLinkDis";
- parent.navFrame.navPrevImage.src = parent.navFrame.navImgPrevDis.src;
- }
- }
- function navPrevEnable() {
- if (blNavPrevDisabled || blEnableForce) {
- blNavPrevDisabled = false;
- //parent.navFrame.navPrevLink.className="navButtonLink";
- parent.navFrame.navPrevImage.src = parent.navFrame.navImgPrev.src;
- }
- }
- function navNextDisable() {
- if (!blNavNextDisabled || blEnableForce) {
- blNavNextDisabled = true;
- //parent.navFrame.navNextLink.className="navButtonLinkDis";
- parent.navFrame.navNextImage.src = parent.navFrame.navImgNextDis.src;
- if (blSectionBarrier) {parent.navFrame.navSetStatus("Please click on the next section to continue training");}
- }
- }
- function navNextEnable() {
- if (blNavNextDisabled || blEnableForce) {
- blNavNextDisabled = false;
- parent.navFrame.navNextImage.src = parent.navFrame.navImgNext.src;
- if (blSectionBarrier) {parent.navFrame.statusBar.innerHTML="";}
- }
- }
- function pageLoading() {
- parent.pageLoaded = false;
- if (!blNavNextDisabled) {
- if (blOnlyNavWhenLoaded) {
- navNextDisable();
- }else{
- navNextEnable();
- }
- }
- }
- function pageLoaded() {
- parent.pageLoaded=true;
- checkNav();
- }
- function refreshMenu() {
- if(blReviewSectionOnly) {
- for (i=1; i<=1;i++) {
- if (i==parent.intCurrentPage ) {
- strClass="menuItemBox MenuTabTextSelected MenuTabSelected";
- }else{
- strClass="menuItemBox MenuTabTextUnSelected";
- }
- try {
- document.getElementById('s'+i).className = strClass;
- } catch (e) {;}
- }
- debugLog("refreshSummaryMenu();");
- }else {
- for (i=1; i<=parent.oSections.length+3;i++){
- if (i==parent.intCurrentSection){
- strClass="menuItemBox MenuTabTextSelected MenuTabSelected";
- }else if (i < parent.intCurrentSection) {
- strClass="menuItemBox MenuTabTextUnSelected MenuTabUnSelected";
- }else{
- strClass="menuItemBox MenuTabTextUnSelected";
- if (i==parent.intMaxSection){
- if (parent.intMaxSection <= parent.oSections.length){
- if (parent.intMaxPage>=parent.oSections[parent.intMaxSection-1].pages-1) {
- strClass = 'menuItemBox MenuTabTextUnSelected';
- }
- }
- if (parent.intMaxSection == parent.oSections.length+1) {
- if (parent.intMaxPage>=parent.oSections.length-1) {
- strClass = 'menuItemBox MenuTabTextUnSelected';}
- }
- }
- }
- try {
- document.getElementById('s'+i).className = strClass;
- } catch (e) {;}
- }
- debugLog("refreshMenu();");
- }
- }
- function checkNav() {
- blEnableForce=true;
- if ((parent.pageLoaded || !blOnlyNavWhenLoaded) && (!blIsAssessment || parent.blClassroom)) {
- if (isNextAvailable() )
- {navNextEnable();}
- else
- {navNextDisable();}
- }else{
- navNextDisable();
- }
- if(bAssessmentModule && !blIsAssessment)
- navNextEnable();
- if (isPrevAvailable() && (!blIsAssessment || parent.blClassroom)) {navPrevEnable();}else{navPrevDisable();}
- blEnableForce=false;
- }
- function StandAloneChecklist(){
- bAssessmentModule = true;
- }
- var navPrevImage;
- var navPrevImage;
- var blDebug = false;
- var blCPS = false;
- var navImgPrevDis = new Image(); navImgPrevDis.src = '../../templates/safetylearning/images/moduleviewer/left1-dis.gif';
- var navImgPrev = new Image(); navImgPrev.src = '../../templates/safetylearning/images/moduleviewer/left1.gif';
- var navImgPrevHigh = new Image(); navImgPrevHigh.src = '../../templates/safetylearning/images/moduleviewer/left2.gif';
- var navImgNextDis = new Image(); navImgNextDis.src = '../../templates/safetylearning/images/moduleviewer/right1-dis.gif';
- var navImgNext = new Image(); navImgNext.src = '../../templates/safetylearning/images/moduleviewer/right1.gif';
- var navImgNextHigh = new Image(); navImgNextHigh.src = '../../templates/safetylearning/images/moduleviewer/right2.gif';
- function navPrevDance() {
- if (isPrevAvailable()) {
- parent.navFrame.navPrevImage.src = parent.navFrame.navImgPrevHigh.src;
- setTimeout("parent.navFrame.navPrevImage.src = parent.navFrame.navImgPrev.src;", 300);
- }
- }
- function navNextDance() {
- if (isNextAvailable()) {
- parent.navFrame.navNextImage.src = parent.navFrame.navImgNextHigh.src;
- setTimeout("parent.navFrame.navNextImage.src = parent.navFrame.navImgNext.src;", 300);
- }
- }
- //-->
- </SCRIPT>
- </HEAD>
- <BODY onLoad="parent.menuLoaded=true;" id="menubg">
- <DIV ID="menuTableBody">
- </DIV>
- <BR />
- </BODY>
- </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement