
	// JavaScript Document

	//
	//	funcVideo.js
	//	Fecha de creacion: 27 / 07 / 2010
	//	Descripci�n: Contiene funciones para las transiciones del FreeMrk
	//

	var museuVideoMostrando = false;


	// FUNCIONES VIDEO

	function mostrarVideo ()
	{
		nameFunction = "mostrarVideoIntro ()";
		
		if ( museuVideoMostrando == false )
		{
			mostrarCapaFondoVideo ();
			
			ocultarElementosUppers ();
			
			$('divVideoBlock').style.display = 'block';
				
			var timer = setTimeout( nameFunction , 100 );
			
			museuVideoMostrando = true;
		}
	}

	function mostrarVideoIntro ()
	{
		var flashvars = {
		  allowFullScreen: true,
		  nvideo: "http://mielar.com/mielar10/video/P1040876.flv",
		  tvideo: "Mielar S.A."
		};
		
		var params = {
		  allowFullScreen: true
		};
		
		var attributes = {};

		swfobject.embedSWF("mielar10/reproductor/reproducMielar.swf", "divVideoContentFlash", "600", "338", "9.0.0", "includes/capas/javascript/swfobject/expressInstall.swf", flashvars, params, attributes);
	}

	function ocultarVideo ()
	{
		$('divVideoBlock').style.display = 'none';
		
		ocultarCapaFondoVideo ();

		museuVideoMostrando = false;
	}
	
	// FONDO OSCURO
	
	function mostrarCapaFondoVideo ()
	{
		var arrayPageSize = getTamPagina ();
		$('divFondoOscuro').style.height = arrayPageSize[1] + 'px';
		
		// Oculta los elementos que están por encima
		ocultarElementosUppers ();
		
		new Effect.Appear ( 'divFondoOscuro' , { 
				duration: 0.6, 
				from: 0.0, 
				to: 0.5,
				afterUpdate: (function(){ $('divFondoOscuro').style.visibility = 'visible'; })
		} );
	}
	
	function ocultarCapaFondoVideo ()
	{
		new Effect.Appear ( 'divFondoOscuro' , { 
				duration: 0.3, 
				from: 0.5, 
				to: 0.0,
				afterFinish: (function(){ $('divFondoOscuro').style.visibility = 'hidden'; mostrarElementosUppers (); })
		} );
	}
