
var timeIn;
var timeOut;
var lastIn;
var lastOut;
function toggleIn(navstr, elem){
	if (lastIn == navstr){
		window.clearTimeout(timeOut);
	}
	lastIn = navstr;
	timeIn = window.setTimeout(function() {
		document.getElementById(navstr).style.display='block';
		elem.style.backgroundColor='#FF9900';
	}, 200);
}
function toggleOut(navstr, elem){
	if (lastOut == navstr){
		window.clearTimeout(timeIn);
	}
	lastOut = navstr;
	timeOut = window.setTimeout(function() {
		document.getElementById(navstr).style.display='none';
		elem.style.backgroundColor='';
	}, 200);
}
		
		
		
function pageScroll() {
	var scrolldelay;
	window.scrollBy(0,-30); // pixels
	scrolldelay = setTimeout('pageScroll()',20); // milliseconds
	
	if (document.documentElement.scrollTop <= 0){
		clearTimeout(scrolldelay);
	}
}
