// <![CDATA[

$(function(){
	
	$('#pane_holder').jScrollPane({reinitialiseOnImageLoad:true});
	
	reinitialiseScrollPane = function(){$('#pane_holder').jScrollPane({reinitialiseOnImageLoad:true});}
	
	$("#ajax_placeholder").append("<img src='images/ajax-loader.gif' id='ajax_loader' />");
	
	var	newHash			= '',
		$loadArea		= $('#load_area'),
		$feed			= $('#feed'),
		$ajaxSpinner	= $('#ajax_loader');
	
	$('ul#menu').delegate('a', 'click', function(){
		
		window.location.hash = $(this).attr("href");
		
		return false;
	
	});
	
	$(window).bind('hashchange', function(){
	
		newHash = window.location.hash.substring(1);
		
		if (newHash){

			$feed.fadeOut('slow', function(){
				$loadArea.slideUp('slow', function(){
					$ajaxSpinner.fadeIn('normal', function(){
						$feed.hide().load(newHash, function(){
							$ajaxSpinner.fadeOut('normal', function(){
								$loadArea.slideDown('slow', function(){
									$feed.fadeIn('slow', reinitialiseScrollPane);
								});
							});
						});						
					});
				});
			});			

		};
	
	});
	
	$(window).trigger('hashchange');
	
	$.fn.supersized.options = {  
		startwidth: 2560,  
		startheight: 1707,
		vertical_center: 1,
		slideshow: 1,
		navigation: 0,
		transition: 1,
		pause_hover: 0,
		slide_counter: 0,
		slide_captions: 0,
		slide_interval: 20000
	};

	$('#supersize').supersized();
	
	$("#menu li a").click(function() {

		$("#menu li").removeClass("active_btn");
		$(this).parent().addClass("active_btn");

	});

	$("#menu li a[title]").tooltip({
			
			tip: '#tooltip', 
			position: 'center left', 
			offset: [0, -7], 
			effect: 'slide', 
			slideOffset: 0
	});

});

// ]]>
