	// --------------------------------------------------------------------------
	//		Config
	// --------------------------------------------------------------------------	 


	var introFadeAllowed	= true;	// Only fade in once. After first time this is set to false. 
	var ajaxLoadingDelay    = 300;	// Delay in ms before loading gif MAY disappear.
	
	$.fn.reverse = [].reverse;	// additional jQuery function to revert arrays
	
	
	// --------------------------------------------------------------------------
	//		Document ready 
	// --------------------------------------------------------------------------	 
	
	
	$(document).ready(function()
	{

		// Push footer to bottom of page
	    contentFitPage();
		

		// Focus on keywordfield
		$('#id_q').focus();


        // Fade-in frontpage
		if ($('body').attr('id') == 'frontpage')
		{
			$('#topBar-wrapper, #content, #footer-wrapper, #searchHistory').hide();
			$('*').hoverIntent(
			{    
				sensitivity: 3,
				interval: 100,
				over: function()
				{
					if (introFadeAllowed)
					{
						introFadeAllowed = false
						$('#topBar-wrapper, #content, #footer-wrapper, #searchHistory').fadeIn(400)
					}
				},    
				timeout: 0, 			
				out: function(){}
			});
		}
	})
	
	
	// --------------------------------------------------------------------------
	// 		Window resize
	// --------------------------------------------------------------------------
	

	$(window).resize(function()
	{
		contentFitPage();
	})


	// --------------------------------------------------------------------------
	//		Functions
	// --------------------------------------------------------------------------
	
	
	//	Icon handling

	function iconHover(e, one, two)
	{
		if (! $(e).is('img'))
		{
			e = $(e).find('img.icon16');
		}	
				
		$(e).toggleClass(one).toggleClass(two);
	}
	
	function setIcon16(e, icon)
	{
		$(e).removeClass().addClass('icon16 ' + icon);
	}
	
	
	//	Content fit page (pushes footer down)
	
	function contentFitPage() 
	{
		height = $(window).height() - $('#header').height() - 100
		
		if (height < 50)
		{
			height = 50
		}
		
		$('#content').css('min-height', (height) + 'px')
	}
	

