/* System Test Functions */

function launchSysTest(launchID) {
	var uID = document.getElementById('eUserId');
       if (launchID) {
		if (uID || $('#iht').val() == 1) { // if iht (hide template for SF) open new window
			var jObj = { aID:launchID, wodLevel:'', tb:'', noWin:0 };
			joinSession(jObj);
		} else {
			var url = ilcModPerlRelPath + '/lms/vc_launch.pl?activity_id=' + launchID;
			document.location.href = url;
		}
	}
}

function initSystemTest(useSSLCookie) {
	var showEndMsg = false;

	// cookie test
	setCookie('cookie_test', 'none', '', '/', '', useSSLCookie);
	if ( getCookie('cookie_test') ) {
		$('#systest_cookieEnabled').show();
		$('#systest_cookiestatusOK').show();
		delCookie('cookie_test', '/', '', useSSLCookie); // remove test cookie
	} else {
		$('#systest_cookieDisabled').show();
		$('#systest_cookiestatusNotOK').show();
		$('#systest_cookieMsg').show();
		showEndMsg = true;
	}
	
	// javascript test
	var jstest = true;
	if (jstest) {
		$('#systest_js').show();
		$('#systest_jsstatusOK').show();
	} else {
		$('#systest_jstestMsg').show();
		$('#systest_jsstatusNotOK').show();
		showEndMsg = true;
	}

	// set colortest
	if (screen.colorDepth >= 8) {
		$('#systest_color').html(screen.colorDepth);
		$('#systest_colorstatusOK').show();
	} else {
		$('#systest_colorstatusNotOK').show();
		$('#systest_colorMsg').show();
		showEndMsg = true;
	}

	// detect compatible browser versions

	var browObj = detectBrowserProps();
	var bname = browObj.browser.name;
	var bversion = browObj.browser.version;
	var success = browObj.success;

	$('#systest_b').html(bname + " " + bversion);
	if (success) {
		$('#systest_bstatusOK').show();
	} else {
		$('#systest_bMsg').show();
		$('#systest_bstatusNotOK').show();
		showEndMsg = true;
	}

	// try to detect OS
	$('#systest_op').html(navigator.platform);
	if (navigator.platform == "Win32" || navigator.platform.indexOf('Mac') != -1) {
		$('#systest_opstatusOK').show();
	} else {
		$('#systest_opMsg').show();
		$('#systest_opstatusNotOK').show();
		showEndMsg = true;
	}

	// Display recommendations where needed.
	if (showEndMsg) {
		$('#systest_endMsg').show();
	}	
}	

function getFinalSText() {
	$('#sStep1Div').hide();
	$('#sStep2Div').show();
}

// dummy start page functions
// to be removed when LRN is updated for 10.2.1
function cRecordingStart() {
}
function cRecordingStop() {
}
function cBridgeConnect() {
}
function cBridgeDisconnect() {
}
/* join form functions */

function join_showStatusMessage(statusType, msg) {
	$('#error').show();
	var statusHeader = (statusType == 'statuserror' ? ilcTrans(5504,"Error Message") : ilcTrans(5619,"Status Message"));

	if (!$("#error").hasClass(statusType)) {
		var removeClass = (statusType == 'statuserror' ? 'statusconfirm' : 'statuserror');
		$('#error').toggleClass(removeClass).toggleClass(statusType);
	}

	$('#error').html("<h3>"+statusHeader+"</h3><ul>"+msg+"</ul>");
}


