		// DEFAULT at the beginning of page!			
		var curState = "play";
		var curSize = ( readCookie('style') == "hiS" ) ? 'hiS' : 'lowS';					
		var curQuality = ( readCookie('lqual') == '1' ) ? 'low' : 'hi';
		var cookieVideo = readCookie("curVideo");
		var textShown = null;	
function playMovie(file, myWidth, myHeight,auto) {
			auto = (curState == "play" ) ? "&autoStart=true" : "";
			curVideo = file;
			file += ( curQuality == "low" ) ? "_lq.flv" : "_bq.flv"; 
			var FO = { 	movie:"lib/flvplayer.swf", 
						width:  myWidth  , 
						height:  myHeight , 
						majorversion:"8", 
						build:"0", 
						xi:"true",
						flashvars:"file="+file + auto +"&showfsbutton=true" };
			UFO.create(FO, 'player');
			createCookie('curVideo', curVideo, '');
		}
		
		function setSize(dim)
		{
			if (dim == "lowS") {
				curWidth = "320";
				curHeight = "260";
				curSize = "lowS";
				document.getElementById('switchS').innerHTML = "Allarga";
				setActiveStyleSheet("lowS");
				createCookie('style','lowS',600);
			} else {
				curWidth = "480";
				curHeight = "380";
				curSize ="hiS"
				document.getElementById('switchS').innerHTML = "Restringi";
				setActiveStyleSheet("hiS");
				createCookie('style','hiS',600);
			}
		}
	    
      function switchSize()
		{
			(curSize =="lowS") ? setSize("hiS") : setSize("lowS");
			playMovie(curVideo, curWidth, curHeight);
		}
		
		function setQuality(qual)
		{
			if ( qual == "hi") {
				curQuality = "hi";
				document.getElementById('switchQh').style.color = "red";
				document.getElementById('switchQh').style.fontWeight = "bold";
				document.getElementById('switchQl').style.color = "white";
				document.getElementById('switchQl').style.fontWeight = "normal"; 
				createCookie('lqual','0',600);
			} else {
				curQuality = "low";
				document.getElementById('switchQl').style.color = "red";
				document.getElementById('switchQl').style.fontWeight = "bold";
				document.getElementById('switchQh').style.color = "white";
				document.getElementById('switchQh').style.fontWeight = "normal"; 
				createCookie('lqual',1,600);
			}
		}		
		
		function switchQuality()
		{
			(curQuality == "hi") ? setQuality('low') : setQuality('hi');			
			playMovie(curVideo, curWidth, curHeight, true);			
		}		
		
		function hide(id)
		{
			if (id == null )
				return;
			var to_hide = "corpo" + textShown;
			document.getElementById(to_hide).className="hidden";
			var shd = "shd" + id;
			var obj = document.getElementById(shd);
			obj.innerHTML = "Leggi";
			obj.href="javascript:show('"+id+"');";
			obj.title="Leggi il testo completo";
			textShown = null;
		}
			
		function show(id) 
		{
			hide(textShown);
			textShown = id;
			var to_show = "corpo" + id;
			var shd = "shd" + id;
			document.getElementById(to_show).className="desc";
			var obj = document.getElementById(shd);
			obj.innerHTML = "Nascondi";
			obj.href="javascript:hide('"+ id + "');";
			obj.title="Nascondi il testo";				
		}

