/***********************************************************************
*  MAIN.JS
*
*  (C) 2004 - Brent Gustafson - walkerart.org
***********************************************************************/ 


/* Globals */
var navOn = "#E2E2E2";		//nav rollover color
var navOff = "#F2F2F2";		//nav rolloff color
var formOn = "#F8F8F8";		//form field focus color
var formOff = "#FFFFFF";	//form field blur color
var logos = 6;				//num of header images
var lastSect = 0;
var lastOn = 0;
var lastContent = 0;
var logoSub = 0;
var logoArr = new Array("","1277","1281","1247","1289","1279","1254");

/* Functions */
function color(obj, color) {
	document.getElementById(obj).style.backgroundColor = color;
}

function go(place) {
	document.location = place;
}

function swapLogo() {
	var randNum = Math.round(Math.random() * logos) + 1;
	if (randNum == logos+1) randNum = logos;
	document.getElementById("head_top").src = "/images/head_top" + randNum + ".jpg";
	document.getElementById("head_bot").src = "/images/head_bot" + randNum + ".jpg";
	logoSub = randNum;
}

function mapOn(id) {
	document.getElementById("map_on").src = "/images/map_" + id + ".gif";
	if (lastSect) {
		hide("sect_" + lastSect);
		document.getElementById("d" + lastSect).style.backgroundColor = "transparent";
	}
	show("sect_" + id);
	document.getElementById("d" + id).style.backgroundColor = "#CCCCCC";
	lastSect = id;
}

function mapOver(id) {
	if (id) document.getElementById("map_over").src = "/images/map_" + id + ".gif";
	else document.getElementById("map_over").src = "/images/pix.gif";
}

function show(id) {
	document.getElementById(id).style.display = "block";
}

function hide(id) {
	document.getElementById(id).style.display = "none";
}

function contentOn(id) {
	if (lastContent) {
		hide("title_" + lastContent);
		hide("content_" + lastContent);
	}
	show("title_" + id);
	show("content_" + id);
	lastContent = id;
}

function popup(url, width, height) {
	var properties = "resizable=yes,width=" + width + ",height=" + height;
	var myPopup = window.open(url, "myPopup", properties);
	myPopup.focus();
}