/*** ============================= Drop down menu ============================================= ***/

function mainmenu(){
$(".menu a").removeAttr('title');
$(" .menu ul ").css({display: "none"}); // Opera Fix
$(" .menu li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(400);
		},function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		});
}

/*** ============================= Right click mouse disabled ============================================= ***/

 $(document).ready(function(){					
	mainmenu();
});

$(document).ready(function() {  
  
     //this one line will disable the right mouse click menu  
     $(document)[0].oncontextmenu = function() {return false;}  
  
});

/*** ============================= Paginazione post + loading ajax ============================================= ***/

function list_update(){
            $('#mcol').addClass('list').removeClass('grid');
            $.cookie('mode', 'list');
        }
		

        $('#pagination a').live('click', function(e){
            e.preventDefault();
            $(this).addClass('loading').text('IN CARICAMENTO ...');
            $.ajax({
                type: "GET",
                url: $(this).attr('href') + '#mcol',
                dataType: "html",
                success: function(out){
                    result = $(out).find('#mcol .article');
                    nextlink = $(out).find('#pagination a').attr('href');
                    $('#mcol').append(result.fadeIn(300));
                    $('#pagination a').removeClass('loading').text('Leggi gli articoli precedenti');
					// Hide elements on page load
					jQuery(".article-over").fadeTo(0, 0);
					// Hover animations for Home Pages
					jQuery(".article").hover(function(){
					jQuery(this).children(".preview").stop(true).fadeTo("fast", 0.1);
					jQuery(this).children(".article-over").stop(true).fadeTo("fast", 1.0);
        			jQuery(this).children(".article-over").fadeTo( function(){    this.style.removeAttribute("filter"); });
		
					}, function(){
					jQuery(this).children(".article-over").stop(true).fadeTo("fast", 0);
					jQuery(this).children(".preview").stop(true).fadeTo("fast", 1.0);
			});
					
                    if (nextlink != undefined) {
                        $('#pagination a').attr('href', nextlink);
                    } else {
                        $('#pagination').remove();
                    }
                    
                }
            });
        });

/*** ============================= REGOLE AGGIUNTIVE PF ============================================= ***/
	
$('#pp_full_res').live('mousedown', function() {
$.prettyPhoto.close();
});
