function initNav() {
	var items = $$('.nav>li');
	items.each(function(item) {
		  //console.info(item);
			Event.observe(item, 'mouseover',function() {
				//close all others first
				items.each(function(i) {
					//console.info(i);
					if(item != i) {
						//console.info(i);
						RollIt.RollOut(i);
					}
				});

				RollIt.RollIn(item);
				Event.observe(item, 'mouseout',function() {
					RollIt.RollOut(item);
				});
			});
	});
}

var toY = new Array();


var RollIt = {
	timeout : new Array(),

	RollIn : function(obj) {
			$(obj).addClassName('over');			
	},
	RollOut : function(obj) {
			$(obj).removeClassName('over');	
	}
}

Event.observe(window, 'load', initNav);

var slideFade = function() {
	var slide = $('slides');
	var hover = $('slides_hover');
	var timeout = null;
	var options = {
		duration: 0.3
	};
	
	if(slide && hover) {
		hover.hide();
		new Event.observe(slide, 'mouseover', function(e) {
			new Effect.Appear(hover, options);
			clearTimeout(timeout);
		})

		new Event.observe(hover, 'mouseout', function(e) {
			timeout = setTimeout('new Effect.Fade($(\'slides_hover\'), {duration: 0.3})', 1500);
		})		
	}

}

Event.observe(window, 'load', slideFade);
