function EM(name,user,addr) {
	if (name == null) alert("must specify at least the name!");
	if (user == null) user = name;
	if (addr == null) addr = "neurovia.umn.edu";
	return("<a HREF=mailto:" + user + "@" + addr + ">" + name + "</a>");
}
function PR(str) {
	window.document.writeln(str);
}
// Check the browser version before loading anything in page
if (parseInt(navigator.appVersion) < 4) {
	alert("This website requires a version 4 browser!");
	onerror = suppressErrors();
}

// Set arrays for the TOP INC Navigation Bar
var topic = ["aboutus_",  "people_", "research_", "download_", "pubs_", "demos_"]; 
var wintext = [
    "About Us", 
	"INC People",
	"Research Projects",
	"Get Software and Data",
	"Search our Publications",
	"Web-based Demonstrations"
    ];


// set the image counter
var count = 0;

function suppressErrors() {return true}

// update image and window status line
function update_inc_header(img_num, towhat, topic_num) {
	document.images[img_num].src = "/incweb/images/" + topic[topic_num] + towhat + ".gif";
	window.status = wintext[topic_num];
	return true;
}

// single entry in top header navigation bar
function hdr_entry(topic,url,img,inum,tnum) {
	if (what_topic == topic) { window.document.writeln(
		"<a HREF=", url, "> ",
		"<img SRC=/incweb/images/",img,"_here.gif BORDER=0> </a>");
	} else { window.document.writeln(
		"<a HREF=",url, 
		" onMouseOver='update_inc_header("+inum+",\"over\","+tnum+")'",
		" onMouseOut='update_inc_header("+inum+",\"none\","+tnum+")'",
		" onMouseDown='update_inc_header("+inum+",\"here\","+tnum+")'>",
		"<img SRC=/incweb/images/",img,"_none.gif BORDER=0></a> ");
	}
}

// standard page header
function print_inc_header() {
	window.document.writeln(
		"<table CELLSPACING=0 CELLPADDING=2 BORDER=0 WIDTH=800 BGCOLOR=#0000A0><tr>",
			"<td WIDTH=110 ROWSPAN=2 VALIGN=center ALIGN=left NOWRAP>",
				"<img WIDTH=2 HEIGHT=47 SRC=/incweb/images/transparent.gif BORDER=0>",
				"<a HREF=/incweb/index.html TARGET=_top>",
				"<img WIDTH=100 HEIGHT=47 SRC=/incweb/images/inclogo_white.jpg BORDER=0></a>",
			"</td>",
			"<td ALIGN=center VALIGN=top><img SRC=/incweb/images/incbanner.gif></td>",
			"<td WIDTH=75 ROWSPAN=2 VALIGN=center ALIGN=center>",
				"<a HREF=http://www.nimh.nih.gov/neuroinformatics/index.cfm TARGET=_top>",
				"<img WIDTH=65 HEIGHT=48 SRC=/incweb/images/koz_logo.gif BORDER=0></a>",
				"<img WIDTH=2 HEIGHT=47 SRC=/incweb/images/transparent.gif BORDER=0>",
			"</td></tr><tr><td ALIGN=center>");
	hdr_entry("about",	"/incweb/about_intro.html",	"aboutus",	5,  0);
	hdr_entry("people",	"/incweb/sites_people.html",	"people",	6,  1);
	hdr_entry("research",	"/incweb/research_home.html",	"research",	7,  2);
	hdr_entry("download",	"/incweb/download_home.html",	"download",	8,  3);
	hdr_entry("pubs",	"/incweb/publicat.html",	"pubs",		9,  4);
	hdr_entry("demos",	"/incweb/demos_home.html",	"demos",	10, 5);
	window.document.writeln(
		"</td></tr></table>");
}

// Print the search row
function print_search()  { window.document.writeln(
	"<form HEIGHT=10 ACTION=/cgi-bin/htsearch><font SIZE=2>",
	  "<input TYPE=text SIZE=15 NAME=words VALUE=><br>",
	  "<input TYPE=image BORDER=0 VALUE=Go NAME=Go SRC=/incweb/images/search.gif>",	 
	  "<input TYPE=hidden NAME=config VALUE=incweb>",
	  "<input TYPE=hidden NAME=restrict VALUE=>",
	  "<input TYPE=hidden NAME=exclude VALUE=>",
	"</font></form>");
}

// print Table of Contents (TOC) using previously defined variables
// current location gets red spot indicator, others get mouseover events
function print_TOC(TOC) {
	window.document.writeln("<table CELLPADDING=2 CELLSPACING=3 BORDER=0 WIDTH=100%>",
		"<tr><td VALIGN=center ALIGN=center NOWRAP><font SIZE=+1 COLOR=#0000A0><b><i>",
			TOC_header,
		"</i></b></font></td></tr>");
	for (prop in TOC) {	window.document.writeln(
		"<tr><td BGCOLOR=#cccc99 VALIGN=center ALIGN=left NOWRAP><font SIZE=0 COLOR=#0000A0><b>   ");
		if  (what_TOC == prop) { window.document.writeln(
			"<img SRC=/incweb/images/TOC_pointer.gif WIDTH=10 HEIGHT=10 BORDER=0>",
			prop);
		} else { window.document.writeln(
		    "<img SRC=/incweb/images/transparent.gif WIDTH=10 HEIGHT=10 BORDER=0>",
		    "<a HREF=", TOC[prop],
		    " onMouseOver=\"document.images[" + (11 + count) + "].src = '/incweb/images/TOC_pointer_trans.gif'\"",
		    " onMouseOut=\"document.images[" + (11 + count) + "].src = '/incweb/images/transparent.gif'\"",
		    ">" + prop + "</a>");
		}
		window.document.writeln(
			"</b><br></font></td></tr>");
		count++;
	}
	print_research_TOC();
	window.document.writeln(
		"<tr><td BGCOLOR=beige VALIGN=center ALIGN=center NOWRAP>",
			"<font SIZE=-1> &nbsp; </font>",
		"</td></tr></table>");
}

// Print a single research project TOC entry with mouseover events
function print_entry(url,num,caption) {
	window.document.writeln(
		"<img SRC=/incweb/images/transparent.gif WIDTH=10 HEIGHT=10 BORDER=0>",
		"<a HREF=",url,
		  " onMouseOver=\"document.images[" + (num+count) + "].src = '/incweb/images/TOC_pointer.gif'\"",
		  " onMouseOut=\"document.images["  + (num+count) + "].src = '/incweb/images/transparent.gif'\"",
		  ">", caption, "</a><br>");
}
// Print a listing of the INC research projects as its own row in the TOC.
// Should invoked in an HTML page after the print_TOC() function defined in this file.
function print_research_TOC() {
	window.document.writeln(
		"<tr><td BGCOLOR=beige HEIGHT=100> &nbsp; </td></tr>",
		"<tr><td BGCOLOR=beige VALIGN=center ALIGN=center NOWRAP><font size=0 COLOR=#0000A0>",
			"<b>INC RESEARCH</b>",
			"</font></td></tr>",
		"<tr><td BGCOLOR=#cccc99 valign=center ALIGN=left NOWRAP><font SIZE=-2 COLOR=#0000A0>");
	print_entry("/incweb/p1/home.html", 11, "Temporal Resolution");
	print_entry("/incweb/p2/home.html", 12, "Data Analysis");
	print_entry("/incweb/p3/home.html", 13, "Visualization");
	print_entry("/incweb/ni/home.html", 14, "Neuroinformatics");
	window.document.writeln("<br>");
	print_entry("/incweb/reg-supl/home.html", 15, "Alignment");
	print_entry("/incweb/p5/home.html", 16, "Communication");
	window.document.writeln("</font></td></tr>");
}

function nav_entry(url,cap,gap) {
	window.document.writeln(
		"<td><font SIZE=-1><b><a HREF=",url,">",cap,"</a></b></font></td>");
	if (gap) window.document.writeln(
		"<td WIDTH=20 ALIGN=center>|</td>");
}
	

// output standard footer, defined as 2 sets of tables,
// the first set with 2 tables laying out a navigation bar,
// the last a single table with copyright and contact info and the UMN wordmark
function print_footer() {
	var now = new Date();
	var mod = new Date(document.lastModified);
	var modDate = (mod.getMonth() + 1) + "/" + mod.getDate() + "/" + mod.getFullYear();
	var thisYear = now.getFullYear();

	window.document.writeln("<br>",
		"<table BORDER=0 ALIGN=center CELLSPACING=0 CELLPADDING=0><tr>");
	nav_entry("/incweb/index.html","INC HOME",1);
	nav_entry("/incweb/search.html","SEARCH INC",1);
	nav_entry("/incweb/whats_new.html","WHAT'S NEW",1);
	nav_entry("/incweb/contact.html","CONTACT INC",1);
	nav_entry("/incweb/PrivacyStat.html","PRIVACY STATEMENT",1);
	nav_entry("/incweb/sitemap.html","SITE MAP",0);
	window.document.writeln(
		"</tr></table>",
		"<hr COLOR=#0000A0>",
		"<table WIDTH=100% BORDER=0><tr>",
			"<td ALIGN=left VALIGN=top WIDTH=75%><font SIZE=-2>",
				"&copy; ",thisYear," by the ",
				"<a HREF=/incweb/index.html target=_parent>International Neuroimaging Consortium</a> <br>",
				"with funding from the",
				"<a HREF=http://www.nimh.nih.gov/neuroinformatics/index.cfm TARGET=_parent>Human Brain Project</a> ",
				"and the Regents of the ",
				"<a HREF=http://umn.edu TARGET=_parent>University of Minnesota</a>. <br>",
				"The University of Minnesota is an equal opportunity educator and employer. <br>",
				"Last Modified: " + modDate,"by the INC <a HREF=mailto:webmaster@neurovia.umn.edu>Webmaster</a>.",
			"</font> </td>",
			"<td ALIGN=right VALIGN=center>",
				"<a HREF=http://www.umn.edu TARGET=_top><img BORDER=0 SRC=/incweb/images/umnwdmk_clear.gif></a>",
			"</td>",
		"</tr></table>");
}


function print_pi(project) {
	window.document.writeln("<font SIZE=+1><b>");
	switch (project) {
	case 1: window.document.writeln(
		"Project 1: Temporal Resolution of fMRI</b></font><br>",
		"<b>PI - Seong-Gi Kim, Ph.D.</b>",
		"[<a HREF=mailto:kime@geronimo.drad.umn.edu>email</a>]",
		"[<a HREF=http://www.cmrr.umn.edu/~kim/>homepage</a>]");
		break;
	case 2: window.document.writeln(
		"Project 2: Consensus Patterns in Functional Neuroimaging</b></font><br>",
		"<b>PI - Stephen C. Strother, Ph.D.</b>",
		"[<a HREF=mailto:steve@neurovia.umn.edu>email</a>]",
		"[<a HREF=/home/strothers.html>homepage</a>]");
		break;
	case 3: window.document.writeln(
		"Project 3: Computational Anatomy and Visualization</b></font><br>",
		"<b>PI - David A. Rottenberg, M.D.</b>",
		"[<a HREF=mailto:dar@neurovia.umn.edu>email</a>]",
		"[<a HREF=http:/home/dar/>homepage</a>]");
		break;
	default: window.document.writeln("Unknown project");
	}
}


// Print the standard page features and set up the main content area.
// The standard page layout is (quoted words are Javascript variables):
//           <---------------- 800 --------------->
//           +------------------------------------+
//           |       "print_inc_header()"         |
//           +------------------------------------+
//       +-  +---------+------+-------------------+  -+
//   10--| 	 | search  | two  | "subject_header"  |   |-- 40
//       +-  +---------+ row  +-------------------+  -+
//       |   | "TOC"   | gap  | main content area |   |
//  300--|   |         |      |                   |   |-- variable
//       |   |<--120-->|<-20->|<------ 660 ------>|   |
//       +-  +---------+------+-------------------+  -+
//           |         "print_footer()"           |
//           +------------------------------------+
//           <---------------- 800 --------------->
function print_prelude_toc() {
	document.writeln(
		"<table BORDER=0 WIDTH=800 HEIGHT=400>",
		"<tr>",
		"	<td ALIGN=center>");
	print_search();
	document.writeln(
			"</td>",
			"<td WIDTH=20 ROWSPAN=2> </td>",
			"<td ALIGN=center HEIGHT=40><font SIZE=5 COLOR=#0000A0><b><i>",
				subject_header,
			"</i></b></font></td>",
		"</tr><tr>",
			"<td HEIGHT=300 WIDTH=120 VALIGN=top>"
	);
	print_TOC(TOC);
	document.writeln(
			"</td>",
			"<td VALIGN=top ALIGN=left WIDTH=660>"
	);
}

function print_postscript_toc() {

// This function closes off the cell started by print_prelude_toc(),
// outputs the standard footer and closes off the main body table.
// The footer (see print_footer()) is defined as a series of tables
// which are contained in a single row spanning all columns in the
// main body table.

	document.writeln(
			"</td></tr>",
		"<tr><td VALIGN=bottom HEIGHT=20 COLSPAN=3>"
	);
	print_footer();
	document.writeln(
			"</td></tr>",
		"</table>"
	);
}





















