/**
 * @author Lpiccini
 */
var temp;
$( 
	function() {
		$('.sottomenu').hide();
		$('.livello1').bind('mouseover', function() {
			try {
				temp.slideUp();
			} catch (e) {}			
			$(this).next().slideDown('fast');
			temp=$(this).next();
		}).next().bind('mouseleave',function() {
				temp.slideUp();
		});
		
		$('.left-1').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '41px',
				backgroundPosition : '21px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		
		$('.left-2').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '50px',
				backgroundPosition : '30px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		
		$('.left-3').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '56px',
				backgroundPosition : '36px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		
		$('.left-4').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '58px',
				backgroundPosition : '38px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		
		$('.left-5').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '56px',
				backgroundPosition : '36px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		
		$('.left-6').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '50px',
				backgroundPosition : '30px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		$('.left-7').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '50px',
				backgroundPosition : '30px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		$('.left-8').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '50px',
				backgroundPosition : '30px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		$('.left-9').bind('mouseover', function() {
			$(this).animate({
				paddingLeft : '50px',
				backgroundPosition : '30px 0px'
			},200);
		}).bind('mouseleave', function() {
			$(this).animate({
				paddingLeft : '20px',
				backgroundPosition : '0px 0px'
			},200);
		});
		
		$('#video-on').bind('click', function() {
			$('#flashvideo').fadeIn('slow');
		});
	}
);

function pop(URL,nome,winWidth,winHeight,winLeft,winTop,SB,RSZ) {
	if (winLeft < 0)
		winLeft = screen.width - winWidth + winLeft
	if (winTop < 0)
		winTop = screen.height - winHeight + winTop
	if (winTop == "cen")
		winTop = (screen.height - winHeight)/2 - 20
	if (winLeft == "cen")
		winLeft = (screen.width - winWidth)/2
	if (winLeft>0 & winTop>0)
		window.open(URL, nome, 'width='+winWidth+',height='+winHeight+',fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars='+SB+',resizable='+RSZ+',directories=no,location=no,left='+winLeft+',top='+winTop+',screenX='+winLeft+',screenY='+winTop);
}
