/*
FRONT.JS
Front Page JavaScript Routines
  XCEL Website
  http://xcel.binghamton.edu
Author: Saugata Ghose
Last Update: October 11, 2006
*/

var currentlyOpen = 0;

function OpenBox(name) {
	var currentBox;
	
	currentBox = document.getElementById('introBox');
	currentBox.style.display = 'none';
	
	CloseBox();

	currentBox = document.getElementById(name + 'Box');
	currentBox.style.display = 'block';
	
	currentlyOpen = name;
}

function ResetBox() {
	currentlyOpen = -1;
	
	window.setTimeout('ShowIntroBox()', 200);
}

function ShowIntroBox() {
	var currentBox;
	
	if(currentlyOpen == -1) {
		CloseBox();
		
		currentBox = document.getElementById('introBox');
		currentBox.style.display = 'block';
		
		currentlyOpen = 0;
	}
}

function CloseBox() {
	var nameList = new Array();
	var currentBox;
	
	nameList[0] = 'labs';
	nameList[1] = 'involved';
	nameList[2] = 'recognize';
	nameList[3] = 'services';
	nameList[4] = 'links';
	nameList[5] = 'staff';
	
	for(var i = 0; i < nameList.length; ++i) {
		currentBox = document.getElementById(nameList[i] + 'Box');
		currentBox.style.display = 'none';
	}
	
	currentlyOpen = -1;
}