// opcion menu superior
var opcion = ' '


//onLoad=init()
function init(fichero){
	
	//incializar capas
	DynLayerInit()//inicializar var movimiento	
	//movimiento lado Izquierdo pantalla
	//ladoIzquierdoPantalla()
	
	if (typeof bola!='undefined'){
		
		moverBola()
		//mostrarScroll
		mostrarScroll()
	}
	
}




//mostrar opcion menu superior
function mostrar(obj, nom, x1, x2)
{
	//solo si no se repite opcion
	if ( nom != opcion)
	{
		//si no hay ninguno en movimiento
		if ((estrenos.glideActive != true) && (video.glideActive != true) && (sales.glideActive != true) && (anillos.glideActive != true) && (prensa.glideActive != true))
		{
			
			// esconder menu opcion anterior
			switch(opcion)
			{
				case 'estrenos': esconder( estrenos, 'estrenos')
										break;
				case 'video': esconder( video, 'video' )	
										break;
				case 'sales': esconder( sales, 'sales' )
										break;
				case 'anillos': esconder( anillos, 'anillos' )
										break;
				case 'prensa': esconder( prensa, 'prensa')
			}
	
			//guardar ultima opcion
			opcion = nom
	
			//mostrar
			obj.moveTo(800,null)
			obj.show()
			obj.glideTo("slow","fast", x1, 33, 5, 50, nom + '.glideTo("fast","slow",' + x2 + ' ,33,15,50)'  )
		}//end if glideActive
	}// end if
}


//oculatar opcion menu superior
function esconder(obj, nom)
{
		obj.glideTo("slow","fast", 800, 33, 5, 50, nom+'.hide()')	
}



/**********************************************************************************************/


/*function subir()
{
	
	limInf = 172
	
	//Calculo movimiento de la bola scroll
	
	num1 = ( 5 * 140 ) / (texto.getContentHeight() - 170)
	if (movimiento == 1 && texto.y < limInf)
	{
		texto.moveBy(null, 5)				//bajar layer
		texto.clipBy(-5, 0, -5 ,0)			//subir zona clipping
		bola.slideBy(null, -num1)		//mover bola hacia arriba
		setTimeout('subir()',30)
	}
}

function bajar()
{
	
	limInf =  172 - texto.getContentHeight() + 170		
	
	
	num1 = ( 5 * 140 ) / (texto.getContentHeight() - 170)
	//alert(num1)
	//num1 = texto.getContentHeight() - num1
	//num1 = num1 / texto.h
	//num2 = 140 / num1 
	
	if (movimiento == 1 && texto.y > limInf)
	{
		texto.moveBy(null, -5)				//subir layer
		texto.clipBy(5, 0, 5 ,0)			//bajar zona clipping
		bola.slideBy(null, num1 )  	//mover bola hacia abajo
		setTimeout('bajar()',30)
	}
}

function parar()
{
	movimiento = false	
	//alert(movimiento)
}*/








