<!--Copyright © 2007 SkillSoft, PLC.  All rights reserved.-->

// We want to FORCE this page to be reread rather than 
//   just accessed from the cache, otherwise two Sims in
//   a row may result in the same Sim being run twice. (spf)

// use a cookie to determine whether to reload this page;
//   by default, we need to reload the page
var cookieValue = "true";
var allcookies = document.cookie;
var pos = allcookies.indexOf("doReload=");

// if we find the cookie, get its value
if (pos >= 0)
{	
var start = pos + 9;
var end = allcookies.indexOf(";", start);
if (end == -1)
	end = allcookies.length;
	cookieValue = allcookies.substring (start, end);
}

// if the value is true, force a reload of the page
if (cookieValue == "true")
{
	document.cookie = "doReload=false";
	setTimeout("window.location.reload(true)", 2000);
}
else {	
	var parms;
	var lauchcherPath;
	var locat = document.location + "";
	if (locat.indexOf("127.0.0.1") > -1) {
		parms = localParams + "&";
		lauchcherPath = "launcher.html";
	}
	else {
		lauchcherPath = "./KNet_Player/launcher.html";
		parms = document.location + "";
		var loc = parms;
		var parmsPos = parms.indexOf( "?" );
		if (parmsPos == -1 )
			parms = "?";
		else
		{
			loc = parms.substring( 0, parmsPos );
			parms = parms.substring( parmsPos ) + "&";
		}

		loc = loc.substring( 0, loc.lastIndexOf( "/" ) );
		loc = loc.substring( 0, loc.lastIndexOf( "/" ) ) + "/Content/KNet_Content/";
	}

	var agt=navigator.userAgent.toLowerCase();
	var is_nav  = ((agt.indexOf("firefox") == -1) && (agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
	            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
	var verfull = parseFloat(navigator.appVersion);

	ReplaceSlashesforNetscape6();

	//var titleEncodedString = "&courseTitle=" + escape( document.title );
	//location.replace("./knet_player/launcher.html" + parms + "courseFolder=" + loc + courseID + "&courseTitle=" + titleEncodedString);
	var titleEncodedString = "&courseTitle=" + document.title;	
	if (parms.toLowerCase().indexOf("aicc_sid") == -1 && parms.toLowerCase().indexOf("scorm=true") == -1){
		parms = "?" + parameterString + "&cdrom=true&";
	}
	
	location.replace(lauchcherPath + parms + "courseFolder=" + courseFolderName + "&courseID=" + courseID +"&language=" + lang + titleEncodedString);	
}

//This function was added to overcome Netscape 6 handling courses with slashes in the course name. Netscape 6 would not load
//the courses with slashes in their name. We replace the "/" with ">" temporarily until the parameters are constructed in the browser
//Another function is added into Mac.js to restore the "/".
function ReplaceSlashesforNetscape6()
{
	if (is_nav && verfull >= 6)
	{
		var docTitle = document.title;
		while(docTitle.indexOf("/") != -1)
		{	
			var Title1 = docTitle.substring(0, docTitle.indexOf("/"));
			var Title2 = docTitle.substring(docTitle.indexOf("/") + 1);
			docTitle = Title1 + ">" + Title2;
		}		
		document.title = docTitle;
	}	
}


<!--Copyright © 2007 SkillSoft, PLC.  All rights reserved.-->
