$.fn.maxHeight = function() {
	var maxHeight = 0;
	this.each(function() {
		var nHeight = $(this).height();
		if(nHeight > maxHeight) maxHeight = nHeight;
	});
	return maxHeight;
}
// give boxes (by css selector) even heights based on largest element
$.fn.alignBoxes = function() {
	return this.height(this.maxHeight() + 'px');
}

$(document).ready(function() {
	
	$('div.catboxes div.cbox div.inner').alignBoxes();
	
	$('div.header ul.service li.font.large a').click(function() {
		$('body').css('font-size', '150%');
		return false;
	});
	$('div.header ul.service li.font.medium a').click(function() {
		$('body').css('font-size', '120%');
		return false;
	});
	$('div.header ul.service li.font.normal a').click(function() {
		$('body').css('font-size', '90%');
		return false;
	});	
});

$(document).ready(function() {
	$('#be-map a').hover(function() {
		$('#be-map').attr('class', $(this).attr('class'));
		if($(this).find('span.infobubble').length < 1) {
			$(this).append($('<span class="infobubble"></span>').text($(this).text()));
		}
		else {
			$(this).find('span.infobubble').show();
		}
	},
	function() {
		$('#be-map').attr('class', '');
		if($(this).find('span.infobubble').length > 0) $(this).find('span.infobubble').hide();
	});
	
	$('#edit-location').focus(function() {
		if($(this).attr('value') == 'Postcode of gemeente') {
			$(this).attr('value', '').css('color', '#000');
		}
	});
});
