jQuery(document).ready(function ()
{
	$("#accordion").accordion({
		collapsible: true, autoHeight: false, animated: false, alwaysOpen: false
	}).accordion('activate', false);
	$("#accordion2").accordion({
		collapsible: true, autoHeight: true, animated: false, alwaysOpen: false
	}).accordion('activate', false);

	$textContainer = $('#textContainer');
	reinitialiseScrollPane = function ()
	{
		$textContainer.jScrollPane({ showArrows: false, scrollbarWidth: 15, scrollBarMargin: 0, dragMaxHeight: 100, dragMinHeight: 100 });
		$("#textContainer *").unbind('focus');
	};
	reinitialiseScrollPane();
	$('#accordion').bind(
					'click',
					function (event)
					{

						reinitialiseScrollPane();


					});
	$('#accordion2').bind(
					'click',
					function (event)
					{

						//$textContainer = $('#textContainer');
						//var top = $textContainer.data('jScrollPanePosition');
						reinitialiseScrollPane();
						//$textContainer[0].scrollTo(top);
					});


});

/*
$(window).load(function ()
{
	$textContainer.jScrollPane({ showArrows: false, scrollbarWidth: 15, scrollBarMargin: 0, dragMaxHeight: 100, dragMinHeight: 100  });
});
*/

