
	cur_price = null;
	
	function set_cookie ( name, value )
	{
		document.cookie = name + "=" + escape ( value ) + "; expires=" + (new Date ( 2020, 01, 01 )).toGMTString();
	}

	function layer_init()
	{
		$('prezzi_table').observe('mousemove', prezzi_move);
		$('prezzi_table').observe('mouseenter', prezzi_move);
		$('prezzi_table').observe('mouseout', prezzi_move);
		$('prezzo_A').observe('mousemove', prezzi_move);
		$('prezzo_B').observe('mousemove', prezzi_move);
	}

	function prezzi_move (e)
	{

		if (!e) var e = window.event;
		
		var rows = $('prezzi_table').rows;
		var isfound = null;
		for (var row_index = 0; row_index < rows.length && !isfound; row_index++)
		{
			for (var cell_index = 0; cell_index < rows[row_index].cells.length && !isfound; cell_index++)
			{
				cur_cell = rows[row_index].cells[cell_index];
				if (cur_cell)
				{
					try
					{
						var offset = cur_cell.cumulativeOffset();
						var dimension = cur_cell.getDimensions();
						
						
						
						if ((e.pageX >= offset.left) && (e.pageX <= offset.left + dimension.width) && (e.pageY >= offset.top) && (e.pageY <= offset.top + dimension.height))
							isfound = cur_cell;
					}
					catch (err)
					{
					}
				}
			}
		}
		
		new_price = '';
		if (isfound)
			new_price = isfound.className;
			
		//$('debug').innerHTML = new_price;
			
		if (cur_price != new_price)
		{
			if (cur_price)
				$('prezzo_' + cur_price).style.display = 'none';
			cur_price = new_price;
			if (cur_price)
				$('prezzo_' + cur_price).style.display = 'block';
		}
		if (cur_price)
		{
			$('prezzo_' + cur_price).style.left = e.pageX +5 + 'px';
			$('prezzo_' + cur_price).style.top = e.pageY + 5 + 'px';
		}
		
	}
	
	
	
	setTimeout (hide_pup, 1000);
	
	function hide_pup ()
	{
		if ($$('div.MagicZoomHeader')[0])
		{
			$$('div.MagicZoomHeader')[0].next('div').next('div').style.display = 'none';
		}
	}
	
	


	Effect.newTransitions = { splash: function(pos) { return (Math.sin(Math.pow(pos, 4)) * 1.2); } }
	
	function splash_screen ()
	{
		if ($('splash_notturna'))
		{
			Effect.Appear ($('splash_notturna'), {duration: 1.0, transition: Effect.newTransitions.splash})
			set_cookie ('splash_notturna', 'already_shown'); 
		}
	}
	
	function splash_close()
	{
		$('splash_cover').hide();
		$('splash_notturna').hide();
	}
	
	
	
	
	
	
	
	
	
	
	
	
