function playerFlash(host, url, title, path){
	var autostart = '?autoplay=true';
	
	var html = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="objectVideo" width="480" height="402">';
	html += '<param name="allowScriptAccess" value="always" />';
	html += '<param name="allowFullScreen" value="true" />';
	html += '<param name="movie" value="/inc/player.swf" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="bgcolor" value="#000000" />';
	html += '<param name="FlashVars" value="vURL=http://' + host + '/Fandango_TV/asx/'+ url +'.asx' + autostart + '" />';
	html += '<embed src="/inc/player.swf" width="480" height="402" quality="high" bgcolor="#000000" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="vURL=http://' + host + '/Fandango_TV/asx/'+ url +'.asx' + autostart + '" />';
	html += '</object>';
		
	var html2 = '<object width="480" height="402">';
	html2 += '<param name="allowScriptAccess" value="always" />';
	html2 += '<param name="allowFullScreen" value="true" />';
	html2 += '<param name="movie" value="http://' + host + '/inc/player.swf" />';
	html += '<param name="bgcolor" value="#000000" />';
	html2 += '<param name="FlashVars" value="vURL=http://' + host + '/Fandango_TV/asx/'+ url +'.asx' + autostart + '" />';
	html2 += '<embed src="http://' + host + '/inc/player.swf" quality="high" bgcolor="#000000" allowScriptAccess="always" type="application/x-shockwave-flash" flashvars="vURL=http://' + host + '/Fandango_TV/asx/'+ url +'.asx' + autostart + '" allowFullScreen="true" width="480" height="402" />';
	html2 += '</object>';

	
	$('video_container').innerHTML = html;
	if(embd = $('embed_code')){
		embd.value = html2;
		embd.onclick = focusAndSelect;
	}
}

function selectLabel(){
	var path = document.location.href;

	if(path.indexOf('Cortometraggi') > -1)
		$('sezioni').getElements('li')[5].getElement('a').addClass('selected');
	else if(path.indexOf('Libri') > -1)
		$('sezioni').getElements('li')[4].getElement('a').addClass('selected');
	else if(path.indexOf('Musica') > -1)
		$('sezioni').getElements('li')[3].getElement('a').addClass('selected');
	else if(path.indexOf('Documentari') > -1)
		$('sezioni').getElements('li')[2].getElement('a').addClass('selected');
	else if(path.indexOf('Cinema') > -1)
		$('sezioni').getElements('li')[1].getElement('a').addClass('selected');
	else
		$('sezioni').getElements('li')[0].getElement('a').addClass('selected');
}

function toggleBox2(el, div, to, animation){
	var h = $(div).getCoordinates().height;
	var to = to?to:$(div).getFirst().getCoordinates().height;
	var Toggle = new Fx.Style(
		$(div),
		'height',
		{
			transition: Fx.Transitions.Cubic.easeInOut,
			onComplete: function(){
				if(h < to)
					$(div).setStyle('border-bottom-width', '1px');
				else
					$(div).setStyle('border-bottom-width', 0);
			}
		}
	);

	if(h < to){ // <--------------------------------------------------------------------------- Apro
		$(el).addClass('selected');
		if(animation)
			Toggle.start(to);
		else{
			Toggle.set(to);
			$(div).setStyle('border-bottom-width', '1px');
		}
		
		Cookie.set('box_status_' + div, 'open', {path: '/'});
	}
	else{ // <------------------------------------------------------------------------------- Chiudo
		$(el).removeClass('selected');
		if(animation)
			Toggle.start(0);
		else{
			Toggle.set(0);
			$(div).setStyle('border-bottom-width', 0);
		}
		
		Cookie.set('box_status_' + div, 'close', {path: '/'});
	}
}

function toggleBox(el, div, to, animation){
	var h = $(div).getCoordinates().height;
	var to = to?to:$(div).getFirst().getCoordinates().height;
	var Toggle = new Fx.Style(
		$(div),
		'height',
		{
			transition: Fx.Transitions.Cubic.easeInOut,
			onComplete: function(){
				if(h < to)
					$(div).setStyle('border-bottom-width', '1px');
				else
					$(div).setStyle('border-bottom-width', 0);
			}
		}
	);

	if(h < to){ // <------------------------------------------------ Apro
		$(el).addClass('selected');
		if(animation)
			Toggle.start(to);
		else{
			Toggle.set(to);
			$(div).setStyle('border-bottom-width', '1px');
		}
		
		Cookie.set('box_status_' + div, 'open', {path: '/'});
	}
	else{ // <------------------------------------------------------ Chiudo
		$(el).removeClass('selected');
		if(animation)
			Toggle.start(0);
		else{
			Toggle.set(0);
			$(div).setStyle('border-bottom-width', 0);
		}
		
		Cookie.set('box_status_' + div, 'close', {path: '/'});
	}
}