window.addEvent('domready',function(){
	
	if(document.location.href.search('#') != -1 && document.location.href.split('#')[1] != 'top')
	{
		var rel = '.'+document.location.href.split('#')[1];
		var starItem = $$(rel)[0].getAllPrevious().length;
	}
	else
	{
		var rel = 'first';
		var starItem = 0;
	}

	new SmoothScroll({ duration: 1000 }, window);
	
	var nS4 = new noobSlide({
		box: $('cont-progetti'),
		items: $$('#cont-progetti div'),
		size: 850,
		startItem: starItem,
		handles: $$('.kwick'),
		addButtons: {previous: $('precedente'), next: $('successivo') },
		onWalk: function(currentItem,currentHandle){
			this.handles.removeClass('active');
			currentHandle.addClass('active');
		}
	});
	
	//create the tooltips
	var myTips = new Tips('.tips');
	
	var kwick = new Kwick.Menu($$("#kwicks .kwick"), {
		large: 230,
		normal: 40,
		small: 40,
		mode:'horizontal',
		rel: rel
	});
	
});