///-------------------------------------------------------------------------------------

///-----Sliding-text-----------------------------------------------------
/* EXAMPLE
	fullInfo(ID, BLOCK HEIGHT, SPEED, SPEEDUP);
*/

var bHeight = new Array();
var i = new Array();
var condition = new Array;
var blocked = new Array();
var sVal; 
var current_id=0;


function move(id,opHeight,speed,speedup){

	bHeight[id] = 1;
if(!i[id])
	i[id] = bHeight[id];

if(speed <= 0)
	speed = 1;
	//alert (condition[id]);
	//blocked[id] = 1;
	if(!condition[id]){
		if(i[id] < opHeight){

			if(speedup > 0){
				i[id] += speed * speedup * ((opHeight-i[id])/opHeight)
				i[id] = Math.round(i[id] * 40) / 40;
				if(i[id] > (opHeight-1))
					i[id] = opHeight;
			}else{
				i[id] = i[id] + speed
			}

			if(i[id] > opHeight)
				i[id] = opHeight;		
			document.getElementById(id).style.height = i[id]+'px';
			setTimeout("move('"+id+"',"+opHeight+","+speed+","+speedup+")",50);
		}else{
			i[id]=1;
			//condition[id] = condition[id]?0:1;
			//blocked[id] = 0;
		}
	
	}/*else{
		if(i[id] > bHeight[id]){
			
			if(speedup > 0){
				i[id] -= speed * speedup * (i[id]/opHeight)
				i[id] = Math.round(i[id] * 40) / 40;
				if(i[id] < (bHeight[id]+1))
					i[id] = bHeight[id];
			}else{
				i[id] = i[id] - speed;
			}			

			if(i[id] < bHeight[id])
				i[id] = bHeight[id];
			document.getElementById(id).style.height = i[id]+'px';
			setTimeout("move('"+id+"',"+opHeight+","+speed+","+speedup+")",50);	
		}else{
			condition[id] = condition[id]?0:1;
			blocked[id] = 0;
		}
	}*/
}


function fullInfo(id,opHeight,speed,speedup){
/*if(condition[id] !=1){
	condition[id] = 0;
	i[id] = bHeight[id];
}*/
//alert ("i[id]= "+i[id]+"  id= "+ id);

if (id=='menu24') {
document.getElementById(id).style.visibility="visible";
document.getElementById(id).style.display="block";
}
else {
document.getElementById(id).style.visibility="visible";
}
//if(!blocked[id])
	move(id,opHeight,speed,speedup);
	
	if (current_id!=0 && current_id!=id)
	{ 
	if (current_id=='menu24')
	{document.getElementById(current_id).style.visibility="hidden";
	 document.getElementById(current_id).style.display="none";
	}
	else {
	document.getElementById(current_id).style.visibility="hidden";
	//document.getElementById(current_id).style.display="none";	
	}
	}
current_id=id;
}
///----------------------------------------------------------------------
function move_w (id,opHeight,speed,speedup){
	bHeight[id] = 1;
if(!i[id])
	i[id] = bHeight[id];

if(speed <= 0)
	speed = 1;

	blocked[id] = 1;
	if(!condition[id]){
		if(i[id] < opHeight){
			if (id=='main_m')
			{i[id]=opHeight;
			condition[id] =1;
			}		
		
			if(speedup > 0){
				i[id] += speed * speedup * ((opHeight-i[id])/opHeight)
				i[id] = Math.round(i[id] * 40) / 40;
				if(i[id] > (opHeight-1))
					i[id] = opHeight;
				}else{ 
				i[id] = i[id] + speed;
			}

			if(i[id] > opHeight)
				i[id] = opHeight;
			
			document.getElementById(id).style.width = i[id]+'px';
			setTimeout("move_w('"+id+"',"+opHeight+","+speed+","+speedup+")",50);
		}else{
			
			condition[id] = condition[id]?0:1;
			blocked[id] = 0;
		}
	
	}else{
		if(i[id] > bHeight[id]){			
			if(speedup > 0){
				i[id] -= speed * speedup * (i[id]/opHeight)
				i[id] = Math.round(i[id] * 40) / 40;
				if(i[id] < (bHeight[id]+1))
					i[id] = bHeight[id];
			}else{
				i[id] = i[id] - speed;
			}			
			if(i[id] < bHeight[id])
				i[id] = bHeight[id];
			document.getElementById(id).style.width = i[id]+'px';
			setTimeout("move_w('"+id+"',"+opHeight+","+speed+","+speedup+")",50);	
		}else{
			condition[id] = condition[id]?0:1;
			blocked[id] = 0;		

			
			if (id=='main_m')
			{
			document.getElementById(id).style.visibility="hidden";
			//document.getElementById("arrow_r").setAttribute('src', "/img/rus/arrow_r_i.gif");
			//document.getElementById("arrow_l").setAttribute('src', "/img/rus/arrow_l_i.gif");		
			//document.getElementById('long_menu').style.display="block";	
			
			}	
			
			/* change arrows here
			if (id=='main_m')
			{i[id]=opHeight;
			condition[id] =1;
			}*/ 			
		}
	}

}

function menu_1 (id,opHeight,speed,speedup){
if(condition[id] !=1){
	condition[id] = 0;
	i[id] = bHeight[id];
}
if(!blocked[id])
	move_w(id,opHeight,speed,speedup);
}

function menu_hide ()
{
menu_1('menu1',770,15,0); /* width pf the long menu */
document.getElementById('long_menu').style.display="block";
}

function main_menu ()
{
menu_1('main_m',120,20,0);
timer = setTimeout("menu_hide ()", 1000);
}