
var a = 0;
var b = 0;
var timeStep = 40;
var showStep = 13;


function expandBlock(_obj){
	var allDivObj = document.getElementsByTagName("DIV");
	if (allDivObj.length > 0) {
		for (var i = 0; i < allDivObj.length; i++) {
			if (allDivObj[i].className=="expandedBlock"){
				smoothCollapsed(allDivObj[i]);
			}
		}
	}
	var allInsDivObj = _obj.parentNode.parentNode.getElementsByTagName("DIV");
	
	if (allInsDivObj.length > 0) {
		for (var i = 0; i < allInsDivObj.length; i++) {
			if (allInsDivObj[i].className=="collapsedBlock"){
				smoothExpand(allInsDivObj[i]);
			}
		}
	}

}

function smoothExpand(_obj) {
	
	if (!_obj) { _obj = a;
	} else
	a = _obj;
	var realHeight = _obj.getElementsByTagName("DIV")[0].offsetHeight;
	if (_obj.clientHeight + showStep >= realHeight){
		_obj.style.height="100%";
	} else {
		_obj.style.height = (_obj.clientHeight + showStep) + "px";
		setTimeout("smoothExpand()",timeStep);
		_obj.className="expandedBlock";
	}
}

function smoothCollapsed(_obj) {
	if (!_obj) { _obj = b;
	} else
	b = _obj;
	if (_obj.clientHeight - showStep <= 220){
		_obj.style.height="220px";
	} else {
		_obj.style.height = (_obj.clientHeight - showStep) + "px";
		setTimeout("smoothCollapsed()",timeStep);
		_obj.className="collapsedBlock";
	}
}


