// sets the lecture to scroll down on double click
setTimeout('document.body.ondblclick=top.contents.down400',1000)


var delayID, delayTime
function delayShow(layerID,time) {
delayID=layerID, delayTime=time
setTimeout("showHideJ(delayID)",delayTime)
}

var newElem, idElem
function addToEnd(ident,text,time) { // adds a paragraph to the end of an element
	if ( (typeof document.all == 'undefined') && ( typeof document.getElementsByTagName != 'undefined' )) { 
		document.all = document.getElementsByTagName("*") 
	} 
	newElem = document.createElement("P") 
	newElem.id = "newP" 
	newElem.innerHTML=text 
	idElem = ident
	setTimeout("document.all[idElem].appendChild(newElem)",time)
} 

var idDelay
function delayShowHide(ident,time) {
	idDelay=ident
	setTimeout("showHideJ(idDelay)",time)
}


function showIt(text) {
	status=text
	//return false
}

var count=0
function doIt() {
if (count<8) {
	var currSent = ''
	if (count>0) currSent = '\n\n'
	currSent += sentences[count]
	document.formProof.t.value += currSent
	count++
	}
}

var count2=0
function doIt2() {
if (count2<8) {
	var currSent = ''
	if (count2>0) currSent = '\n\n'
	currSent += sentences2[count2]
	document.formProof2.t2.value += currSent
	count2++
	}
}


function makeYellow(id) { // call objects id, id0, id1, ... id9...these will have yellow background
if (document.getElementById(id)) document.getElementById(id).style.backgroundColor = "yellow"
for(var i=0;i<10;i++) {
	if (document.getElementById(id+i)) document.getElementById(id+i).style.backgroundColor = "yellow"
	}
}
var colorArray = new Array
function makeColor(id,color) { // call objects id, id0, id1, ... id9...these will have yellow background
if (document.getElementById(id)) {
	//colorArray[id] = document.getElementById(id).style.backgroundColor
	document.getElementById(id).style.backgroundColor = color
}
for(var i=0;i<10;i++) {
	if (document.getElementById(id+i)) document.getElementById(id+i).style.backgroundColor = color
	}
}
/*
function revertColor(id) {
	if (document.getElementById(id)) {
	document.getElementById(id).style.backgroundColor = colorArray[id]
}
}
*/
function showHideJ(x) { // meant for use with hideLayer object
var objJ = MM_findObj(x)
var newVis
if (objJ.style) newVis = (objJ.style.visibility=='visible') ? 'hide' : 'show'
else newVis = (objJ.visibility=='visible') ? 'hide' : 'show'
MM_showHideLayers(objJ.id,'',newVis)}

function openCafe() {
if (typeof(cafeWindow)=='undefined' || cafeWindow.closed) {
cafeWindow=window.open("../../Cafe.htm","nw")
//setTimeout("cafeWindow.focus()",1)
	}
}
var waitPage = ''
function locateCafe(page) {
waitPage=page
setTimeout('waitForLoad()',100)
}
function waitForLoad() {
	cafeWindow.main.location="../../"+waitPage
	cafeWindow.focus()
}

var waitProbPage = ''
function openProblemPage(url) {
	if (typeof(probWin)=='undefined' || probWin.closed) {
		probWin=window.open("Problems.htm","nPw")
		}
		waitProbPage=url
		setTimeout('waitForProblem()',100)
	}
	
function waitForProblem() {
	probWin.main.location=waitProbPage
	probWin.focus()
}

/*function openProblemPage(url) {
if (typeof(probWin)!='undefined' && !probWin.closed) {
	if (probWin.location.toString().indexOf(url)>-1) probWin.focus()
	else {
		probWin.location=url
		probWin.focus()
	}
}
else {
	probWin=window.open(url,"pw")
	probWin.focus()
	}
}
*/
