		jQuery(function()
		{
			// this initialises the demo scollpanes on the page.
		  // jQuery('#panel').jScrollPane();
			
			var isResizing;
				
				// and the body scrollpane
				var setContainerHeight = function()
				{
			
					// IE triggers the onResize event internally when you do the stuff in this function
					// so make sure we don't enter an infinite loop and crash the browser
					if (!isResizing) { 
						isResizing = true;
						
						if (jQuery.browser.msie && jQuery.browser.version.substr(0,1)<7)
						{
							_headerHeight = 256+108;
						}
						else
							_headerHeight = 235+108;
						
						$w = jQuery(window);
						$c = jQuery('div#panel');
						var p = (parseInt($c.css('paddingLeft')) || 0) + (parseInt($c.css('paddingRight')) || 0);
						jQuery('body>.jScrollPaneContainer').css({'height': ($w.height()-_headerHeight) + 'px'});
						if( jQuery('#content').hasClass('pagina'))
						{
							$c.css({'height': ($w.height()-_headerHeight-'28') + 'px', 'width': '100%', 'overflow':'auto'});
						}
						else
						{
							$c.css({'height': ($w.height()-_headerHeight) + 'px', 'width': '100%', 'overflow':'auto'});
						}
						$c.jScrollPane({
							 scrollbarWidth: 8,
							 scrollbarMargin: 0,
							 wheelSpeed: 25,
							 showArrows: true,
							 topCapHeight: 5,
							 dragMinHeight: 5,
							 dragMaxHeight: 5
						});
						isResizing = false;   
					}
				}
				jQuery(window).bind('resize', setContainerHeight);
				setContainerHeight();
				
				// it seems like you need to call this twice to get consistantly correct results cross browser...
				setContainerHeight();

				
				jQuery(".menu img").each( function() { 
					var $el = jQuery(this);
					$el.hover(
						function(){
							var _nUrl = $el.attr('src');
							$el.attr('src', $el.attr('rel'));
							$el.attr('rel', _nUrl);
						},
						function(){
							var _nUrl = $el.attr('src');
							$el.attr('src', $el.attr('rel'));
							$el.attr('rel', _nUrl);
						}
					)
				});
				
				//jQuery("#archivio_eventi ul span.flir-replaced").prepend('<span class="fixer"></span>');
				
		});