function index_run_onload()
{
	if (location.search) {
		document.location.href = 'index.html';
	}
}

function studyClick(study)
{
	switch(study) {
		case 'VasoOxy':
		case 'Narsad':
		case 'OxySAP':
			type = 'biological';
			break
		case 'fludep':
		case 'crcst_k':
			type = 'treatment';
			break
		case 'pbs':
		case 'mia':
			type = 'imaging';
			break
		case 'narsad':
		case 'brf':
		case 'chronic':
			type = 'depression';
			break
		case 'penntwin':
			type = 'twins';
			break
		case 'family2':
			type = 'family';
			break
		case 'sophohv':
			type = 'imaging';
			break
		case 'thc':
			type = 'biological';
			break
		default:
			type = 'gen_research';
	};
	parent.location.href = "research.html?" + type + ',' + study;
}

{
	var i = 0;
	var j = 13;
	i = (Math.round(Math.random()*j));
}

function randImage()
{
	if (location.search) {
		if (location.search.substring(1) == "chipmunk") {
			document.write('<img src="ucpics/chipmunk.jpg" title="University of Chicago" alt="Hospital Image" width=340 border=0>');
		}
	} else {
		if (i == 13) {
			i = (Math.round(Math.random()*j));
			if (i == 13) {
				i = 'chipmunk';
			}
		}
		document.write('<img src="ucpics/' + i + '.jpg" title="University of Chicago" alt="Hospital Image" width=340 border=0>');
	}
}
function sum(myArray)
{
	tsum = 0;
	size = myArray.length;
	for (j = 0; j < size; j++) {
		tsum = tsum + myArray[j];
	}
	return tsum;
}
function faculty_mouse_on(x) {
	xa = frames['facultydescription'].location.href;
	xaa = xa.split("/");
{
		document ["faculty"].src = "images/" + fac[x] + ".jpg";
		document [fac[x]].src = "images/marker_on.gif";
	}
}
function faculty_mouse_out(x) {
	if (sum(a) != 1) {
		document ["faculty"].src = "images/faculty.jpg";
	}
	if (a[x] != 1) {
		document [fac[x]].src = "images/marker_0.gif";
	}
	size = fac.length;
	for (j = 0; j < size; j++) {
		if (a[j] == 1) {
			document ["faculty"].src = "images/" + fac[j] + ".jpg";
		}
	}
}
function faculty_mouse_click(x) {
	size = fac.length;
	for (j = 0; j < size; j++) {
		document [fac[j]].src = "images/marker_0.gif";
		a[j] = 0;
	}
	a[x] = 1;
	document ["faculty"].src = "images/" + fac[x] + ".jpg";
	document [fac[x]].src = "images/marker_on.gif";
}
function faculty_run_onload()
{
	if (location.search) {
		query = location.search.substring(1);
		pairs = query.split(',');
		window.frames['facultydescription'].location.replace(pairs[0] + ".html");
	} else {
		window.frames['facultydescription'].location.replace("gen_faculty.html");
	}
}

function research_mouse_on(x) {
	//document ["general"].src = "images/" + fac[x] + "_on.jpg";
	//document ["general"].src = "images/studytemplate.jpg";
	document [fac[x]].src = "images/marker_on.gif";
}
function research_mouse_out(x) {
	document ["general"].src = "images/research.jpg";
	if (a[x] != 1) {
		document [fac[x]].src = "images/marker_0.gif";
	}

}
function research_mouse_click(x) {
	size = fac.length;
	for (j = 0; j < size; j++) {
		document [fac[j]].src = "images/marker_0.gif";
		a[j] = 0;
	}
	a[x] = 1;
	document ["general"].src = "images/" + fac[x] + "_on.jpg";
	document [fac[x]].src = "images/marker_on.gif";
}
function research_run_onload()
{
	if (location.search) {
		query = location.search.substring(1);
		pairs = query.split(',');
		window.frames['studydescription'].location.href = pairs[0] + ".html?" + pairs[1];
	} else {
		window.frames['studydescription'].location.href = "gen_research.html";
	}
}


	function mouse_on(x) {
		//parent ["general"].src = "images/" + fac[x] + "_on.jpg";
		document [fac[x]].src = "images/marker_on.gif";
	}
	function mouse_out(x) {
		//parent ["general"].src = "images/research.jpg";
		if (a[x] != 1) {
			document [fac[x]].src = "images/marker_0.gif";
		}

	}
	function mouse_click(x) {
		size = fac.length;
		for (j = 0; j < size; j++) {
			document [fac[j]].src = "images/marker_0.gif";
			a[j] = 0;
		}
		a[x] = 1;
		//parent ["general"].src = "images/" + fac[x] + "_on.jpg";
		document [fac[x]].src = "images/marker_on.gif";
	}
	function run_onload()
	{
		if (location.search) {
			query = location.search.substring(1);
			pairs = query.split(',');
			window.frames['studydescription'].location.replace(pairs[0] + ".html");
		} else {
			window.frames['studydescription'].location.replace("gen_research.html");
		}
	}
	

function gen_mouse_on(x) {
	document [x].src = "images/marker_on.gif";
}

function gen_mouse_out(x) {
	document [x].src = "images/marker_0.gif";
}
