

var toolPath = "http://www.tmgva-dev.com/toolset/afs_2/";
var nextOK = false;

function go_menu(where) {
location = where;
}


function go_next() {
  if (mode == 'ILT') {
	if (nextloc == "none") {
		var agree=confirm("This is the last page of the lesson, therefore you cannot go forward. Would you like to close this window?");
		if (agree) {
			window.close();
		} else {
			return false;
		}	
	} else {
	//alert(nextloc);
	location = nextloc;
	}
  }
}

function go_next_wbt() {
	if (nextloc == "none") {
		var agree=confirm("This is the last page of the lesson, therefore you cannot go forward. Would you like to close this window?");
		if (agree) {
			window.close();
		} else {
			return false;
		}	
	} else {
	//alert(nextloc);
		//if (nextOK == true) {
			location = nextloc;
		//} else {
			//alert("You must answer the question correctly before moving on.");
		//}
	}
}

function go_next_hold() {
	if (nextloc == "none") {
		var agree=confirm("This is the last page of the lesson, therefore you cannot go forward. Would you like to close this window?");
		if (agree) {
			window.close();
		} else {
			return false;
		}	
	} else {
	//alert(nextloc);
		if (nextOK == true) {
			location = nextloc;
		} else {
			alert("You must answer the question correctly before moving on.");
		}
	}
}

function go_back() {
	if (backloc == "none") {
		var agree=confirm("This is the first page of the lesson, therefore you cannot go back. Would you like to close this window?");
		if (agree) {
			window.close();
		} else {
			return false ;
		}	
	} else {
	//alert(nextloc);
	location = backloc;
	}
}

function exit_it() {

	window.close();

}

function launch_ilt_pres(loc) {
		myWin= open(loc, "Presentation" ,"width=790,height=525,location=no,status=yes,toolbar=no,menubar=no,scrollbars=auto");
		myWin.focus();	
}

function launch_ilt_sg(loc) {
		myWin= open(loc, "Student_Guide" ,"width=800,height=600,location=yes,status=yes,toolbar=no,menubar=no,scrollbars=yes");
		myWin.focus();	
}

function simple_roll(name, newloc) {

eval ('window.document.' + name + '.src = \'' + newloc + '\'');

}

function simple_roll_test(name, newloc) {
if (nextOK == true) {
eval ('window.document.' + name + '.src = \'' + newloc + '\'');
}
}

function wait_roll(name, newloc) {
	if (nextOK == true) {
		eval ('window.document.' + name + '.src = \'' + newloc + '\'');
	}
}

function flashmovie_DoFSCommand(command, args) {
	
	if (command == "showNext") {
		nextOK = true;
		wait_roll('Next','../images/next_act.jpg');
	}
}

function addComment(filePath,fileName,theID) {
//alert(fileName);
	
		commentLoc = toolPath + "addComment.asp?page_id=" + theID + "&page_name=" + fileName + "&page_file_name=" + filePath;
		//alert(commentLoc);
		myWin= open(commentLoc, "comments" ,"width=600,height=500,location=no,status=yes,toolbar=no,menubar=no,scrollbars=auto");
		myWin.focus();	
}

function viewComment(theID,fileName) {
//alert(fileName);
	
		commentLoc = toolPath + "viewComment.asp?page_id=" + theID + "&page_name=" + fileName;
		//alert(commentLoc);
		myWin= open(commentLoc, "comments" ,"width=600,height=500,location=no,status=yes,toolbar=no,menubar=no,scrollbars=auto");
		myWin.focus();	
}

function setBookMark(where,ID) {
	//top.topEmpty.SetBookMark(where,ID);
	alert("set bookmark");
}

function setStart(where,ID) {
	//top.topEmpty.SetStart(where,ID);
	alert("set start");
}

function setComplete(where,ID) {
	//top.topEmpty.SetComplete(where,ID);
	alert("set complete");
}

function setScore(score,ID) {
	//top.topEmpty.SetScore(score,ID);
	alert("set score");
}

function go_menu() {
	if (confirm("Are you sure you wish to leave this lesson and return to the main manu?")) {
	window.close();
	}
}