<html>
<head>
<title>empty</title>
<script type="text/JavaScript">
// =============== Initialize variables ===================
var permAudio = true;
var questionCounter = 0;
var correctCounter = 0;
var currentPage = 1;
var Branch1 = 0;
var Branch2 = 0;
var Branch3 = 0;
var Branch4 = 0;
var Branch5 = 0;
var Branch6 = 0;
var Branch7 = 0;
var Branch8 = 0;
var Branch9 = 0;
var Branch10 = 0;
var Branch11 = 0;
var Branch12 = 0;
var Branch13 = 0;
var Branch14 = 0;
var Branch15 = 0;
var BrchRtrn = 0;
var bookmarkchecked = false;
var currentValue;
var thisCurrentValue = false;
var apiIsInitialized = false;
var ccPop;
var look;
var narration = new Object();
var storageObj = new Object();
var questionData = new Object();
var currentTime = new Date(); 
var startTime = currentTime.getTime();
var currentData = new Object();
currentData.names = new Array();
currentData.feedback = new Array();
var senarioData = new Object();
var answersArr = new Array({%questionAnswerArray%});
var pages_array = new Array();
var pages_names = "{%pages_array_names%}";
var page_names_array = new Array();
page_names_array = pages_names.split("|");
var pages_urls = "{%pages_array_urls%}";
var page_urls_array = new Array();
page_urls_array = pages_urls.split("|");
for(var i = 0; i <= page_names_array.length - 1; i++){
	pages_array.push(i);
	pages_array[i] = new Array();
	pages_array[i].push(page_names_array[i]);
	pages_array[i].push(page_urls_array[i]);
}

// =======================================================

function fillVars() {
parent.topEmpty.userName = top.userName;
parent.topEmpty.audioState = "on";
}

</script>

<script type="text/javascript" src="../../APIWrapper.js"></script>
<script type="text/javascript" src="../../SCOFunctions.js"></script>
<script type="text/javascript" src="../../knowledgeCheckCode.js"></script>

<script type="text/javascript">

    // ========== LOAD SCOMAP ============	
	var xmlDoc;	
	var xmlhttp=false;	
	isLocal=false;
	
	var isIE = -1;
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		var ua = navigator.userAgent;
		var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null)
		isIE = parseFloat( RegExp.$1 );
	}	

	/* running locally on IE6, IE7 */      
     if(location.protocol=="file:"){
      if(!xmlhttp)try{ xmlhttp=new ActiveXObject("MSXML2.XMLHTTP"); }catch(e){xmlhttp=false;}
      if(!xmlhttp)try{ xmlhttp=new ActiveXObject("Microsoft.XMLDOM");; }catch(e){xmlhttp=false;}
	  isLocal=true;
     }                                                                                ; 
   /* IE7, Firefox, Safari, Opera, Chrome...  */
     if(!xmlhttp)try{ xmlhttp=new XMLHttpRequest(); }catch(e){xmlhttp=false;}
   /* IE6 */
     if(typeof ActiveXObject != "undefined"){
      if(!xmlhttp)try{ xmlhttp=new ActiveXObject("MSXML2.XMLHTTP"); }catch(e){xmlhttp=false;}
      if(!xmlhttp)try{ xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){xmlhttp=false;}
     }
	
	if(isLocal==true && isIE!=-1) {
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");		
		xmlDoc.async = "false";
		xmlDoc.load("scomap.xml");
	} else {
		xmlhttp.open("GET","scomap.xml",false);
		xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState!=4)return;

		};//onreadystatechange
		xmlhttp.send(null);
	
		xmlDoc=xmlhttp.responseXML;	
	}
    // =====================================
    
    function bookmarkThis(){
    
	    if (LMSIsInitialized()) {
	    
		     var entry = LMSGetValue("cmi.core.entry");
		     
		     if(entry != "ab-initio"){
		     
		         var oldLoc = LMSGetValue("cmi.core.lesson_location");
			     thisPath = oldLoc + ""; 
			     mySliceFileName = thisPath.lastIndexOf("/");
			     mySliceFileName += 1;
			     
			     var old_loc = thisPath.slice(mySliceFileName);			 
			     var reg = new RegExp("page");
			     
		         if(reg.test(old_loc)&&bookmarkchecked == false && old_loc != '' &&	old_loc.indexOf( '.' ) > 0 && confirm( 'You have previously been in this lesson.\nWould you like to return to the last visited location in the lesson?' ) == true ){

		              parent.contentFrame=old_loc;
		         }
		         
		     } else {
		 	    LMSSetValue("cmi.core.lesson_location","");
		     }
		     
	         bookmarkchecked = true;
	    }
    }
    
    function beginSCO() {
        
        fillVars();
        
        // Initialize API
        LMSInitialize();
        
         if (LMSIsInitialized()) {
	        currentValue = LMSGetValue("cmi.core.lesson_status");
	        if (currentValue != "completed") {
	            LMSSetValue("cmi.core.lesson_status", "incomplete");
	        }
	        var ii;
            do { 
                 ii = ii + 1; 
            } 
            while ((apiIsInitialized == false) && (ii < 500)); 
            
	        startTimer();
	        bookmarkThis();
       }
    }
    
    function doContinue(){
    
	    doSetValue("adl.nav.request", "continue");
	    this.top.close();
	   
	    alreadyTerminated = true;
    }

    function doPrevious(){
    
	    doSetValue("adl.nav.request", "previous");
	    this.top.close();

	    alreadyTerminated = true;
    }


</script> 


</head>

{%customEmpty%}

<body onLoad="beginSCO();" onUnload="if(thisCurrentValue==true && currentValue!='complete'){doQuit('completed');}else{doQuit_inc('incomplete');}">
</body>

</html>
