var s_focus = new Array();
var s_group = false;
var s_idbg  = '#s_idbg';

function draw (g, i, b) {
	if (!s_focus[g]) s_focus[g] = new Array();
	for(var j in s_focus[g]) {setOff(s_focus[g][j]);} 
	
	s_focus[g][i] = i;
	setOn(i);
	if (b) {s_group = g; $(s_idbg).css({'display': 'inline'});}
}

function setOn  (i) {for(var j in i) {
	var move = i[j][0];
	var id   = i[j][1];
	var mean = i[j][2];
	
	if (move == 'c')  $(id).css(mean);
	if (move == 'a') {$(id).stop(true); $(id).animate(mean,i[j][4],'linear',(i[j][6] ? i[j][6] : false));}
	if (move == 'class')     document.getElementById(id).className = mean;
	if (move == 'innerHTML') document.getElementById(id).innerHTML = (mean ? mean : document.getElementById(i[j][4]).innerHTML);
}}
function setOff (i) {for(var j in i) {
	var move = i[j][0];
	var id   = i[j][1];
	var mean = i[j][3];
	
	if (move == 'c')  $(id).css(mean);
	if (move == 'a') {if (!i[j][6]) $(id).stop(true); $(id).animate(mean,(i[j][5] ? i[j][5] : i[j][4]),'linear',(i[j][6] ? i[j][6] : false));}
	if (move == 'class')     document.getElementById(id).className = mean;
	if (move == 'innerHTML') document.getElementById(id).innerHTML = (mean ? mean : document.getElementById(i[j][5]).innerHTML);
}}

function im_out () {
	for(var j in s_focus[s_group]) {setOff(s_focus[s_group][j]);} 
	$(s_idbg).css({'display': 'none'});
}

//==================================================
function dic_on (id) {
	if (document.getElementById(id).style.display == 'inline')
		document.getElementById(id).style.display = 'none';
	else 
		document.getElementById(id).style.display = 'inline';
}


function move_bOut($i)
{
	$('#img_0'+$i).stop(true); 
	$('#img_0'+$i).animate({width: '80px',left: '0px',top: '-5px'},50);
}

function move_bOve($i)
{
	$('#img_0'+$i).stop(true); 
	$('#img_0'+$i).animate({width: '70px',left: '5px',top: '0px'},30);
}
