this.imagePreview = function()
    {
        xOffset = 0;
        yOffset = 30;
	
        $("a.preview").hover(function(e)
        {
            this.t = this.title;
            this.title = "";
            var c = (this.t != "") ? "<br/>" + this.t : "";
            $("body").append("<p id='preview'><img src='"+ $(this).find("img").attr("src") +"' alt='Image preview' />"+ c +"</p>");
            $("#preview")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px")
            .fadeIn("fast");
        },
        function()
        {
            this.title = this.t;
            $("#preview").remove();
        });
        $("a.preview").mousemove(function(e)
        {
            $("#preview")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px");
        });
    };
this.altezzaMaxFooter=0;

$(document).ready(function()
{	
    $('a.switch').mouseover(function()
    {
        show = $(this).attr('rel');
        if($('#'+show).css('display')=='none')
        {
            $('.switched').css('display','none');
            $('#'+show).fadeIn();
        }
    })
    imagePreview();

	$("#news").height($(".mainHome").height());

    //riorganizzazione pezzi footer
    $('#footer>div').each(function(){
        if(altezzaMaxFooter<$(this).height()){
            altezzaMaxFooter=$(this).height();
        }
    });
    $('#footer>div').each(function(){
        $($(this).children('div')[1]).css('minHeight',altezzaMaxFooter-($($(this).children('div')[0]).height()+$($(this).children('div')[2]).height())+'px');
       
    });
  
    

});
