$(document).ready(function() {
	
	$('a[href^=\'http\']').attr('target','_blank');
	
	var path = window.location.pathname;

	$('#sidebar a').each(function(i) {
		if($(this).attr('href') == path) {
			$(this).addClass('selected');
		}
	});
	
	$('#faq p').hide();
	
	$('#faq h3').each(function() {
		$(this).addClass('question');
		
		$(this).click(function(event) {
			
			var $answer = $(this).nextUntil('h3.question');
			
			$answer.each(function() {
				
				if($(this).is(':hidden')) {
					$(this).show();
				} else {
					$(this).hide();
				}
			});
		
			$("#column2").height($("#faq").height() + 57);
		});
	});
	
	
	
	var initText = 'emailadres';

	
	if($('#inputNewsletter').val() == '') { // prevent removal of content when back button is used
		$('#inputNewsletter').val(initText).css('color', 'gray');
		$('#inputNewsletter').mousedown(clear).focus(clear);
	}
});

var clear = function() {
	$(this).val('').css('color', 'black');
	$(this).unbind('mousedown').unbind('focus');
};