// this proloads all the rollovers and such
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}


if (document.images) 
{
		imgs01 = newImage("images/mainGlossaryHi_04.gif");
		imgs02 = newImage("images/mainGlossaryHi_05.gif");
		imgs03 = newImage("images/mainGlossaryDn_04.gif");
		imgs04 = newImage("images/mainGlossaryDn_05.gif");
		imgs05 = newImage("images/mainHelpHi_04.gif");
		imgs06 = newImage("images/mainHelpHi_05.gif");
		imgs07 = newImage("images/mainHelpHi_06.gif");
		imgs08 = newImage("images/mainHelpDn_04.gif");
		imgs09 = newImage("images/mainHelpDn_05.gif");
		imgs10 = newImage("images/mainHelpDn_06.gif");
		imgs11 = newImage("images/mainCloseHi_05.gif");
		imgs12 = newImage("images/mainCloseHi_06.gif");
		imgs13 = newImage("images/mainCloseDn_05.gif");
		imgs14 = newImage("images/mainCloseDn_06.gif");
		imgs15 = newImage("images/mainHi_10.gif");
		imgs16 = newImage("images/mainDn_10.gif");
		imgs17 = newImage("images/mainHi_11.gif");
		imgs18 = newImage("images/mainDn_11.gif");
		imgs19 = newImage("images/mainHi_16.gif");
		imgs20 = newImage("images/mainDn_16.gif");
		imgs21 = newImage("images/mainHi_17.gif");
		imgs22 = newImage("images/mainDn_17.gif");
		imgs23 = newImage("images/DetailsCloseHi_02.gif");
		imgs24 = newImage("images/DetailsCloseHi_03.gif");
		imgs25 = newImage("images/DetailsCloseHi_06.gif");
		imgs26 = newImage("images/DetailsCloseHi_07.gif");
		imgs27 = newImage("images/DetailsCloseDn_02.gif");
		imgs28 = newImage("images/DetailsCloseDn_03.gif");
		imgs29 = newImage("images/DetailsCloseDn_06.gif");
		imgs30 = newImage("images/DetailsCloseDn_07.gif");
		imgs31 = newImage("images/buttonSubmitHi.gif");
		imgs32 = newImage("images/buttonSubmitDn.gif");
		imgs33 = newImage("images/ExtraScreenCloseHi_03.gif");
		imgs34 = newImage("images/ExtraScreenCloseHi_04.gif");
		imgs35 = newImage("images/ExtraScreenPrintHi_03.gif");
		imgs36 = newImage("images/ExtraScreenPrintHi_04.gif");
		imgs37 = newImage("images/ExtraScreenCloseDn_03.gif");
		imgs38 = newImage("images/ExtraScreenCloseDn_04.gif");
		imgs39 = newImage("images/ExtraScreenPrintDn_03.gif");
		imgs40 = newImage("images/ExtraScreenPrintDn_04.gif");
		imgs41 = newImage("images/vidholderBigHi_06.gif");
		imgs42 = newImage("images/vidholderBigHi_07.gif");
		imgs43 = newImage("images/vidholderBigHi_08.gif");
		imgs44 = newImage("images/vidholderBigDn_06.gif");
		imgs45 = newImage("images/vidholderBigDn_07.gif");
		imgs46 = newImage("images/vidholderBigDn_08.gif");
		imgs47 = newImage("images/vidholderBig_06.gif");
		imgs48 = newImage("images/vidholderBig_07.gif");
		imgs49 = newImage("images/vidholderBig_08.gif");
		imgs40 = newImage("images/vidholderBig_06.gif");
		imgs41 = newImage("images/vidholderBig_07.gif");
		imgs42 = newImage("images/vidholderBig_08.gif");
}



var contentFrame = parent;

/* Initialize within-SCO navigation Tracking Variables. */
var numberOfPages = scoPages.length - 1; // number of pages in the SCO
var pageNumber = 1;      // point to current page within an SCO
var currentSCOPage = 1;  // variable used to point to the current page number within an SCO

function LoadFirstPage()
{
//SCOContentFrame.location = scoPages[1];  // set first page of content
}

function goToNextPage () 
{
   if(currentSCOPage < numberOfPages)
   	{
      currentSCOPage = currentSCOPage + 1;
      //contentFrame.SCOContentFrame.location =  "../" + parent.scoPages[currentSCOPage];
	  //alert(scoPages[currentSCOPage])
      SCOContentFrame.location.href =  scoPages[currentSCOPage];
   	}
	else
	{
      //alert("This is the last page. How much further would you like to go?  :-)");
   	}
}

/* 
Function used to go to the previous page in the SCO, which could be the first page or
an attempt to backup to the previous SCO (which is not allowed)
*/
function goToPreviousPage () {
   if(currentSCOPage !=1){
      currentSCOPage = currentSCOPage - 1;
      //contentFrame.SCOContentFrame.location = "../" +  parent.scoPages[currentSCOPage];
	  //alert(scoPages[currentSCOPage])
      SCOContentFrame.location.href =  scoPages[currentSCOPage];
   }else{
      //alert("This is the 1st Page.  Cut it out already.");
   }
}



var vFirstPage = scoPages[1]

function GetBookmark(fromself)
{
if(parent.displayMethod != 'SCORM')
	{
		
		if(ISDBSbookmark && ISDBSpagelevelBM == 1)
		{
			
		for(var ndx=0; ndx < scoPages.length; ++ndx)
			{
				if(scoPages[ndx] == strBookmark)
					{
					currentSCOPage = ndx
					}
			}			
			
		ok = confirm('Would you like to resume where you left off, or start the lesson from the beginning?\n\nClick on OK to resume where you left off.\n\nClick on Cancel to start the lesson from the beginning.')
			if(ok == true)
				{window.SCOContentFrame.document.location.href = ISDBSbookmark;}
			else
				{currentSCOPage = 1;window.SCOContentFrame.document.location.href = vFirstPage;}
		}
		else
		{
		window.SCOContentFrame.document.location.href = vFirstPage;
		}
			
			
	}
else
	{		
			var strBookmark;			
			strBookmark = doLMSGetValue("cmi.core.lesson_location");
						
			if (strBookmark == "")
				{
					window.SCOContentFrame.document.location.href = vFirstPage;
				}
			else
				{
				for(var ndx=0; ndx < scoPages.length; ++ndx)
					{
						if(scoPages[ndx] == strBookmark)
							{
							currentSCOPage = ndx
							}
					}			
			
					ok = confirm('Would you like to resume where you left off, or start the lesson from the beginning?\n\nClick on OK to resume where you left off.\n\nClick on Cancel to start the lesson from the beginning.')
						if(ok == true)
							{window.SCOContentFrame.document.location.href = strBookmark;}
						else
							{currentSCOPage = 1;window.SCOContentFrame.document.location.href = vFirstPage;}
					
				}
	}	
}


function SetSCORMbookmark(strBookmark)
{
//get only the page name
	var intPos = strBookmark.lastIndexOf("/");
	
	if (intPos == -1){
		strPageName = strBookmark;
	}
	else{
		strPageName = strBookmark.substring(intPos + 1, strBookmark.length);
	}
	
	doLMSSetValue("cmi.core.lesson_location", strPageName);	
}

function SetISDBSbookmark(strBookmark)
{
//get only the page name
	var intPos = strBookmark.lastIndexOf("/");
	
	if (intPos == -1){
		strPageName = strBookmark;
	}
	else{
		strPageName = strBookmark.substring(intPos + 1, strBookmark.length);
	}
	
	//alert('The page bookmark is: ' + strPageName);	
	if(displayMethod == 'ISDBS' && ISDBSpagelevelBM == 1)
	{window.blank.location = ISDBSbookmarkURL + '?BMtext=' + strPageName + '&lessonID=' + ISDBSlessonID + '&studentID=' + ISDBSstudentID}
}


var blnIsFinished = false;
var strLessonStatus = "incomplete";

var allLoaded = false;			// set when all