var LauncherJSVersion="Jan_28_2021_V1",BROWSER={IE:false,SAFARI:false,OPERA:false,FIREFOX:false,CHROME:false,UNKNOWN:false,LEGACY:false},g_EdgeBrowser=false,DEVICE={PC:false,TOUCH:false},OS={WINDOWS:false,MAC:false},LAUNCHERRORS={NONE:0,CANVASNOTSUPPORTED:1,BROWSERNOTSUPPORTED:2,FILESJSNOTLOADED:3,POPUPBLOCKED:4},CMDARGS={DOUBLECLICKSPEED:"DCS",LAUNCHMODE:"Mode",PORTALUSERID:"PUID",SECTIONID:"SectionID",CONTENTID:"ContentID",FULLSCREEN:"FS",UILANGUAGE:"UILANGUAGE",APPLICATION:"APP",LAUNCHSOURCE:"LAUNCHSOURCE",
LOG:"LOG",SURL:"SURL",EPNPARTIAL:"EPNPARTIAL2",VSPA:"VSPA",VARIATIONPATHS:"VARIATIONPATHS",VARIATIONSHIDE:"VARIATIONSHIDE",COURSEID:"COURSEID"},LAUNCHSOURCETYPE={PRESENTATIONEDITOR:"PRNE",PRESENTATIONOUTPUT:"PRNO"},CRITICALERRORS={NONE:"0",EX_INITIALIZE:"1001",FILES_LOADCOMPLETE_FALSE:"1002",FILES_JSON_MISSING:"1003",OBJFL_INITIALIZE_FALSE:"1004",OBJFL_LOAD_FALSE:"1005",EX_FILES_LOADCOMPLETE:"1006",OBJFL_LOADCOMPLETE_FALSE:"1007",EX_OBJFL_LOADCOMPLETE:"1008",EX_LAUNCH:"2000",EX_CMD_EPSS:"2001",EX_CMD_ECMS:"2002",
EX_BROWSER_DETECT:"2003",EX_PLAYER_LAUNCH:"2004",EX_OPEN_DIALOG:"2005",EX_LAUNCHER_CLOSE:"2006",EX_SCORM_CODE:"2007"},SCORMSTATUS={CANCELLED:"0",COMPLETED:"1",INCOMPLETE:"2",BROWSED:"3",REVIEWED:"4"},m_LauncherErrors=[],m_bCtrlClicked=false,g_CriticalErrorCode=CRITICALERRORS.NONE,g_LauncherErrorCode=LAUNCHERRORS.NONE,m_WindowTimer,m_objEpiWindow,g_inline="";
function Launch(a,b,c){try{try{document.body.onkeydown=HandleKeyPressForDebug}catch(e){}if(g_IdentifyTypeOfBrowser()==false)throw"Error @ g_IdentifyTypeOfBrowser";if(g_iLegacyKey!=17091950&&g_IsBrowserHTML5Compatible()==false)throw g_LauncherErrorCode=LAUNCHERRORS.CANVASNOTSUPPORTED,"";if(BROWSER.UNKNOWN==true)throw g_LauncherErrorCode=LAUNCHERRORS.BROWSERNOTSUPPORTED,"";var a=true,d=(a?"#FS=1":"#FS=0")+window.location.hash;if(a===true)b=screen.width,c=screen.height;if(g_EdgeBrowser==true&&window.devicePixelRatio!=
void 0)var f=Number(window.devicePixelRatio),b=Math.round(b*f),c=Math.round(c*f);if(OpenPlayerInDialog(a,"_files/player.htm"+d,b,c)==false)throw"Error @ OpenPlayerInDialog";}catch(g){if(g_CriticalErrorCode==CRITICALERRORS.NONE)g_CriticalErrorCode=CRITICALERRORS.EX_LAUNCH;m_LauncherErrors.push("Error @ Launch > "+g);g_CriticalError()}}
function g_IdentifyTypeOfDevice(){try{if(DEVICE.PC=true,("ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0)==true)DEVICE.TOUCH=true}catch(a){m_LauncherErrors.push("Error @ g_IdentifyTypeOfDevice > "+a.message)}}
function OpenPlayerInDialog(a,b,c,e){var d=false;try{var f=window,g="",h=(screen.width-c)/2,j=(screen.height-e)/2;a&&BROWSER.IE==true&&(e=c=500);g="width="+c+"px,height="+e+"px";a==false&&(g+=",left="+h+"px,top="+j+"px");m_objEpiWindow=window.open(b,"",g);window.paramspassed=f;m_WindowTimer=setTimeout(IsEpnPlayerWindowOpened,500);d=true}catch(k){if(g_CriticalErrorCode==CRITICALERRORS.NONE)g_CriticalErrorCode=CRITICALERRORS.EX_OPEN_DIALOG;m_LauncherErrors.push("Error @ OpenPlayerInDialog > "+k.message)}return d}
function IsEpnPlayerWindowOpened(){var a=true;try{if(m_objEpiWindow==void 0){g_LauncherErrorCode=LAUNCHERRORS.POPUPBLOCKED;var b=GetErrorMessage();alert(b)}else document.getElementById("LaunchClick").style.display="none",clearTimeout(m_WindowTimer),m_WindowTimer=0,m_WindowTimer=setTimeout(IsEpnPlayerWindowAlive,100)}catch(c){a=false,m_LauncherErrors.push("Error @ IsEpnPlayerWindowOpened > "+c)}return a}
function IsEpnPlayerWindowAlive(){var a=true;try{if(m_objEpiWindow==void 0){if(ManageLauncherMsgDisplay()===false)throw"error @ ManageLauncherMsgDisplay";window.close()}else{var b=false;try{if(m_objEpiWindow.closed){if(ManageLauncherMsgDisplay()===false)throw"error @ ManageLauncherMsgDisplay";window.close();b=true}}catch(c){m_LauncherErrors.push("Error @ IsEpnPlayerWindowAlive 1 > "+c)}if(b==false)if(g_CriticalErrorCode==CRITICALERRORS.NONE)m_WindowTimer=setTimeout(IsEpnPlayerWindowAlive,100);else throw"some other error";
}}catch(e){a=false;m_LauncherErrors.push("Error @ IsEpnPlayerWindowAlive > "+e);if(g_CriticalErrorCode==CRITICALERRORS.NONE)g_CriticalErrorCode=CRITICALERRORS.EX_LAUNCHER_CLOSE;g_CriticalError()}return a}
function ManageLauncherMsgDisplay(){var a=true;try{if(g_ScormEnabled===true)switch(g_ScormStatus){case SCORMSTATUS.COMPLETED:document.getElementById("Scorm_CompleteMsg").style.display=g_inline;break;case SCORMSTATUS.INCOMPLETE:document.getElementById("Scorm_InCompleteMsg").style.display=g_inline;break;case SCORMSTATUS.BROWSED:document.getElementById("Scorm_BrowseMsg").style.display=g_inline;break;case SCORMSTATUS.REVIEWED:document.getElementById("Scorm_ReviewMsg").style.display=g_inline;break;case SCORMSTATUS.CANCELLED:document.getElementById("Scorm_CancelMsg").style.display=
g_inline}else document.getElementById("LaunchClick").style.display=g_inline}catch(b){if(a=false,m_LauncherErrors.push("Error @ ManageLauncherMsgDisplay > "+b),g_CriticalErrorCode==CRITICALERRORS.NONE)g_CriticalErrorCode=CRITICALERRORS.EX_SCORM_CODE}return a}
function DisplayError(a){var b=true;try{switch(document.getElementById("LaunchClick").style.display="none",a){case LAUNCHERRORS.CANVASNOTSUPPORTED:document.getElementById("HTML5NotSupported").style.display=g_inline;break;case LAUNCHERRORS.BROWSERNOTSUPPORTED:document.getElementById("InValidBrowser").style.display=g_inline;break;default:document.getElementById("CriticalError").style.display=g_inline}}catch(c){b=false,m_LauncherErrors.push("Error @ DisplayError > "+c)}return b}
function g_IdentifyTypeOfBrowser(){var a=true,b="";try{var c=String(navigator.appName).toUpperCase(),e=String(navigator.appVersion).toUpperCase(),d=String(navigator.userAgent).toUpperCase();d.indexOf("TRIDENT")!=-1?BROWSER.IE=true:d.indexOf("MSIE")!=-1?BROWSER.IE=true:d.indexOf("FIREFOX")!=-1?BROWSER.FIREFOX=true:d.indexOf("OPERA")!=-1?BROWSER.OPERA=true:d.indexOf("OPR/")!=-1?BROWSER.OPERA=true:d.indexOf("CHROME")!=-1?BROWSER.CHROME=true:d.indexOf("SAFARI")!=-1?BROWSER.SAFARI=true:BROWSER.UNKNOWN=
true;if(d.indexOf("WINDOWS")!=-1)OS.WINDOWS=true;if(d.indexOf("MACINTOSH")!=-1)OS.MAC=true;var f=false;d.indexOf("IPAD")!=-1&&(f=true);b+="IE > "+BROWSER.IE+"<br/>";b+="Safri > "+BROWSER.SAFARI+"<br/>";b+="Chrome > "+BROWSER.CHROME+"<br/>";b+="Firefox > "+BROWSER.FIREFOX+"<br/>";b+="Opera > "+BROWSER.OPERA+"<br/><br/>";b+="BrowserVersion > "+e+"<br/><br/>";b+="sBrowserName > "+c+"<br/><br/>";b+="sUserAgentHeader > "+d+"<br/>";window.g_objLoger!=void 0&&(g_WriteToLog("PlayerHtm","Initialize","sBrowserInfo",
b,LOG.SPECIAL),g_WriteToLog("PlayerHtm","Initialize","OS.MAC",OS.MAC,LOG.SPECIAL),g_WriteToLog("PlayerHtm","Initialize","OS.WINDOWS",OS.WINDOWS,LOG.SPECIAL),g_WriteToLog("PlayerHtm","Initialize","IPAD",f,LOG.SPECIAL))}catch(g){if(g_CriticalErrorCode==CRITICALERRORS.NONE)g_CriticalErrorCode=CRITICALERRORS.EX_BROWSER_DETECT;a=false;m_LauncherErrors.push("<br/>BROWSER INFO > "+b);m_LauncherErrors.push("<br/>Error @ g_IdentifyTypeOfBrowser > "+g)}return a}
function g_CriticalError(){var a="";try{g_Completed=true,a=GetErrorMessage(),window.g_objFL!=void 0&&window.g_objFL!=null&&g_objFL.Hide()}catch(b){}try{g_CommandArgs[CMDARGS.LAUNCHSOURCE]!=LAUNCHSOURCETYPE.PRESENTATIONOUTPUT&&alert(a);document.body.style.cursor="default";if(m_bCtrlClicked){a="";for(i in m_LauncherErrors)a+=m_LauncherErrors[i]+"\n\n";alert(a)}m_LauncherErrors=[];m_bCtrlClicked=false}catch(c){}}
function g_IsBrowserHTML5Compatible(){var a=true,b=null;try{b=document.createElement("canvas");b.id="html5_canvas_testing";document.body.appendChild(b);var c=document.getElementById("html5_canvas_testing");if(c==null||c==void 0)throw"Extracting canvas object failed ";if(c.getContext("2d")==null)throw"Canvas.getContext failed ";}catch(e){a=false}b!=null&&document.body.removeChild(b);return a}
function GetErrorMessage(){var a="";try{var b=null;if(window.dialogArguments)try{b=window.dialogArguments}catch(c){}if(window.opener)try{b=window.opener}catch(e){}window.g_objLoger==void 0&&(b=window);if(b!=null)switch(g_LauncherErrorCode){case LAUNCHERRORS.CANVASNOTSUPPORTED:a=b.document.getElementById("HTML5NotSupported").innerText;break;case LAUNCHERRORS.BROWSERNOTSUPPORTED:a=b.document.getElementById("InValidBrowser").innerText;break;case LAUNCHERRORS.POPUPBLOCKED:a=b.document.getElementById("PopupBlocked").innerHTML;
break;default:a=b.document.getElementById("CriticalError").innerText}else switch(g_LauncherErrorCode){case LAUNCHERRORS.CANVASNOTSUPPORTED:a="This browser does not support HTML5 features. Use the latest HTML5 compatible browser..";break;case LAUNCHERRORS.BROWSERNOTSUPPORTED:a="This epiLearn is certified for IE, Chrome, Safari, Firefox, Opera..";break;default:a="Critical Error. Contact your system administrator for support.."}g_CriticalErrorCode!=CRITICALERRORS.NONE&&(a+="\n\nErrorCode : "+g_CriticalErrorCode)}catch(d){a=
"Critical Error. Contact your system administrator for support..."}return a}function HandleKeyPressForDebug(a){try{m_bCtrlClicked=(a==void 0?event:a).ctrlKey}catch(b){}};
