<!--SCRIPT language="JavaScript">
<!-- hide
var pageNo=0;

// function to set page by chosen link
function setPage(p) {
	var length = parent.frames["main"].document.anchors.length
	pageNo = p;
	if(pageNo<0) pageNo=0;
	if(pageNo>= length)
		 pageNo = length-1;
	parent.frames["pick"].document.forms[0].nextButton.value =
		">> "+ (1+ pageNo) +"/"+length + " >>";
}
function popup(file) {
    newWindow = window.open(file,"popup", 
			"height=350,width=550,scrollbars=yes")
}

function openDisplay() {
  myWin= open('','displayFrame','toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
  myWin.document.open();
  myWin.document.write("<html><head><title>"+document.title);
  myWin.document.write("</title>");
  myWin.document.write('<FRAMESET cols="100,*">');
  myWin.document.write('<FRAMESET rows="75%,*">');
  myWin.document.write('<FRAME src="pick.htm" marginwidth=2 marginheight=2  scrolling="yes" name ="index">');
  myWin.document.write('<FRAME src="pick.htm" name="pick" marginwidth=0 scrolling="no">');  
  myWin.document.write("</FRAMESET>");
  myWin.document.write('<FRAME src="'+document.location.href+'" name="main" scrolling="yes">');
  myWin.document.write("</FRAMESET>");
  myWin.document.write("</head><body>");
  myWin.document.write("&nbsp;");
  myWin.document.write("</body></html>");

  // close the document - (not the window!)
  myWin.document.close();  
  alert("Set up complete"); //syncs frame access in Netscape 6.1
  myWin.focus();
  myWin.index.document.open();
  myWin.index.document.write('<html><head><base href="'+document.location.href+'">\n');
  myWin.index.document.write("</head><body bgcolor=silver><font size=1>");
  bklength = document.anchors.length;
  for (var i=0 ; i < bklength; i++) {
    anc = document.anchors[i].name.toString();
    myWin.index.document.write('<a HREF="#'+anc
          +'" target=\"main\" onClick="parent.frames[\'pick\'].setPage('+i+');">'+anc+'</a><br>\n');
  }
  myWin.index.document.write("</font></body></html>");
  myWin.index.document.close();
}

// key press handler
function keyPress(e){
	NextFrame();
}

// function to display the first bookmark of the page
function FirstFrame() {
	setPage(0);
	parent.frames["main"].document.location.href = parent.frames["index"].document.links[pageNo];
}

// function to display the next bookmark of the page
function NextFrame() {
	setPage(++pageNo);
	parent.frames["main"].document.location.href = parent.frames["index"].document.links[pageNo];
}

// function to display the previous bookmark of the page
function PreviousFrame() {
	setPage(--pageNo);
	parent.frames["main"].document.location.href = parent.frames["index"].document.links[pageNo];
}

// function to display the last bookmark of the page
function LastFrame() {
	setPage(999);
	parent.frames["main"].document.location.href = parent.frames["index"].document.links[pageNo];
}

// this is a function to CREATE AN ARRAY
function MakeArray(n) {
	this.length = n;
	for (var i = 1; i <= n; i++) { 
    		this[i] = i }
	return this
}
// returns a RANDOM NUMBER between 0 and 1
function RandomNumber() {
	today = new Date();
	num= Math.abs(Math.sin(today.getTime()));
	return num;  
}
// returns a student name and presents it in an alert box
function PickStudent() {
	//var numb = this.Students.length;
        var numb;
        var hold;
        if(toGo<1) { toGo = nStudents;}
        numb = toGo;
	rdm = RandomNumber();
	hold = Math.round(.5 + numb*rdm);
        answer = Fairness[hold];
	 if (Students[answer] == ""){
		PickStudent();
	} else {
                Fairness[hold] = Fairness[toGo--];
		alert("\n\n" + Students[answer] + ",\n\nplease comment.");
	}
}
nStudents = 19;
toGo = nStudents;
Students = new MakeArray(nStudents);
Fairness = new MakeArray(nStudents);
Students[1] = "Marty";
Students[2] = "Adam";
Students[3] = "Duane";
Students[4] = "Mike";
Students[5] = "Kelly";
Students[6] = "Joe";
Students[7] = "James";
Students[8] = "Justin";
Students[9] = "Kiel";
Students[10] = "Tom";
Students[11] = "Floyd";
Students[12] = "Matt";
Students[13] = "Robin";
Students[14] = "Dustin";
Students[15] = "Andrew";
Students[16] = "Frank";
Students[17] = "Nora";
Students[18] = "Jackson";
Students[19] = "Craig";

// -->
