/**
 * @author Dan Goemans
 */

function frontSetup() {}
	
function submitOnEnter(myfield,e) {
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13) {
		try {
			myfield.form.submit();
		} catch (err) {}
		return false;
	}
	else {
		return true;
	}
}

var d=document;

function findById(id){
    return d.getElementById?d.getElementById(id):(d.all?d.all[id]:(d.layers?d.layers[id]:null));
}

function setFocus() {
	var theObj = findById('search-box') ? findById('search-box') : findById('email-sub');
	if (theObj) theObj.focus();
}

function sideboxFocus (box) {
	box.style.borderLeft = box.style.borderTop = 'solid 1px #EEEEEE';
	box.style.borderRight = box.style.borderBottom = 'solid 1px #BBBBBB';
	return null;
}
function sideboxBlur (box) {
	box.style.border = 'solid 1px #FFFFFF';
	return null;
}
function controlboxFocus (box) {
	box.style.border = 'solid 1px #1e4969';
	box.style.backgroundColor = '#bdcbd5';
	box.style.color = '#1e4969';
	return null;
}
function controlboxBlur (box) {
	box.style.border = 'solid 1px #bdcbd5';
	box.style.backgroundColor = '#FFFFFF';
	box.style.color = '#bdcbd5';
	return null;
}

var currentTidbit = 0;
var tidbitBox = null;
var tidbits = [
	'<b>Manoa&nbsp;</b> <img src="/images/pronounce.gif"/> &nbsp;<i>adj.</i> Abundant, vast, deep.',
	'Manoa is a valley and a residential neighborhood of Honolulu, HI, approximately one mile from Waikiki.',
	'The University of Hawaii is located in the Manoa neighborhood of Honolulu.', 
	'The Manoa Valley is also home to the Manoa Innovation Center, a project of Hawaii\'s High Technology Development Corporation.',
	'Hawaii high-tech businesses attracted $1.4 billion in investment over the last eight years.',
	'Hawaii\'s private technology sector contributes about $3 billion to the state\'s economy annually.',
	'The island of Oahu is home to 1500 science and technology companies that employ about 20,000 people.',
	'Overall, about 60,000 Hawaii residents are employed in science, technology, engineering, and math careers.'
];

function prevTidbit() {
	currentTidbit = (tidbits.length + currentTidbit - 1) % tidbits.length;
	tidbitBox.innerHTML = tidbits[currentTidbit];
}
function nextTidbit() {
	currentTidbit = (currentTidbit + 1) % tidbits.length;
	tidbitBox.innerHTML = tidbits[currentTidbit];
}

