		window.addEvent('domready', function(){
			var list = $$('#AKmen ul li A');
			list.each(function(element) {
				
				var fx = new Fx.Styles(element, {duration:200, wait:false});
				
				element.addEvent('mouseenter', function(){
					fx.start({
						'color': '#fff',
						'background-color': '#333',
						'border-bottom-color': '#f90'
					});
				});
				
				element.addEvent('mouseleave', function(){
					fx.start({
						'color': '#999',
						'background-color': '#252525',
						'border-bottom-color': '#2a2a2a'
					});
				});
				
			});
		});
		// effetto hover su link ///////////////////////////////////////////////
		window.addEvent('domready', function(){
			var links = $$('#sinistra .lin');
			links.each(function(element) {
				
				var fx = new Fx.Styles(element, {duration:200, wait:false});
				
				element.addEvent('mouseenter', function(){
					fx.start({
						'margin-left': 5,
						'background-color': '#5695CB',
						color: '#fff'
					});
				});
				
				element.addEvent('mouseleave', function(){
					fx.start({
						'margin-left': 0,
						'background-color': '#DCE1E6',
						'color': '#000'
					});
				});
				
			});
		});

		// fine effetto hover su link ///////////////////////////////////////////////
		

		
///// CAROUSEL ////////////////////////////////////////////////////////////////////////////////

/*
window.addEvent("domready", function() {

	//dp.SyntaxHighlighter.HighlightAll("usage");

	var ex6Carousel = new iCarousel("example_6_content", {
		idPrevious: "example_6_previous",
		idNext: "example_6_next",
		idToggle: "undefined",
		item: {
			klass: "example_6_item",
			size: 750
		},
		animation: {
			
			type: "scroll",
			rotate: {  
             type: "auto"  
            } , 
			
			duration: 500,
			amount: 1
			
		}
	});
    
	
	
	$("thumb1").addEvent("mouseover", function(event){new Event(event).stop();ex6Carousel.goTo(0)});
	$("thumb5").addEvent("mouseover", function(event){new Event(event).stop();ex6Carousel.goTo(1)});
	$("thumb6").addEvent("mouseover", function(event){new Event(event).stop();ex6Carousel.goTo(2)});
	$("thumb7").addEvent("mouseover", function(event){new Event(event).stop();ex6Carousel.goTo(3)});
	$("thumb8").addEvent("mouseover", function(event){new Event(event).stop();ex6Carousel.goTo(4)});
	$("thumb9").addEvent("mouseover", function(event){new Event(event).stop();ex6Carousel.goTo(5)});
			
});
*/


///// ASSET IMAGES ////////////////////////////////////////////////////////////////////////////////////////
			
window.addEvent('domready', function(){
			var busy = false, timer, loadedImages = [], gallery = $('gallery'), progress = $('progress'), bar = $E('#progress .bar'); 
            
			if(gallery){
			gallery.setStyles({'opacity': 0, 'display': 'none'});
			progress.setStyle('visibility', 'hidden');
			
				if (!busy) {
					
					var galleryImgs = $$('#gallery img');
					if (galleryImgs.length > 0) galleryImgs.each(function(image) {	image.remove();	});
					
					busy = true;
					progress.setStyle('visibility', 'visible');
					//gallery.setStyle('display', 'block');
					new Asset.images(images, {
						onProgress: function(i) {
							this.setStyles({
								'position': 'absolute',
								'opacity': 0,
								'left': (gallery.getCoordinates().width / 2) - (this.width / 2),
								'top': (gallery.getCoordinates().height / 2) - (this.height / 2)
							});
							loadedImages[i] = this;
							var percent = ((i + 1) * progress.getStyle('width').toInt()) / images.length;
							bar.setStyle('width', percent).setHTML(i + 1 + ' / ' + images.length);
						},
						onComplete: function() {
							
							progress.setStyle('display', 'none');
							//var fx = $('gallery').effect('opacity').start(1);
							
							/*
							timer = 0;
							loadedImages.each(function(image, i) {
								timer += 1500;
								image.inject(gallery);
								fx = function() {
									var imgEffect = image.effect('opacity', {duration: 1500});
									imgEffect.start(1).chain(function() {
										if (i < loadedImages.length - 1) {
											this.start(0).chain(function() {
												image.remove();
											});
										} else {
											busy = false;
										}
									});
									
								}.delay(timer * 2);
							});*/
							start_slide()
						} 
						
					});
				}
				
				} //if(gallery){
}); 

//////////////// FX.ELEMENTS //////////////////////////////////////////////////////////////////

	window.addEvent('domready', function(){
			var szNormal = 135, szSmall  = 60, szFull   = 300;
			
			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]}
					kwicks.each(function(other, j) {
						if(i != j) {
							var w = other.getStyle("width").toInt();
							if(w != szSmall) o[j] = {width: [w, szSmall]};
						}
					});
					fx.start(o);
				});
			});
			
			if($("kwicks")!=null){
			$("kwicks").addEvent("mouseleave", function(event) {
				var o = {};
				kwicks.each(function(kwick, i) {
					o[i] = {width: [kwick.getStyle("width").toInt(), szNormal]}
				});
				fx.start(o);
			})
			}
			
		}); 
	
//////////////////////////////////////////////////////////////////////////////////////////

// MYCAROUSEL - created by Fabio Polisini 26 March 2008

window.addEvent('domready', function(){
            
            var time_change = 3000; 
			var time_effects = 500;
			//var autoplay = true;
			//var position_start = 3;
			
			// dichiarazioni esterne /////////////////////////////////////////////////////////////////
			if(typeof(myStartPos)!='undefined') var position_start=myStartPos;
			if(typeof(myautoplay)!='undefined') var autoplay=myautoplay;
			//////////////////////////////////////////////////////////////////////////////////////////
			//////////////////////////////////////////////////////////////////////////////////////////
			
			if(typeof(autoplay)=='undefined'){var autoplay=false;}
			var periodical;
			var X_position = 0;
			
			var elementi = $$("#scroll_ul .scroll_li");
			var count = elementi.length;
			elementi.each(function(item, index){
					size = item.getStyle("width").replace(/px/gi, '')*1/1;
					item.addEvent("mouseover", function(event){new Event(event).stop();stop_fx(index);});
			});
			
			var X_max = (size*count)-size;
			
			
			
			var link_menu = $$("#AKmen .oriz_men").getElement('a');
			link_menu.each(function(item, index){
					item.addEvent("mouseover", function(event){new Event(event).stop();stop_fx(index);});
			});
			

			var scroll = new Fx.Scroll('myscroll', {
				wait: false,
				duration: time_effects,
				offset: {'x': 0, 'y': 0}
			});

            var fx = function() {
				 var X_next = (X_position<X_max)?X_position+size:0;
				 scroll.scrollTo(X_next,0);
				 X_position = X_next;
				 link_evi();
            }
			
            var stop_fx = function(num_ele) {
				 X_position = (num_ele==0)?0:size*num_ele;
				 scroll.scrollTo(X_position,0);
				 $clear(periodical);
				 link_evi();
            }
			
			var start_fx = function(){
				 periodical = fx.periodical(time_change);
			}
			
			
			var link_evi = function(){
				
				var this_item = (X_position==0)?0:X_position/size;
				
				link_menu.each(function(item, index){
							
							
							if(index==this_item)
							   item.setStyles({'background-color':'#006699','color':'#fff'});
							else
							   item.setStyles({'background-color': '','color':'#000'});
							 
			    });
				
			}
			
			
            if(typeof(position_start)!='undefined'){
			     X_position = (position_start==0)?0:size*position_start;
			     $('myscroll').scrollTo(X_position,0);
				 link_evi();
				 if(!autoplay) {
				 $$("#scroll_ul").addEvent("mouseleave", function(event){new Event(event).stop();stop_fx(position_start);});
				 $$("#AKmen").addEvent("mouseleave", function(event){new Event(event).stop();stop_fx(position_start);});
				 }
			}
			
			
			if(autoplay){ 
			   $$("#scroll_ul").addEvent("mouseleave", function(event){new Event(event).stop();start_fx();});
			   $$("#AKmen").addEvent("mouseleave", function(event){new Event(event).stop();start_fx();});
			   start_fx();
			}
			
			/*
	        $("thumb1").addEvent("mouseover", function(event){new Event(event).stop();stop_fx(0)});
	        $("thumb5").addEvent("mouseover", function(event){new Event(event).stop();stop_fx(1)});
	        $("thumb6").addEvent("mouseover", function(event){new Event(event).stop();stop_fx(2)});
	        $("thumb7").addEvent("mouseover", function(event){new Event(event).stop();stop_fx(3)});
	        $("thumb8").addEvent("mouseover", function(event){new Event(event).stop();stop_fx(4)});
	        $("thumb9").addEvent("mouseover", function(event){new Event(event).stop();stop_fx(5)});
			*/
			//////////////////////////////////////////////////////////////////////////////////////////
			//////////////////////////////////////////////////////////////////////////////////////////
});


///////////////////////////////////////////////////////////////////////////////////////////////////////////
// DIV LOGIN FOOTER
window.addEvent('domready', function(){
			var divFoot = $('login_div');
			var buttonFoot = $$('#but_log_foot');

				var fx = new Fx.Styles(divFoot, {duration:200, wait:false});
				
				buttonFoot.addEvent('click', function(){
					h_div = divFoot.getStyle("height").replace(/px/gi, '')*1/1;
					
                    if(h_div<5){
						
					    fx.start({
						        'height': 50
					    });
						
					}else{
						
					    fx.start({
						        'height': 3
					    });
						
					}
					
				});

});