$(document).ready(function() {
	var menu_aperto = 0;
	var img_menuButton = '/it/CMSIT/PublishingImages/imagesUpload/btnInformati.png';
	var img_menuButton_roll = '/it/CMSIT/PublishingImages/imagesUpload/btnInformatiHover.png';
	
	var img_menuButton_click = '/it/CMSIT/PublishingImages/imagesUpload/btnInformati_bis.png';
	var img_menuButton_click_roll = '/it/CMSIT/PublishingImages/imagesUpload/btnInformatiHover_bis.png';
	
	var menuButton_click = false;
	var nInfoModel = 79;
    var ModelNavigation = 28;
    var nElementModelNavigation = ($('#contentMenu > ul > li').length) - 1;
    var HeigthMenu = (ModelNavigation * nElementModelNavigation) + nInfoModel - deltaMenu;

    $('#lnkMenuButton').click(function() {
    	if (menu_aperto==0)
    		{
        	$('#contentMenu').animate({ 'height': HeigthMenu + 'px' }, 350);
        	menu_aperto=1;
        }
      else
				{
        	$('#contentMenu').animate({ 'height': '0px' }, 300);
					menu_aperto=0;
				}
    });

    $('#informati').click(function() {
        $('#contentMenu').animate({ 'height': '0px' }, 300, function() {
            $('#btnContentMenu').fadeIn(200);
        });
    });
	 
	 $("#menuButton").mouseover(function() {
		if (menu_aperto == 0) {
			$("#menuButton").attr('src', img_menuButton_roll);
		} else {
			$("#menuButton").attr('src', img_menuButton_click_roll);
		}
	})
	
	$("#menuButton").mouseout(function() {
		if (menu_aperto == 0) {
			$("#menuButton").attr('src', img_menuButton);
		} else {
			$("#menuButton").attr('src', img_menuButton_click);
		}
	})
});

function showMenu()
	{
		//alert('Apri');
    $('#btnContentMenu').fadeIn(200);
	}

function showMenu_no_Flash()
	{
		//alert('Apri');
    $('#btnContentMenu').fadeIn(200);
    $('#contentMenu').animate({ 'height': '290px' }, 350);
    menu_aperto=1;    
	}

function hideMenu()
	{
		//alert('Chiudi');
    $('#btnContentMenu').fadeOut(100);
	}

function no_Flash_Player(e)
	{
		if (!e.success)
			{
				showMenu_no_Flash();
			}
		else
			{		
				if (Pagina_Resizable == 1)
					{			
						doResize();
					}					
			}
	}

