		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': '#AD9B82',
						'color': '#fff'
					});
				});
				
			});
		});

		// 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",
			duration: 400,
			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)});
    
	//$("thumb5").addEvent("mouseover", function(event){this.className+=" over";});
    /*
    var list = $$('#AKmen li');
	list.each(function(element) {
				//alert(element) 
				element.addEvent('mouseenter', function(){
					this.className+=" over";
					//alert('dentro')
				});
				
				element.addEvent('mouseleave', function(){
					this.className=this.className.replace(" over", "");
					//alert('fuori')
				});
				
	 });
	 */
			
});


///// 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 = 154, szSmall  = 90, szFull   = 284;
			
			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);
			})
			}
			
		}); 
	
//////////////////////////////////////////////////////////////////////////////////////////