///-------------------------------------------------------------------------------------

///-----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){
	
document.getElementById(id).style.visibility="visible";
	move(id,opHeight,speed,speedup);
	
	if (current_id!=0 && current_id!=id)
	{
	document.getElementById(current_id).style.visibility="hidden";
	//document.getElementById(current_id).style.display="none";
	}
current_id=id;

	if (id!="menu24"){
	document.getElementById("divText").style.visibility="hidden";
	}
	else{
	document.getElementById("divText").style.visibility="visible";
	}
}
///----------------------------------------------------------------------
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_show ()
{
menu_1('menu1',945,15,0); /* width pf the long menu */
	if ((navigator.appName=="Microsoft Internet Explorer") && (navigator.userAgent.indexOf("Opera")==-1))
	{
	timer = setTimeout("opacity ()", 3000);
	}
	else
	{
	timer = setTimeout("show_menu ()", 3500);
	}
}

function main_menu ()
{
menu_1('main_m',120,20,0);
timer = setTimeout("menu_show ()", 1000);
//music_on = 0;
//switch_music();
}

function opacity ()
{
	document.getElementById("menu1").style.filter = "blendTrans(duration=3)";
	document.getElementById("menu1").filters.blendTrans.apply();
	document.getElementById("menu1").style.visibility = "visible";
	document.getElementById("menu1").filters.blendTrans.play();
}
function show_menu ()
{
document.getElementById("menu1").style.visibility = "visible";
}
