var intv = false;
var intv2 = false;
var scroller = null;
var timo2 = null;
function jumpto(that, theid) {
	scroller = document.getElementById(theid);
	scroller.style.top = that.parentNode.offsetTop + 'px';
	scroller.style.height = that.parentNode.offsetHeight + 'px';
}
function scrollIt(that, theId) {
	that = that.parentNode;
	
	scroller = document.getElementById(theId);
	if (that == 'first') {
		that = document.getElementById('first').parentNode;
	}

	scrolling = function() {
		if (scroller.offsetTop < that.offsetTop) {
			scroller.style.top = Math.round((scroller.offsetTop + (((that.offsetTop - 1) - scroller.offsetTop) / 8))) + 'px';
		}
		else if (scroller.offsetTop > that.offsetTop) {
			scroller.style.top = Math.round((scroller.offsetTop - ((scroller.offsetTop - (that.offsetTop-1)) / 8))) + 'px';
		}
		else {
			window.clearInterval(intv);
			scroller.style.top = that.offsetTop + 'px';
		}
	}
	resizing = function() {
		if (scroller.offsetHeight < that.offsetHeight) {
			scroller.style.height =  Math.round(scroller.offsetHeight + 1) + 'px';
			if (scroller.offsetHeight >= that.offsetHeight) {
				window.clearInterval(intv2);
				scroller.style.height = that.offsetHeight + 'px';
			}
		}
		else if (scroller.offsetHeight > that.offsetHeight) {
			scroller.style.height = Math.round(scroller.offsetHeight - 1) + 'px';
			if (scroller.offsetHeight <= that.offsetHeight) {
				window.clearInterval(intv2);
				scroller.style.height = that.offsetHeight + 'px';
			}
		}
		else {
			window.clearInterval(intv2);
		}
	}
	colorChanging = function() {
	
	}

	clearTimeout(timo2);
	window.clearInterval(intv);
	window.clearInterval(intv2);
	intv = window.setInterval('scrolling()', 15);
	intv2 = window.setInterval('resizing()', 20);
	
	that.onmouseout = function() {
		clearTimeout(timo2);
		timo2 = setTimeout("scrollIt(document.getElementById('first'), 'scroller')",  300);
	}
}
window.onload = function() {
	jumpto(document.getElementById('first'), 'scroller');
}
