function pause(millis)
{
	var date = new Date();
	var curDate = null;

	do { curDate = new Date(); }
	while(curDate - date < millis){};
} 

function comprimir(h2, objeto) {
	var obj = document.getElementById(objeto);
	
	var tamanno = obj.clientHeight;
	var retardo = 10; //ms

	var timer = setInterval(function() {
		if(h2.clientHeight < obj.clientHeight)
			obj.style.height = (obj.clientHeight - 2)+"px";
		else
			clearInterval(timer);
	}, 10);

   h2.setAttribute('onmousedown', 'expandir( this, "'+objeto+'" , '+tamanno+'), 1' );
}

function expandir(h2, objeto,maximo) {
	var obj = document.getElementById(objeto);
	
	var tamanno = obj.clientHeight;
	var retardo = 10; //ms

	var timer = setInterval(function() {
		if(obj.clientHeight < maximo)
			obj.style.height = (obj.clientHeight + 2)+"px";
		else
			clearInterval(timer);
	}, 10);
	
	h2.setAttribute('onmousedown', 'comprimir(this, "'+objeto+'" , 30)' );
}
