<!--

// called when Acellus Engine returns from Login
function roadMap() {
	var myRoad=top.Main2.document.Border.AcelStart.value;
	switch(myRoad) {
		case '1': // Display Course Choice List
			displayCourses();
			break;
		case 'Standard': // Display Standard Console
			displayAce3();
			break;
		case 'Custom': // Display Custom Console
			displayCustom();
			break;	
		default:
			top.Main1.document.getElementById('badPass').style.visibility='visible';
			top.Main1.document.getElementById('NewStudID').value='';
			top.Main1.document.getElementById('NewPassword').value='';
			top.Main1.document.getElementById('NewStudID').focus();
	}		
}

// called when Acellus Engine returns from Login
function roadMap2(console) {
	var myRoad=console;
	switch(myRoad) {
		case '1': // Display Course Choice List
			displayCourses();
			break;
		case 'Standard': // Display Standard Console
			displayAce3();
			break;
		case 'Custom': // Display Custom Console
			displayCustom();
			break;	
		default:
			top.Main1.document.getElementById('badPass').style.visibility='visible';
			top.Main1.document.getElementById('NewStudID').value='';
			top.Main1.document.getElementById('NewPassword').value='';
			top.Main1.document.getElementById('NewStudID').focus();
	}		
}

function displayCourses() {
	top.Main1.location = '/Dashboard/chooseCourse2/chooseCourse4.htm';
}

function displayCustom() {
	var SID=top.Main2.document.Border.StudentID.value;
	var newPage = top.Main2.document.Border.Target_Page.value;
	top.Debug2.document.ConsoleForm.StudentID.value=SID;
	top.Debug2.document.ConsoleForm.Answer.value='1';
	top.Debug2.document.ConsoleForm.Target_Page.value=newPage;
	top.Debug2.document.ConsoleForm.Console.value='Custom';	
	top.Debug2.document.ConsoleForm.submit();
}

function showCourses() {
	var MsgWin = top.Main1.theiframe;
	var iContent=top.Main2.document.Border.ExamRes.value;
	var myName = top.Main2.document.Border.StudentName.value + '!';
	top.Main1.document.getElementById('SName').innerHTML=myName;
	MsgWin.document.write(iContent);
	MsgWin.document.close();
}

// a=Course Number b=StudentID c=AcelStart (Standard/Custom) d=Target_Page e=CourseID f=selMode
function getCourse(a, b, c, d, e, f) {
	top.Debug2.document.CourseFormX.StudentID.value=b;
	top.Debug2.document.CourseFormX.Answer.value=a;
	top.Debug2.document.CourseFormX.myCourse.value=e;
    top.Debug2.document.CourseFormX.selMode.value=f;
	if(c=='Standard') {	
	    var myOS = navigator.platform;
	    var matcher = myOS.match('Linux');
	    if(matcher == "Linux") {
	        top.Main1.location='/Acellus3/indexFrame/indexFrame_LNX.html';
	    } else {
		    top.Main1.location="/Acellus3/indexFrame/indexFrame.html";
		}
	} else {
		top.Debug2.document.ConsoleForm.Answer.value=a;
		top.Debug2.document.ConsoleForm.StudentID.value=b;
		top.Debug2.document.ConsoleForm.Console.value=c;
		top.Debug2.document.ConsoleForm.Target_Page.value=d;
		top.Debug2.document.ConsoleForm.CourseID.value=e;
        top.Debug2.document.ConsoleForm.selMode.value=f;
		top.Debug2.document.ConsoleForm.submit();
	}
}

// b=StudentID c=AcelStart (Standard/Custom) d=Target_Page
function getCourseMid(b, c, d) {
	top.Debug2.document.CourseFormX.StudentID.value=b;
	if(c=='Standard') {	
	    var myOS = navigator.platform;
	    var matcher = myOS.match('Linux');
	    if(matcher == "Linux") {
	        top.Main1.location='/Acellus3/indexFrame/indexFrame_LNX.html';
	    } else {
		    top.Main1.location="/Acellus3/indexFrame/indexFrame.html";
		}
	} else
	{	
		top.Debug2.document.ConsoleForm.StudentID.value=b;
		top.Debug2.document.ConsoleForm.Console.value=c;
		top.Debug2.document.ConsoleForm.Target_Page.value=d;
		top.Debug2.document.ConsoleForm.submit();
	}
}

var Holdup;

function startThisCourse() {
	var Dbg2 = top.Debug2.document.getElementById('Debug2Rpt').value;
	var Kbrd = top.Debug2.document.getElementById('KeyboardRpt').value;
	if ( Dbg2 == 1 && Kbrd == 1) {
		goAhead()
	} else {
		Holdup=setTimeout('startThisCourse()', 500);
	}	
}

function goAhead() {
	var SID = top.Debug2.document.CourseFormX.StudentID.value;
	var CourseNo = top.Debug2.document.CourseFormX.Answer.value;
    var CID = top.Debug2.document.CourseFormX.myCourse.value;
    if (SID == "") SID = top.Main2.Border.StudentID.value;
    if (CID == "") CID = top.Main2.Border.CourseID.value;
	document.getElementById('StudentID').value=SID;
	document.getElementById('Answer').value=CourseNo;
    document.getElementById('CourseID').value = CID;
	document.CourseForm.submit();
}

function getAce2() {
        top.Main1.location.href='/LogIn.html';
        var SID = top.Debug2.document.CourseFormX.StudentID.value;         
        document.getElementById('StudentID').value=SID;
        document.CourseForm.submit();
}

function displayAce3() {
	var b = top.Main2.document.Border.StudentID.value;
	var Crs = top.Main2.document.Border.CourseID.value;
    top.Debug2.document.CourseFormX.StudentID.value=b;
    top.Debug2.document.CourseFormX.myCourse.value=Crs;	
    var myOS = navigator.platform;
    var matcher = myOS.match('Linux');
    if(matcher == "Linux") {
        top.Main1.location='/Acellus3/indexFrame/indexFrame_LNX.html';
    } else {
	    top.Main1.location="/Acellus3/indexFrame/indexFrame.html";
	}
}

/*************************
 TEACHER LOGIN CODE
*************************/     

function dlogin() {
        top.location="/Courseware/index.html";
}

function tlogin() {
        top.location="/cgi-bin/teacher-common/teachermenuNew.cgi";
}

function ClassMenu(T, A, N, Cnt) {
	var NetFlag = N;
	var AdFlag = A;
	var TeachFlag = T;
	if(NetFlag == 1 && AdFlag != 1 && TeachFlag != 1) top.TAMain.location.href='/cgi-bin/Admin/netchangeNEW.cgi';
	if(AdFlag == 1) {
		document.getElementById('TM1').className='TMBtnAct';
		document.getElementById('TM2').className='TMBtnAct';
		document.getElementById('TM5').className='TMBtnAct';
	} if(TeachFlag == 1) {
		document.getElementById('TM3').className='TMBtnAct';

	}
	if(NetFlag == 1) {
		document.getElementById('TM6').className='TMBtnAct';
	}
	if(AdFlag == 1 || TeachFlag == 1) {
		document.getElementById('TM4').className='TMBtnAct';
	}
	document.ClassLaunchForm.submit();			
}

//-->
