$(document).ready(function(){
			$(".bottone_submit").click(function() {
			  $('#formprodotti').submit();
			});
			
			$(".bottone_submit_testuale").click(function() {
			  $('#ricercatestuale').submit();
			});
		$(".bottone_cerca_per").hover(
			function(){
					 $(this).css("background-image","url(/images/pulsante-stili-hover.gif)"); 
					 $(this).css("background-position","0 0"); 
					 $(this).children('strong').css("color","#ffffff"); 
			 },
			function(){
					 $(this).css("background-image","url(/images/pulsanti-cerca-e-stili.gif)"); 
					 $(this).css("background-position","0 -16px"); 
					 $(this).children('strong').css("color","#807e7b"); 
			 }
		 );
		 url="http://www.facebook.com/scalerintal"

		 $(".socialfb").click(  
				function()  
				{  
				window.location = $(this).attr("url");  
				});  
											
        $('.bubbleInfo').each(function () {
            var distance = 10;
            var time = 250;
            var hideDelay = 500;
            var hideDelayTimer = null;
            var beingShown = false;
            var shown = false;
            var trigger = $('.bottone_cerca_per', this);
            var info = $('.popup', this).css('opacity', 0);

            $([trigger.get(0), info.get(0)]).mouseover(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                if (beingShown || shown) {
                    // don't trigger the animation again
                    return;
                } else {
                    // reset position of info box
                    beingShown = true;

                    info.css({
                        display: 'block'
                    }).animate({
                        opacity: 1
                    }, time, 'swing', function() {
                        beingShown = false;
                        shown = true;
                    });
                }
                return false;
            }).mouseout(function () {
                if (hideDelayTimer) clearTimeout(hideDelayTimer);
                hideDelayTimer = setTimeout(function () {
                    hideDelayTimer = null;
					info.animate({
                        opacity: 0
                    }, time, 'swing', function () {
                        shown = false;
                        info.css('display', 'none');
                    });

                }, hideDelay);

                return false;
            });
        });
  });
