function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

addLoadEvent(function() {
	if (document.getElementById("home-photo")) {
	var nums = new Array()
	var j;j=parseInt(Math.random()*14);j=(isNaN(j))?0:j;j=j+1;
	var li = document.getElementById("home-photo").getElementsByTagName("p");
	li[0].className+="home-photo"+j;
	}
	else {
	return;
	}
})
addLoadEvent(function() {
	l=window.location.toString(); s=l.split("/");
	// ********* CHANGE ME  ****************************************************************
	f=s[3]; // Change this number to the number of slashes in the URL before the home page
	
	if (f == "index.php" || f == "") {
		return;
	}
	else {
		cn = "n-" + f;
		var nli = document.getElementById(cn);
		nli.className+="location";
	}
})
// JavaScript for Vertical Popup Nav
// javascript for IE/win, since it does not support li:hover
addLoadEvent(function() {
if (document.all) { 
	var li = document.getElementById("nav").getElementsByTagName("li");
	for (var i=0; i<li.length; i++) {
		li[i].onmouseover=function() {
			if(this.className != "nosub") {
				this.className+="iewin";
			}
		}
		li[i].onmouseout=function() {
			if (this.className == "locationiewin") {
				this.className=this.className.replace(new RegExp("locationiewin\\b"), "location");
			}		
			else {
				this.className=this.className.replace(new RegExp("iewin\\b"), "");
			}
		}
	}
	}
	else {
		return;
		}
})

/* 
addLoadEvent(function() {
   var pt = document.getElementById("page-title").innerHTML;
	 document.title = pt + " | Department of Computer Science | University of Pittsburgh";
})


Dynamically applies alternating table row colors
Created by Jamin Hegeman

1. Include the script in the page head
2. Assigned the relevant table (or tables) the "striped" class
3. Create a "ruled" class in your style sheet with the appropriate background color

Optional

Create a "striped" class in the style sheet to apply a border, or alter the table in some other manner


addLoadEvent(function() {
	var t = document.getElementsByTagName("table");
	for (var i=0; i<t.length; i++) {
		if (t[i].className == "striped") {
			var trs = t[i].getElementsByTagName("tr");
			for (var j=0; j<trs.length; j++) {
				if (j%2 == 0){} 
				else {trs[j].className+="ruled";}
			}
		}		
	}
})
*/

/*******************************************
 * Kaosweaver Expert Breadcrumbs           *
 * by Paul Davis http://www.kaosweaver.com * 
 * Copyright 2003 all rights reserved      *
 *******************************************/
var KW_uTitle=document.title
function KW_breadcrumbs(o,m,n,r,f,q,v) { // v1.3.0
	d=document;l=window.location.toString(); s=l.split("/");d1=" "+m+" "
	if (f!=-1) if (l.indexOf(f)!=-1){sNew = new Array(); for (i=0;i<s.length-1;i++) {sNew[i] = s[i]};
	s = sNew;};i=q;	h="<a href='"+KW_jTrail(l,i)+f+"'>"+o+"</a>";
	t=KW_uTitle;if (s.length==q) {h=t;d1=""}	w=(r==1)?h+d1:t;
	d.write(w);if (n&&!r) d.write("<br>");if (r==1) for (i=v;i<s.length;i++) {d.write("<a href='");
	d.write(KW_jTrail(l,i)+f+"'>"+KW_fName(s[i-1])+"</a> "+m+" ")
	l=window.location.toString();} else for (i=s.length;i>v;i--) {d.write(" "+m)
	d.write(" <a href='"+KW_jTrail(l,i-1)+f+"'>"+KW_fName(s[i-2])+"</a>");
	l=window.location.toString();}

	/* This writes the page title -- don't want that in this case
	*************************************************************
	if (n && r) d.write("<br>");
	w=(r==1)?t:d1+h;
	if (s.length!=q) d.write(w)
	*************************************************************
	*/
	
}
function KW_jTrail(l,i){ // v1.3.0
	p=0;for (z=0;z<i;z++)p=l.indexOf("/",p)+1;return l.substring(0,p)
}
function KW_fName(a) { // v1.3.0
	a=unescape(a); g=a.split(' '); for (l=0;l<g.length;l++)	
	g[l]=g[l].toUpperCase().slice(0,1)+g[l].slice(1);retVal=g.join(" "); 
	nList= new Array("biological-health", "Biological Health", "clinical-health", "Clinical/Health", "clinical-dev", 
									 "Clinical/Developmental", "cognitive-neuro", "Cognitive Neuroscience", "positions", "Employment",
									 "experiential-learning", "Experiential Learning", "directed-research", "Directed Research", 
									 "field-placement", "Field Placement")
	for (var x=0;x<nList.length;x=x+2) 	if (a==nList[x]) {retVal=nList[x+1];break;}	
	return retVal;
}