/*-----------------------------------------------------------------------------
|                                                                             |
|  shared.js                                                                  |
|                                                                             |
|  Think Computer Corporation                                                 |
|  Generic Site Rollover Functions                                            |
|  JavaScript Library                                                         |
|                                                                             |
|  Copyright © 2001-2004 Think Computer Corporation. All Rights Reserved.     |
|                                                                             |
-----------------------------------------------------------------------------*/

// Rollovers

netscape = navigator.appName == "Netscape";
netscape4 = netscape && parseInt(navigator.appVersion) <= 4;
ie = navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4;
hover = netscape || ie;

links = new Array('about', 'interviews', 'publications', 'news', 'links');
path = '/shared/top/';
extension = 'jpg';

if (hover) {
	for (i = 0; i < links.length; i++) {
		eval(links[i] + "1 = preload('" + path + links[i] + "1." + extension + "');");
		eval(links[i] + "2 = preload('" + path + links[i] + "2." + extension + "');");
	}
}			

function preload(img)
{
	var a = new Image();
	a.src = img;
	return a;
}

function defaultState()
{
	if (hover) {
		for (i = 0; i < links.length; i++) {
			eval("document['" + links[i] + "'].src=" + links[i] + "1.src;");
		}
	}
}

function rollover(name, rollBack)
{
	if (hover) {
		defaultState();
		if (rollBack)
			eval("document['" + name + "'].src=" + name + "2.src;");
	}
}

// Pop-Up Windows

function openWindow(path, name, width, height, format)
{
	window.open(path, name, "width=" + width + ",height=" + height + format);
}