// JavaScript Document
//<![CDATA[
// ]]>

var video = {

    // Utilizzare una variabile per fare riferimento al file SWF incorporato.
    

	start: function(){
		// video
		if ($('video')) video.video();
		
	},
	
	video: function() {

		var szNormal = 210, szSmall = 60, szFull = 360;
		 
		var kwicks = $$("#kwicks .kwick");
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
		
		kwicks.each(function(kwick, i) {
			kwick.addEvent("mouseenter", function(event) {
				var o = {};
				o[i] = {width: [kwick.getStyle("width").toInt(), szFull]}
				/* mostro la scritta GUARDA IL VIDEO */
				var guarda = kwick.getChildren('a');
				//alert(guarda)
				guarda.setStyle('display', 'block')
				
				kwicks.each(function(other, j) {
					if(i != j) {
						var w = other.getStyle("width").toInt();
						if(w != szSmall) o[j] = {width: [w, szSmall]};
						var guarda1 = other.getChildren('a');
						guarda1.setStyle('display', 'none')						
					}
				});
				fx.start(o);
			});
		});
		
		$("kwicks").addEvent("mouseleave", function(event) {
			var o = {};
			kwicks.each(function(kwick, i) {
				
				var guarda = kwick.getChildren('a');
				guarda.setStyle('display', 'none')								 
				
				o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
			});
			fx.start(o);
		})	
	
	}

}

///////////////////////////////////////////////////////

window.addEvent('domready', video.start);
//]]>