/* Copyright © 2001 PureWorks, Inc.  All Rights Reserved. */



/*

The following functions are available to PSPREVIEWize this content to work in 
any LMS.  Each of these functions can be implemented in any way you wish, so
long as you adhere to the following standards:

-all module level variables must have the prefix PSPREVIEW_
-all function names must begin with the prefix PSPREVIEW_
-all existing functions must be present and implement the specified interface and return values

*/



var objPSPREVIEWStandard = new Object;
	
objPSPREVIEWStandard.Initialize = PSPREVIEW_Initialize;
objPSPREVIEWStandard.Finish = PSPREVIEW_Finish;
objPSPREVIEWStandard.CommitData = PSPREVIEW_Commit;
objPSPREVIEWStandard.SetBookmark = PSPREVIEW_SetBookmark;
objPSPREVIEWStandard.GetBookmark = PSPREVIEW_GetBookmark;
objPSPREVIEWStandard.GetLastError = PSPREVIEW_GetLastError;
objPSPREVIEWStandard.GetErrorDescription = PSPREVIEW_GetErrorDescription;
	
	
	
/*
Initialize is called when the content is loaded.
Purpose: perform any initialization necessary
Parameters: none
Return value: boolean indicating success or failure
*/	
function PSPREVIEW_Initialize(){

	return true;
}



/*
Finish is called from 3 places
  1. When the page cotaining the content is unloaded
  2. When the user elects to "Save and Exit"
  3. When the content is complete and the user clicks "OK"
Purpose: perform any task necessary when the user exits
Parameters: 
	blnReachedEnd (boolean) true = user reached the last slide
							false = user did not reach the last slide
	
	strExitType (string, defined by constant exit type) 
				EXIT_TYPE_UNLOAD = "UNLOAD" - this value is used in Finish scenerio 1
				EXIT_TYPE_PUNT = "PUNT" - this value is used in Finish scenerio 2
				EXIT_TYPE_FINISHED = "FINISHED" - this value is used in Finish scenerio 3

Return value: boolean indicating success or failure
*/
function PSPREVIEW_Finish(blnReachedEnd, strExitType){
	
	window.close();
	return true;
}


/*
SetBookmark is called periodically throughout the content
Purpose: Save the user's current location in the content
Parameters: strBookmark (String < 500 characters)
Return value: boolean indicating success or failure
*/
function PSPREVIEW_SetBookmark(strBookmark){

	return true;
}



/*
SetBookmark is called when the content loads
Purpose: Retrieve the user's last location in the content
Parameters: none
Return value: String < 500 characters, that was set in the last call to SetBookmark
*/
function PSPREVIEW_GetBookmark(){
	return "";
}


/*
GetLastError is called periodically, usually after another call
Purpose: Determine if an error has occured
Parameters: none
Return value: String representing an error number that should be recorded for debug, "0" indicates no error
*/
function PSPREVIEW_GetLastError(){
	return "0";
}


/*
GetErrorDescription is called after a call to GetLastError that indicates an error
Purpose: Get additional information about the error for debug
Parameters: none
Return value: String containing information about the last error
*/
function PSPREVIEW_GetErrorDescription(){
	return "";
}



/*
Commit is called periodically 
Purpose: Make sure that any bookmarks are permanently stored in the LMS
Parameters: none
Return Value: boolean indicating success or failure
*/
function PSPREVIEW_Commit(){
	return true;
}



