try {
	console.log("Browser has console..");
} catch(e) {
	console = {
		log: function(str) {}
	};
}

function toSubmenu(id) {
	$('.rechtssubmenu').hide();
	$('#submenu_'+id).show();
	$('#mask').css({'height':$('#submenu_'+id).parent().height()});	
}

$(document).ready(function() {
	$('.rechtssubmenu').hide();
	
	$('.menulink').each(function() {
		var href = $(this).attr('href');
		if (href.indexOf('?') != -1) {
			href = href.substr(0,href.indexOf('?'));
		}
		
		
		if (href == f) {
			$(this).parent().addClass('selected');
		}
	});
	$('.faq_vraag').click(function() {
		if (!$('#'+$(this).attr('target')).is(":visible")) {
			$('.faq_vraag').css('background-image','url(images/maximise.gif)');
			$('.faq_antwoord').hide();
														
			$(this).css('background-image','url(images/minimise.gif)');
			$('#'+$(this).attr('target')).show();
		} else {
			$(this).parent().children('.faq_vraag').css('background-image','url(images/maximise.gif)');
			$('.faq_antwoord').hide();
		}
	});
			
	$(this).parent().children('.faq_vraag').css('background-image','url(images/maximise.gif');
	$('.faq_antwoord').hide();
	
	$('.textBoxContent').each(function() {
		$(this).attr('realHeight',$(this).height());
		if ($(this).height() > maxHeightVoorPagina) {
			$(this).height(maxHeightVoorPagina);
		} else {
			$('.paginatekstlink[paginatekstID='+$(this).attr('paginatekstID')+']').hide();
		}
	});
	$('.textBoxContent').height(maxHeightVoorPagina);
	
	// LH = Line-Height
	// FS = Font-Size
	// R = Rows of text
	// Height = FS + ( R - 1 * (FS+LH));
});
	
var maxHeightVoorPagina = 86;	
function fixTextBox(id) {
	if ($('.paginatekstlink[paginatekstID='+id+']').html() == 'Lees meer...') {
		$('.paginatekstlink[paginatekstID='+id+']').html('...Minder');
		$('.textBoxContent[paginatekstID='+id+']').height(parseInt($('.textBoxContent[paginatekstID='+id+']').attr('realHeight')));
	} else {
		$('.paginatekstlink[paginatekstID='+id+']').html('Lees meer...');
		$('.textBoxContent[paginatekstID='+id+']').height(maxHeightVoorPagina);	
	}
}
	

