	
	// This function returns the appropriate reference,
	// depending on the browser.
	function getFlexApp(appName)
	{
		// var app;
	  // if (navigator.appName.indexOf ("Microsoft") !=-1)
	  // {
	    // app = window[appName];
	  // }
	  // else
	  // {
	    // app = document[appName];
	  // }
	  // return app;
	  if (navigator.appName.indexOf ("Microsoft") !=-1) 
		{ 
		return document.getElementById(appName); 
			//return document.getElementsByName(appName)[0]; 
		} else { 
		return document.getElementsByName(appName)[0]; 
			 
		} 
	}

	function loadMovie()
	{
		// viene chiamata all'onLoad del body, server per risolvere un bug su firefox.
		//alert('altezza = ' + htmlHeight);
		
		element = document.getElementById('products');

		if (element != null) 
		{
		var blind_func = new Spry.Effect.Blind('products', {duration: 50, from: '499px', to: '500px', toggle: false});
		blind_func.start();
		}
	}

	function closeMovie(htmlHeight)
	{
		//alert('altezza = ' + htmlHeight);
		var blind_func = new Spry.Effect.Blind('products', {duration: 1000, from: null, to: '500px', toggle: false, finish:hideEffectEnd});
		blind_func.start();
	}

	function openMovie(htmlHeight)
	{
		//alert('altezza = ' + htmlHeight);
		var blind_func = new Spry.Effect.Blind('products', {duration: 1000, from: null, to: htmlHeight + 'px', toggle: false, finish:showEffectEnd});
		blind_func.start();
	}

	function showEffectEnd()
	{
		//alert('The ' + AppearFadeObj.name +' effect now starts');
		var flex = getFlexApp('products');
     	flex.showEffectEnd();
	}

	function hideEffectEnd()
	{
		//alert('The ' + AppearFadeObj.name +' effect now starts');
     	getFlexApp('products').hideEffectEnd();
	}

	function resizeMovie(htmlHeight)
	{
		//alert('altezza = ' + flexApp.height);
		var blind_func = new Spry.Effect.Blind('products', {duration: 1000, from: null, to: htmlHeight + 'px', toggle: false});
		blind_func.start();
	}

	function closeToZoom(htmlHeight)
	{
		//alert('altezza = ' + htmlHeight);
		var blind_func = new Spry.Effect.Blind('products', {duration: 1000, from: htmlHeight + 'px', to: '700px', toggle: false});
		blind_func.start();
	}

	function openFromZoom(htmlHeight)
	{
		//alert('altezza = ' + htmlHeight);
		var blind_func = new Spry.Effect.Blind('products', {duration: 1000, from: '700px', to: htmlHeight + 'px', toggle: false});
		blind_func.start();
	}

	function openCompare(htmlHeight)
	{
		//alert('altezza = ' + htmlHeight);
		var blind_func = new Spry.Effect.Blind('products', {duration: 1000, from: '700px', to: htmlHeight + 'px', toggle: false, finish:compareShowEffectEnd});
		blind_func.start();
	}

	function compareShowEffectEnd()
	{
		//alert('The ' + AppearFadeObj.name +' effect now starts');
     	getFlexApp('products').compareShowEffectEnd();
	}