// JavaScript Document

//--------------------------->  MAPPA
function showmap(_id){
	$(".fumetto").hide();
	$("#"+_id).show();
}
function hidemap(){
	$(".fumetto").hide();
}

$(document).ready(function() {
	
//--------------------------->  MAPPA
		$("#mappe div").click(function() {
				var txt;
				var stato = $(this).attr('id');
				if (stato=='un')
					{
						$("#sel").attr('id','un');
						$(this).removeAttr('id');
						$(this).attr('id', 'sel');
						$("#map").attr('class', $(this).attr("class")); 											
					}
				if ($("#map").hasClass('milano')) {
						//$("#map").attr('src','img/map/mappa_m.png');
						$("#mappeimgr").hide();
						$("#mappeimgm").show();
				}
				if ($("#map").hasClass('roma')) {
						//$("#map").attr('src','img/map/mappa_r.png');	
						$("#mappeimgr").show();
						$("#mappeimgm").hide();									
				}	
		});		
		
//--------------------------->  TICKER
		// Add Scroller Object
  	$jScroller.add(".scroller_container",".scroller","left",4);
  	// Start Autoscroller
  	$jScroller.start();
  
//--------------------------->  MENU
	var my_id;
	var h;
	$(".livello1 li").mouseover(function() {
			my_id= $(this).attr("id");
			$("#li"+my_id).show();	
			$(".controller").css('font-weight', 'normal');
			$("li.t_sel").css('font-weight', 'bold');
			$(this).css('font-weight', 'bold');
	});	
	$(".livello1").mouseout(function() {
			$("#li"+my_id).hide();
			$(".controller").css('font-weight', 'normal');
			$(".t_sel").css('font-weight', 'bold');
			h=0;		
	});	
	$(".livello3").mouseenter(function() {
				$("#li"+my_id).show();	
				$(".t_sel").css('font-weight', 'bold');
	});	
	$(".livello3").mouseleave(function() {
				$("."+my_id).hide();	
				$(".t_sel").css('font-weight', 'bold');
				$(".controller").css('font-weight', 'normal');
	});
	
//--------------------------->  SLIDE GALLERY HP
	$(".cnt_gall").mouseover(function() {
			my_id= $(this).attr("id");
			$("#o"+my_id).show();	
	});	
	$(".cnt_gall").mouseout(function() {
			my_id= $(this).attr("id");
			$("#o"+my_id).hide();	
	});	
	$("#slider").easySlider();	
	
//--------------------------->  SLIDE GALLERY PORTAFOGLIO
	$("#slider_int").easySlider({		
					prevId: 'prevBtnInt',
					nextId: 'nextBtnInt'	
				});	
							
//--------------------------->  NEWS  
  var n_elementi = $("#listanews").find("li").length;
  if(n_elementi > 1){
  	$('.tickernews').vTicker({
			speed: 1000,
			pause: 6000,
			showItems: 100,
			animation: 'fade',
			mousePause: false,
			height: 88,
			direction: 'up'
		});
  }
  
});


	

