// JavaScript Document


var expandTo;
var current;
var t;
var speed = 15;
	
function expand() {
	if(current >= expandTo) {
		clearTimeout(t);
		return;
	} else {
		document.getElementById("leftContent").style.height=current+'px';
		document.getElementById("mainContent").style.height=current+'px';
		document.getElementById("rightContent").style.height=current+'px';
		current++;
		t=setTimeout('expand()',speed);
	}
}


//var z=300;
function collapse() {
	if(current <= expandTo) {
		clearTimeout(t);
		return;
	} else {
		document.getElementById("leftContent").style.height=current+'px';
		document.getElementById("mainContent").style.height=current+'px';
		document.getElementById("rightContent").style.height=current+'px';
		current--;

		t=setTimeout('collapse()',speed);
	}
}


function changeIt(arg) {
	//alert(document.getElementById("change").offsetHeight + " SI SENOR ");
	current = document.getElementById("mainContent").offsetHeight;
	if(current < arg){
		expandTo = arg;
		clearTimeout(t);
		expand();
	} else {
		expandTo = arg;
		clearTimeout(t);
		collapse();
	}
}


function displayHeight(){
	var textHeight = document.getElementById("mainText").offsetHeight;
	alert("current height: " + textHeight);
}


function adjustDiv(){
	var textHeight = document.getElementById("mainText").offsetHeight;
	if(textHeight > 300){
		textHeight += 32;	
	}
	changeIt(textHeight);
}


function adjustListedDiv(){
	var textHeight = document.getElementById("list").offsetHeight;
	if(textHeight > 300){
		textHeight += 80;	
	}
	changeIt(textHeight);
}


function changeClass(){
	theDiv = document.getElementById("mainText");
	theDiv.className = "listText";
}