function firstFocus() {
	if (document.getElementById) {
		var firstItem;
		firstItem = document.getElementById('search_box');
		if (firstItem!=null) firstItem.focus();
	}
}

window.onload = function() {
	firstFocus();
//	setFooter();
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			if (oldonload) oldonload();
			func();
		}
	}
}


function setFooter() {
	return;
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight>0) {
			var contentHeight = document.getElementById('container').offsetHeight;

			if (windowHeight > contentHeight) {
				
				var footerHeight = document.getElementById('clafooter').offsetHeight + document.getElementById('purduefooter').offsetHeight;
				var headerHeight = document.getElementById('header').offsetHeight;
				var bannerHeight = document.getElementById('banner').offsetHeight;
				
				areaHeight = windowHeight-headerHeight-footerHeight-bannerHeight-1;

				var mainElement = document.getElementById('mainarea');
				mainElement.style.height = (areaHeight) + 'px';
			}
		}
	}
}


function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

