
var stateNews = 0;

function __mouse(obj, name, state)
{
	obj.src = '/images/btn-' + name + '-' + state + '.png';
}


function __slide_up(id, h)
{
	var o = document.getElementById(id);

	if(h > 0)
	{
		h -= 20;
		if(h < 0) h = 0;
		o.style.height = h + 'px';
		setTimeout('__slide_up(\''+id+'\','+h+')', 1);
	} else
	{
		o.style.height = 0 + 'px';
		stateNews = 0;
	}
}

function __slide_down(id, h, th)
{
	var o = document.getElementById(id);
	var ow = o.style.width;
	var rw = ow.substr(0, ow.indexOf('px'));

	if(h < th)
	{
		h += 20;
		o.style.height = h + 'px';
		setTimeout('__slide_down(\''+id+'\', '+h+', '+th+')', 1);
	} else
	{
		stateNews = 1;
		o.style.height = th + 'px';
	}
}


function __slide_toggle(id, th)
{
	var o = document.getElementById(id);
	var oh = o.style.height;
	var on = oh.substr(0, oh.indexOf('px'));

	if(stateNews==1)
	{
		__slide_up(id, on);

	} else
	{
		__slide_down(id, on, th);
	}
}