var iFcontentHeight;

$(document).ready( function(){
	
	$.bAnimate = false;
	iFcontentHeight = ( $('#footer-menu').outerHeight() );
	
	//Hide footer
	$('#footer').css( 'bottom', '-'+iFcontentHeight+'px' );
	
	showFooter();
	
	mainMenu();
	
	$('.scroll-pane').jScrollPane();
	
});

function showFooter()
{
	//Show/hide footer with an animation
	$('#footer').click(function(){
		$( '#footer' ).animate( { bottom: 0 }, 500);
		$( '#close-footer-menu' ).show();
		$(this).unbind('click');
		$('#footer').click(function(){
			$( '#footer' ).animate( { bottom: '-'+iFcontentHeight+'px' }, 500);
			$('#close-footer-menu').hide();
			$(this).unbind('click');
			showFooter();
		});
	});
}

function mainMenu()
{
	/*$('li.portfolio-menu-item').click( function(ev) {
		
		var target = ev.target;
		
		if( !$(target).parent().hasClass('menu-subcategory') )
		{
			//Als er niet op een knop is geklikt moet het menu weer verdwijnen
			if( $(target).hasClass('menu-category') && $('#home-faux-bg').length == 0 )
			{	
				$('#main-menu').animate({marginRight: 40, height: 'toggle', opacity: 1}, 1000);
			}
			else
			{
				$('#main-menu ul').css('visibility', 'hidden');
				
				$(this).children('ul').css('visibility', 'visible');
				
				// controleren of er een achtergrond afbeelding bestaat
				if ($('#home-faux-bg').length)
				{
					// Afbeelding vervangen met categorie foto
					$('#home-faux-bg').attr('src', 'uploads/category/'+$(this).attr('name'));
					$('#slogan > div').attr( 'style', 'background-color: '+$(this).attr('color')+'; filter: alpha(opacity='+$(this).attr('title')+'); opacity: '+$(this).attr('rel')+'; -moz-opacity: '+$(this).attr('rel')+'; -khtml-opacity: '+$(this).attr('rel')+';');
				}
			}
			
			return false;
		}	
	});*/
	
	$('.menu-category').click( function(ev) {
		
		var target = ev.target;
		
		if( $(target).hasClass('menu-category') && $('#home-faux-bg').length == 0 )
		{
			$('#main-menu').animate({marginRight: 40, height: 'toggle', opacity: 1}, 1000);
			
			return false;
		}	
	});
}

function toggleFaq( p_faqId ) {
	
	$('.faq-awnser').slideUp(500);
	$('.faq-awnser').parent().removeClass('open-faq-item');
	
	$('#'+p_faqId+' .faq-awnser').slideDown(500);
	$('#'+p_faqId).addClass('open-faq-item');
	
}
