function toggleChildren(areaId)
{
	var id = 'children_' + areaId;
	if( document.getElementById(id).style.display == 'block' )
		document.getElementById(id).style.display = 'none';
	else
		document.getElementById(id).style.display = 'block';
}

function initRelated(id, type) {
	document.getElementById('less'+type).style.display = 'block';
	contractList(id);
}

function contractList(id) {
	document.getElementById(id+'Limited').style.display = 'block';
	document.getElementById(id).style.display = 'none';
}

function expandList(id) {
	document.getElementById(id).style.display = 'block';
	document.getElementById(id+'Limited').style.display = 'none';
}

function handleClick(e, block, action) {
	e.preventDefault();
	if( action == 'contract' )
		contractList(block);
	else
		expandList(block);
}

YUI().use('node-base', function(Y) {
	Y.on('click', handleClick, '#lessnews a', Y, 'relatedNewsBlock', 'contract');
	Y.on('click', handleClick, '#lessarticles a', Y, 'relatedArticlesBlock', 'contract');
	Y.on('click', handleClick, '#morenews a', Y, 'relatedNewsBlock', 'expand');
	Y.on('click', handleClick, '#morearticles a', Y, 'relatedArticlesBlock', 'expand');
});
