// JavaScript Document

//*
$(function()
{	
	var isResizing;				
	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;
			window_reference = $(window);
			container = $('#pane2');
			var padding = (parseInt(container.css('paddingLeft')) || 0) + (parseInt(container.css('paddingRight')) || 0);
			$('body > .jScrollPaneContainer').css({
                'height': window_reference.height() + 'px', 
                'width': window_reference.width() + 'px'
            });
			container.css({
                'height': (window_reference.height()-padding) + 'px', 
                'width': (window_reference.width() - padding) + 'px', 
                'overflow': 'auto'
            });
            container.jScrollPane({showArrows:true});
			isResizing = false;	
		}
		
		//reload the images color (random) for the scroll bar
		//arrow up
		//alert(bgColorCSS + " " + colorCSS )
		$("a.jScrollArrowUp").css("background-image", "url(lib/imgs/scroll/basic_arrow_up" + bgColorCSS + ".gif)"); 
		//drag point
		$(".jScrollPaneDrag").css("background-image", "url(lib/imgs/scroll/scroll-drag-adri" + bgColorCSS + ".gif)"); 
		//scroll bar
		$(".jScrollPaneTrack").css("background-image", "url(lib/imgs/scroll/scroll-back_adri" + bgColorCSS + ".gif)");
		//arrow down
		$("a.jScrollArrowDown").css("background-image", "url(lib/imgs/scroll/basic_arrow_down" + bgColorCSS + ".gif)");		
	}
	$(window).bind('resize', setContainerHeight);
	setContainerHeight();
	
	// it seems like you need to call this twice to get consistantly correct results cross browser...
	setContainerHeight();
	
});
/**/

