	linkDir = "../";
	secprefix = "s";
	coursenum = "1443";
	//targetframe = "contentfr";
	optlen = 14
	firstopt = 0
	mylocstr = "/web/s"
	//var vidfrloc
	//var slidefrloc
	firstsec = 0
	lastsec = 14
	
	function initFrames() {
	vidfrloc = top.vidfr.location.href
	slidefrloc = top.slidefr.location.href
	if(vidfrloc == null || slidefrloc == null) setTimeout("initFrames()","1000")
	else {
		return
		}
	}
	
	function lf() {
	vidfrl
	}
	
	function initForm() {
	sections = self.document.sectionselect.sections;
	chosen = sections.selectedIndex;
	}
	
	function getCurSec() {	
	vidfrloc = top.vidfr.location.href
	slidefrloc = top.slidefr.location.href
	secstring = vidfrloc.substring(vidfrloc.indexOf(mylocstr)+mylocstr.length);
	secstring = secstring.substring(0,secstring.indexOf("/"));
	return secstring;
	}
	
	function gotoSec(num) {		
	numT = false
	num = parseInt(num)
	//alert(typeof(num))
	if(num >= firstsec || num <= lastsec) numT = true
	if(!numT) return
	//cursec = getCurSec()
	//cursec = parseInt(cursec)	
	gotosec = num
	//alert(gotosec)
	if(gotosec < firstsec){
		return
		} 
	if(gotosec > lastsec) {
		return
		}
	else {
		top.vidfr.location.href = linkDir + "s" + gotosec + "/" + coursenum + "_s" + gotosec + "_vid.html"
		top.slidefr.location.href = linkDir + "s" + gotosec + "/" + coursenum + "_s" + gotosec + "_slide.html"
		}
	
	}
	
	function goNextPrev(np) {
	if(np == null) return
	cursec = getCurSec()
	cursec = parseInt(cursec)	
	gotosec = cursec + np
	//alert(gotosec)
	if(gotosec < firstsec){
		return
		} 
	if(gotosec > lastsec) {
		return
		}
	else {
		top.vidfr.location.href = linkDir + "s" + gotosec + "/" + coursenum + "_s" + gotosec + "_vid.html"
		top.slidefr.location.href = linkDir + "s" + gotosec + "/" + coursenum + "_s" + gotosec + "_slide.html"
		}
	
	}
	
	
		
    function getOptNum() {	
	initForm()
	optnumselect = sections.options[chosen].value;
	optnumselect = parseInt(optnumselect)
	return optnumselect;
	}
	
	function getUrl() {
	optselect = getOptNum();
	if(optselect >= 0){
	url = linkDir + coursenum + "_" + secprefix + optselect + ".html";
	return url;
	}
	else return false
	}
	
	function setVisSec() {
	num = getOptNum()
	if (num >= 0) {
		//num += num
		pagevis = "pagevis" + num
		setCookie(pagevis,"visited")
		}
	}
	
	function getVisSec() {
	if(document.getElementsByTagName) {
	for (i = firstopt; i <= optlen; i++) {
		pagevis = "pagevis" + i
		getCookie(pagevis,"visited")
		if(foundValue) {
			obj = document.getElementsByTagName("option")[(i+1)]
			changeStyle(obj,"color","#999999")
			}
		}	
	}
	}
	
	function clearHistory() {
	if(document.getElementsByTagName) {
	for (i = firstopt; i <= optlen; i++) {
		pagevis = "pagevis" + i
		getCookie(pagevis,"visited")
		if(foundValue) {
			setCookie(pagevis,"cleared")
			obj = document.getElementsByTagName("option")[(i+1)]
			changeStyle(obj,"color","black")
			}
		}
	}
	}
	
	function changeStyleOption(property,value) {	
	if(document.getElementsByTagName) {
	initForm()
	optObj = document.getElementsByTagName("option")[chosen]
	changeStyle(optObj,property,value)
	}
	}
	
	function changeStyle(obj,property,value) {
	obj = obj	
	obj.style[property] = value	
	}
	
	function gotoUrl() {
	url = getUrl()
	if(url) {
	//top[targetframe].location.href = url
		alert(url)
		}
	}

	
	
function setCookie(name,value,expires,path) {
//call with name and value; expires and path are optional
value = escape(value);
if(!expires) {expires = "";}
if(expires == "") {
	var now = new Date();
	now.setMonth(now.getMonth() + 6);
	expires = now.toGMTString();	
	}
if(!path) {path = "";}
if(path != "") {
	path = ";Path=" + path;
	}
document.cookie = name + "=" + value + ";expires=" + expires + path;
}


function getCookie(name,value) {
/*
this function sets a flag 'acceptCookie' if the browser accepts cookies
if called without arguments, the cookie string is assigned to 'cookieString'
if 'name' is the only argument, check and set 'foundName' flag and place cookie name and value in 'nameValString' if true
if called with 'name' and 'value', set 'foundValue' flag to true
*/

acceptCookie = false;
foundName = false;
foundValue = false;
cookieString = "";
nameValString = "";

if(document.cookie) {
	cookieString = document.cookie; 
	acceptCookie = true; 
	if(!name) {
		return;
		}	
	if(name && !value) {
		if(cookieString.indexOf(name) != -1) {
			foundName = true		
			nameValString = cookieString.substring(name)
			nameValString = nameValString.substring(0,nameValString.indexOf(";"))			
			}			
		}	
	if(value) {
		if(cookieString.indexOf(name) != -1) {
			foundName = true
			}	
		
		var nameval = name+"="+value
		if(cookieString.indexOf(nameval) != -1) {
			foundValue = true
			}		
		}	
	}
}

function readQueryChangeImgCapCred() {	
	/*
	this function should be called when the page loads. this page should be called within a frameset or from a video merge file. in the latter case, this page should be referenced with a query string consisting of a number that corresponds to the slide that should be displayed.
	*/
	
	/*if(top.location == self.location){
		//if we're not the top, load the frameset that we're supposed to appear in and return.
		//topfr = "testpushfr.html" //frameset href	
		//top.location = topfr
		return
		}
	*/
	self.top.focus()	
	qs = location.search
	qs = qs.substring(1)
	if (qs.length == 0) {
		//if called with no query string, return
		return
		}
	parseInt(qs)
	hiliteLayer(qs)
	}
	
function hiliteLayer(laynum) {	
	if(document.layers) {
	visible = "show"
	hidden = "hide"
	}
	else {
	visible = "visible"
	hidden = "hidden"
	}
	layid = "lay"	
		for (i = 1; i <= laynum;i++) {
		layid +=i
		if (document.getElementById) {
			obj = document.getElementById(layid)
			objstyle = obj.style	
			}
		else if (document.layers)	{
			obj = document.layers[layid] 
			objstyle = obj
			}
		else if (document.all) {
			obj = document.all[layid]
			objstyle = obj.style
			}
		layid = "lay"
		objstyle.visibility = hidden	
		}
	layid += laynum
	if (document.getElementById) {
		obj = document.getElementById(layid)
		objstyle = obj.style	
		}
	else if (document.layers)	{
		obj = document.layers[layid] 
		objstyle = obj
		}
	else if (document.all) {
		obj = document.all[laylayid]
		objstyle = obj.style
		}
	objstyle.visibility = visible	
	}

function openWin(url,winname,w,h) {
	winUrl = url;	
	topWin = (screen.availHeight - w) / 2;
	leftWin = (screen.availWidth - h) / 2;
	props="width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,menubar=yes,scrollbars=yes,status=yes";
	var myWin = window.open(winUrl,winname,props);
	myWin.focus();
}

function printit(framenm) {
	if (window.print) {
		if (printit.arguments.length >=1)
	 	window.top.frames[framenm].print();
		else
		window.print();
	}
	else {
 		if (navigator.platform.indexOf('Mac') != -1) alert('This function does not work on your browser! \n Please select the Print option from the File menu.');
		else if (navigator.platform.indexOf('Win') != -1) alert('This function does not work on your browser! \n Please right click on your mouse and select the Print option.');
		else alert('This function does not work on your browser!');
 	}
}