
/* navigation functions */

createNavItem('glossary');
createNavItem('whatis');
createNavItem('whois');
createNavItem('poibowl');
createNavItem('taropatch');
createNavItem('pondering');
createNavItem('infocredits');

function createNavItem(itemId){
	eval(itemId + '_off = new Image()');
	eval(itemId + '_off.src = "images/menu_' + itemId + '_off.gif"');
	eval(itemId + '_on = new Image()');
	eval(itemId + '_on.src = "images/menu_' + itemId + '_on.gif"');
}

function over(navId){
	document.images[navId].src = eval(navId + '_on.src');
}

function out(navId){
	document.images[navId].src = eval(navId + '_off.src');
}

/* scrolling functions */

scrollTimeoutId = null;

function contentScroll(heightInt, dirId){
	if (dirId == 'up'){
		scrollTimeoutId = setTimeout(function(){
			obj = document.getElementById('content');
			topInt = obj.style.top;
			topInt = parseInt(topInt.substring(0, topInt.length - 2));
			if (topInt < 0){
				topInt += 2;
				obj.style.top = topInt + 'px';
			}
			contentScroll(heightInt, dirId);
		}, 70);
	}
	else {
		scrollTimeoutId = setTimeout(function(){
			obj = document.getElementById('content');
			topInt = obj.style.top;
			topInt = parseInt(topInt.substring(0, topInt.length - 2));
			if (topInt > (-1 * heightInt)){
				topInt -= 2;
				obj.style.top = topInt + 'px';
			}
			contentScroll(heightInt, dirId);
		}, 70);
	}
}

function cancelScroll(){
	clearTimeout(scrollTimeoutId);
}

/* email functions */

function mail(userId, domainId, domainExt){
	document.location.href = 'mailto:' + userId + '@' + domainId + '.' + domainExt;
}
