
	
function deepLink() {
	//alert(parent.id)
if(parent.id != "OSMMCS") {
	
document.write("<div id='Layer1' style='position:absolute; width:200px; height:29px; z-index:1; left: 600px; top:20px;'> <div class = 'caption' align='left'><a href='../index.html'><b>Online Statistics Home Page</b></a></div></div>")
}
}

var glossaryWindow = ""
function glossary(term) {
	glossaryUrl = "../glossary/" + term + ".html"
	//glossaryWindow = newWindow(glossaryUrl)
	var x = "window.open(glossaryUrl,\"\",\"toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=450,height=300\")"
eval(x)
//}
}
function showSim(url, w, h) {
if (sim == " ") {
	x = "sim = window.open(url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + w + ",height=" + h +"\")"

	eval(x)
	}
	else sim.focus()

}
function  qclosing() {

	if (sim != " ") {
		sim.openerOK = false
		sim.close()
	}
	
}

function showSectionFromGlossary(page) {
window.opener.location.href = page
}
function question() {

z =  document.forms[0].questions.value

var params = new Array()
if(z != "") {
	var params = z.split(" ")
	//if(parent.selftest == false)
		params[0] = "noquestion.html"
	
	
	x = params[0]
	w = 600
	h = 600
	if (params.length >= 2)
		h = params[1]

	if (params.length == 3)
		w = params[2]
		
	
	
	x= "\"" + x + "\""
	document.write("<iframe name=\"qframe\" src = " + x + " height = \"" + h + "\" width = \"" + w + "\"  scrolling='no' noresize frameborder=0 align='center'></iframe>")
	}	
}

function hideWaitLabel() {
if(navigator.appName.indexOf("Explorer") != -1) {
	document.all.waitLabel.style.visibility="hidden"
}
else {

	document.waitLabel.visibility="hidden"
}
}

function newWindow(url) {

var w = window.open(url,"","toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=500,height=500")
}

function showData(url,ext) {

url = url+ext

var w = window.open(url,"","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=500")
}

function lab(url) {
var w = window.open(url,"","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=678,height=610")
//w.location.reload();
}


function newWindow2(url,w) {
var x = "window.open(url,\"\",\"toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + w + ",height=500\")"
eval(x)
}

function calc(url,w,h) {
var x = "window.open(url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=" + w + ",height=" +h+"\")"
eval(x)
}
function newWindow3(url,w,h) {
var x = "window.open(url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + w + ",height=" +h+"\")"
eval(x)
}

function loaded () {
if (parent.ready) {
	//alert(document.forms[0].chapter.value + " " + document.forms[0].section.value)
setNav(document.forms[0].chapter.value,document.forms[0].section.value)

}
}
function questions(url, w, h) {
var x = "window.open(url,\"\",\"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=" + w + ",height=" + h +"\")"
eval(x)

}

function setNav(chapter,theSection) {
//alert(parent.frames[0].document.readyState + " " + navigator.appName)
//if (navigator.appName == "Microsoft Internet Explorer"){
 //ie = true}
//else {ie = false}

//if ( (!ie) || (parent.frames[0].document.readyState == "complete")) {
if(parent.ready) {

var chapterIndex = 0;
var sectionIndex = 0;
	for (i=0;i<parent.frames[0].chapterNames.length;i++) {
		if(chapter == parent.frames[0].chapterNames[i]) {
			chapterIndex = i;
			break;
		}
		
	}

	
	//if(parent.frames[0].window.document.forms[0].chapter.selectedIndex != chapterIndex){
	
		parent.frames[0].upDateSections(chapterIndex,theSection)
		
		parent.frames[0].upDateMode() 
		
		
	//}
	
		for (i=0;i<parent.frames[0].sectionNames[chapterIndex].length;i++) {
		//for (i=0;i< 25;i++) {
			
			if(theSection == parent.frames[0].sectionNames[chapterIndex][i]) {
				sectionIndex = i;
				
				break;
			}
		
		}
		
	
		parent.frames[0].window.document.forms[0].chapter.selectedIndex=chapterIndex
		
		parent.frames[0].window.document.forms[0].section.selectedIndex=sectionIndex
		

		parent.frames[0].upDateMode()
		theMode=document.forms[0].mode.value
	if(theMode == "s")
		parent.frames[0].document.forms[0].mode.selectedIndex = 0
	else if (theMode == "c")
		parent.frames[0].document.forms[0].mode.selectedIndex = 1
	else if (theMode == "m") 
		parent.frames[0].document.forms[0].mode.selectedIndex = 2
	

		
	}
	else  {
		
		window.location = "../chapter0/" + parent.frames[0].homeUrl[0]+".html"
		}
	
}

function lastModified() {
upDate = new Date(document.lastModified);
yr = Math.max(upDate.getYear(),2000)

document.writeln("<i>Last updated: " + (upDate.getMonth()+1) + "/" + upDate.getDate() + "/" + yr + "</i>")
}
