// these are functions of lms recreated to stop errors in local testing
// do not include in final release
function loadPage(){
	//alert("doGetValue" + varName);
}

function doGetValue(varName){
	//alert("doGetValue" + varName);
}
function doSetValue(varName,varStatus){
	//alert("doSetValue" + varName + " is " + varStatus);
}

function setSCOPass(objID) {
	//alert("setSCOPass" + objID);
}

function setSCOComplete() {
	//alert("setSCOComplete");
}

function doneClicked() {
	//alert("doneClicked");
	if (nextSCO != "end") {
		window.location = nextSCO + ".htm";
	} else {
		alert("last SCO");
	}
}

function dummyBookmarks() {
	var menuItems = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<menuItems.length; i++) { 
		menuItems[i].setAttribute('id',i);
		//alert(menuItems[i].id);
		
		if (menuItems[i].id < dummyBookmark2) {
			menuItems[i].className="b3";
		} else if (menuItems[i].id == dummyBookmark2) {
			menuItems[i].className="b2";
		} else if (menuItems[i].id > dummyBookmark2) {
			menuItems[i].className="b1";
		}
		
	}
	
	if (dummyBookmark1 != dummyBookmark2) {
		menuItems[dummyBookmark1].className="b2";
	}
}

function showMenu() {
	//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
		//Setup the connection as a GET call to file.
		//True explicity sets the request to asyncronous (default).
		receiveReq.open("GET", "menu.htm" + "?" + new Date().getTime() , true);
		//Set the function that will be called when the XmlHttpRequest objects state changes.
		receiveReq.onreadystatechange = handleMenu; 
		//Make the actual request.
		receiveReq.send(null);
	}			
}

//Called every time our XmlHttpRequest objects state changes.
function handleMenu() {
	//Check to see if the XmlHttpRequests state is finished.
	if (receiveReq.readyState == 4) {
		//Set the contents of our id to the result of the asyncronous call.
		document.getElementById('nav_inner').innerHTML = receiveReq.responseText;
		dummyBookmarks();
	}
}

function startCourse() {
	//var completion_status = doGetValue("completion_status");
	var movie = scoNumber + ".swf";
	var so = new SWFObject(movie, "sco", "755", "618", "8", "#ffffff");
	so.addParam("wmode", "transparent");
	so.addParam("allowScriptAccess", "sameDomain");
	so.addVariable("lesson_status",completion_status);
	so.write("scocontainer");
	// 092407 Joel Product Preview - Bug in IE7, list items disappearing from loaded html page. Abandoned for now.
	//showMenu();
	dummyBookmarks();
}






