function go()
{
	

	var flashvars = {}; 
	var params = {}; 
	params.menu = "false"; 
	params.quality = "best"; 
	params.wmode="transparent"
	var attributes = {};
	swfobject.embedSWF(theme_url+"assets/efx/vers1_slider/stuzzica_360.swf?directory="+theme_url+"assets/efx/vers1_slider/sequenza2/&lingua="+language+"", "bd_3d", "725", "565", "9.0.0", false, flashvars, params, theme_url+"assets/efx/vers1_slider/expressInstall.swf");
}

function istruzioni()
{
	var flashvars = {}; 
	var params = {}; 
	params.menu = "false"; 
	params.quality = "best"; 
	params.wmode="transparent"
	var attributes = {};
	swfobject.embedSWF(theme_url+"assets/efx/player/player.swf?directory="+theme_url+"assets/efx/player/vid/", "bd_video", "620", "440", "9.0.0", false, flashvars, params, theme_url+"assets/efx/player/expressInstall.swf");
}

function adapt()
{
	var bd = parseInt($('#bd').innerHeight(),10);
	var body = parseInt($('body').innerHeight(),10);
	var html = parseInt($('html').innerHeight(),10);
	if(bd<body)
	{
		$('#mn').css({height:html-375});
		if(home) $('#mn').css({height:html-100});
	}
	else
	{
		$('#mn').css({height:800});
	}
}

var puntivendita_prov;

$(document).ready(function() {

	setTimeout('adapt();',100);
	
	$('.cycle').cycle({ 
	    fx:     'fade',
	    timeout: 6000,
	    delay:  -200
	});

	$('.cycle3').cycle({ 
	    fx:     'fade',
	    timeout: 1000,
	    delay:  -200
	});
	
	$('.cycle2').cycle({ 
	    fx:     'scrollDown',
	    timeout: 6000,
	    delay:  -200
	});

	$('.cycle1').cycle({ 
	    fx:     'scrollRight',
	    timeout: 6000,
	    delay:  -200
	});
	
	$(".case_box_gallery a").fancybox({
		'titleShow'     : false
	});
	
	
	$('#video2,#video1').hide();
	$('#video1_link').bind('click',function(e){
		$('#video1').slideDown();
		$('#video2').slideUp();
		$(this).addClass('active');
		$('#video2_link').removeClass('active');
	});
	$('#video2_link').bind('click',function(e){
		$('#video1').slideUp();
		$('#video2').slideDown();
		$(this).addClass('active');
		$('#video1_link').removeClass('active');
	});
	
	$('#video1').show();
	$('#video2').slideUp();
	$('#video1_link').addClass('active');

	if($('select#puntivendita_prov'))
	{
		puntivendita_prov = $('select#puntivendita_prov').html();
	}

});



	function puntivendita(els,regione)
	{
		// distruggo uniform e ricostruisco
		$('#uniform-puntivendita_prov').remove();
		$('#puntivendita_prov').remove();
		$('#mappa').after('<select id="puntivendita_prov"></select>');
		adapt();
		
		// ricarico tutta la select
		$('select#puntivendita_prov').append(puntivendita_prov);

		// rimuovo altri optgroup
		$('select#puntivendita_prov').find('optgroup').each(function(i){
			var label = $(this).attr('label');
			if(label != regione)
			{	
				$(this).remove();
			}
		});

		$('select#puntivendita_prov').show().css('display','block').uniform()
		.change(function(){
			var val = $(this).val();
			var patt1 = "(\("+val+"\))";

			$('#puntivendita').find('li').each(function(i){
				if(!$(this).text().match(patt1))
				{
					$(this).hide();
				}
				else
				{
					$(this).show();
				}
			});
		});

		var text='';
		text+='<li class="first">'+els[1]+'</li>';
		for(a=2;a<els.length;a++)
		{
			text+='<li>'+els[a]+'</li>';
		}
		$('#puntivendita').html(text);

		var mn = parseInt($('#mn').innerHeight(),10);
		var bd = parseInt($('#bd').innerHeight(),10);
		var body = parseInt($('body').innerHeight(),10);
		if(mn<bd)
		{
			$('#mn').css({height:bd});
		}
		else
		{
			$('#mn').css({height:body-290});
		}
		
	}
