
var M = new Array();

function AddMenuItem(Title, URL, Tip){
	M[M.length] = new Array();
	var NewSlot = M.length-1;
	M[NewSlot][0] = Title;
	M[NewSlot][1] = URL;	
	M[NewSlot][2] = Tip;	
}

function WriteMenu(){
	var CurrPageNum = M.length;
	var Output = '<table class="Menu" border="0" cellpadding="6" cellspacing="0">';
	var CurrFileName = GetCurrFileName();
	for (var i=0; i<M.length; i++){
		if (M[i][1] == CurrFileName){
			Output += '<tr><td class="CurrentMenuCell">' + M[i][0] + '</td></tr>';
			CurrPageNum = i;
		}
		else{
			Output += '<tr><td class="MenuCell" onmouseover="MenuOver(this,' + i + '); return true" onmouseout="MenuOut(this); return true" onclick="document.location=\'' + M[i][1] + '\'">' + M[i][0] + '</td></tr>';
		}
	}

	if (CurrPageNum < M.length-1){
		Output += '<tr><td class="NextMenuCell" onmouseover="MenuOver(this,' + (CurrPageNum+1) + '); return true" onmouseout="MenuOut(this); return true" onclick="document.location=\'' + M[CurrPageNum+1][1] + '\'">Next</td></tr>';
	}
	Output += '</table>';
	document.write(Output);
}

function GetCurrFileName(){
	var FileName = '';
	var CurrLoc = document.location.href;
	var i = CurrLoc.length-1;
	while ((CurrLoc.charAt(i) != '\\')&&(CurrLoc.charAt(i) != '/')){
		FileName = CurrLoc.charAt(i) + FileName;
		i--;
	}
	return FileName;
}

function MenuOver(El, Num){
	El.style.color = '#000000';
	El.style.backgroundColor = '#ffffff';
	El.style.borderColor = '#000000';
	window.status = M[Num][2];
}

function MenuOut(El){
	El.style.color = '#ffffff';
	El.style.backgroundColor = '#000000';
	El.style.borderColor = '#ffffff';
	window.status = '';
}

AddMenuItem('Index', 'index.htm', 'Index to this tutorial');

AddMenuItem('Importing:', 'import1.htm', 'Importing files into Markin');
AddMenuItem('&nbsp;&nbsp;&nbsp;By Pasting', 'copy1.htm', 'Importing files by copying and pasting from another application');
AddMenuItem('&nbsp;&nbsp;&nbsp;From RTF', 'fromRTF1.htm', 'Importing Rich Text Format (*.rtf) files into Markin');
AddMenuItem('&nbsp;&nbsp;&nbsp;Text Files', 'fromtext1.htm', 'Importing plain text (*.txt) files into Markin');

AddMenuItem('Marking:', 'marking1.htm', 'Marking student work');
AddMenuItem('&nbsp;&nbsp;&nbsp;Annotations', 'anno1.htm', 'Inserting annotations using the annotations buttons; deleting annotations');
AddMenuItem('&nbsp;&nbsp;&nbsp;Comments', 'comm1.htm', 'Adding and deleting comments');
AddMenuItem('&nbsp;&nbsp;&nbsp;Feedback', 'feed1.htm', 'Adding feedback at the end of the marked work');
AddMenuItem('&nbsp;&nbsp;&nbsp;Grade', 'grade1.htm', 'Adding a grade');

AddMenuItem('Exporting:', 'export1.htm', 'Exporting files: creating a document to send back to the student');
AddMenuItem('&nbsp;&nbsp;&nbsp;For new browsers', 'forv5.htm', 'Creating a sophisticated Web page for v5 browsers');
AddMenuItem('&nbsp;&nbsp;&nbsp;For old browsers', 'forold.htm', 'Creating a simpler Web page for older browsers');
AddMenuItem('&nbsp;&nbsp;&nbsp;To RTF', 'toRTF1.htm', 'Creating a Rich Text Format word-processor document');

AddMenuItem('Statistics', 'stats1.htm', 'Creating and viewing statistics tables from the annotations you have added');

AddMenuItem('Buttons:', 'buttons1.htm', 'Introduction to the annotation buttons');
AddMenuItem('&nbsp;&nbsp;&nbsp;Editing', 'editbtn1.htm', 'Editing a button and its associated annotation');
AddMenuItem('&nbsp;&nbsp;&nbsp;Making', 'makebtn1.htm', 'Creating a new annotation button');
AddMenuItem('&nbsp;&nbsp;&nbsp;Organizing', 'orgbtn1.htm', 'Organizing your annotation buttons');

AddMenuItem('Advanced', 'adv1.htm', 'Advanced tools and options in Markin');