<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Assessment</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
var testMode=false;
var swfFile=(testMode) ? "assessment-testing.swf" : "assessment.swf";

function RorC() {
	var top=self.screenTop;

	if (top>9000) {
		alert('assessment is exiting-IE')
	//} else {
	//	alert('window was Refreshed')
	}
	//
}
document.onmousewheel=function(){
	// this only works in IE 6
	window.document.assessment.setVariable("_root.vscrollbarMC.wheelHandlerMC.wheelDelta",event.wheelDelta);
	window.document.assessment.TcallLabel("_root.vscrollbarMC.wheelHandlerMC","wheel");
}

// standard plugin detection
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

// this is the VBScript for MSIE Windows
var WM_startTagFix = '</';
var msie_windows = 0;
if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)){
  msie_windows = 1;
  document.writeln('<script language="VBscript">');
  document.writeln('\'This will scan for plugins for all versions of Internet Explorer that have a VBscript engine version 2 or greater.');
  document.writeln('\'This includes all versions of IE4 and beyond and some versions of IE 3.');
  document.writeln('Dim WM_detect_through_vb');
  document.writeln('WM_detect_through_vb = 0');
  document.writeln('If ScriptEngineMajorVersion >= 2 then');
  document.writeln('  WM_detect_through_vb = 1');
  document.writeln('End If');
  document.writeln('Function WM_activeXDetect(activeXname)');
  document.writeln('  on error resume next');
  document.writeln('  If ScriptEngineMajorVersion >= 2 then');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('     WM_activeXDetect = IsObject(CreateObject(activeXname))');
  document.writeln('     If (err) then');
  document.writeln('        WM_activeXDetect = False');
  document.writeln('     End If');
  document.writeln('   Else');
  document.writeln('     WM_activeXDetect = False');
  document.writeln('   End If');
  document.writeln('End Function');
  document.writeln(WM_startTagFix+'script>');
}

// Three arguments can be pass into Flash here:
// 'test' is the xml questions/answers file to load minus the .xml extension
// 'url' is the http path to this assessment shell
// 'user' is the user validation response from the validatelogin.cgi
//
// In an LMS course environment the opener will have these variable for Flash:
// opener.userId
// opener.userName

if ((document.location.search.indexOf('user=') > -1)&&(document.location.search.indexOf('user=nomatch') == -1)) {
	// if login has been validated, pass full query string
	var input = document.location.search;
} else if (document.location.search.indexOf('user=nomatch') == -1) {
	// if login validation failed, pass path and pass full query string (user=nomatch and file)
	var input = document.location.search+'&url='+document.location.pathname;
} else {
	// if not tried login yet, only pass path the assessment file and path
	var input = document.location.search+'&url='+document.location.pathname;
}

if (opener && opener.userId && opener.userName){
	var input = document.location.search+'&userId='+opener.userId.toLowerCase()+'&userName='+opener.userName;
}

// this is for Flash to Javascript
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function assessment_DoFSCommand(command, args) {
	var myFlashObj = InternetExplorer ? assessment : document.assessment;
	alert ("The Message was : " + args);
}
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub assessment_FSCommand(ByVal command, ByVal args)\n');
	document.write('call assessment_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

// this is for Javascript to Flash
function doPassVar (args){ // assumes args is a form object
	var sendText = args.value;
	window.document.assessment.SetVariable("message2Txt.text", sendText);
}

// this is for the helpLinks
function openTheURL (link){ 
	var goToLink = "goto=";
	var thisLink = link;

	window.open(thisLink);	
}

// old onunload function: javascript:if (document.all){RorC()} else {var top=window.outerWidth;if (top==0) {alert('window was closed')} else {alert('assessment is exiting-mozilla')}}
//-->
top.resizeTo(600,700);
</SCRIPT>
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" bgcolor="#D4D0C8" onunload="javascript:window.document.assessment.TcallLabel('_root.jsActionsMC','save');alert('assessment is exiting');">
<SCRIPT LANGUAGE="JavaScript1.2">

<!--
// Check for Flash version 6 or greater in Netscape version 4.61 or higher
if ( parseFloat(navigator.appVersion.substring(0,4))>4.61 && plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 6 ) {
document.write('<EMBED src="'+swfFile+input+'" name="assessment" loop=false menu=false quality=high salign=T bgcolor=#D4D0C8');
document.write(' swLiveConnect=true WIDTH=100% HEIGHT=100%');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></BODY></HTML>');
document.close();
} else if (msie_windows && WM_activeXDetect("ShockwaveFlash.ShockwaveFlash.6")){
	// Windows Plugin Check
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ID="assessment" WIDTH=100% HEIGHT=100%>');
	document.write('<PARAM NAME=movie VALUE="'+swfFile+input+'">');
	document.write('<PARAM NAME=loop VALUE=false>');
	document.write('<PARAM NAME=menu VALUE=false>');
	document.write('<PARAM NAME=quality VALUE=high>');
	document.write('<PARAM NAME=bgcolor VALUE=#D4D0C8>');
	document.write('<PARAM name="swliveconnect" value="true">');
	document.write('</OBJECT>');
	document.close();
} else {
	document.write('<TABLE BORDER="0" WIDTH="100%" HEIGHT="100%"><TR><TD VALIGN="MIDDLE" ALIGN="CENTER"><IMG BORDER=0 SRC="getFlash.jpg">');
document.write('</TD></TR></TABLE>');
document.close();
}
//-->
</SCRIPT>

</body>
</html>
