$(document).ready(function() {
	DoJQuery()
})

function DoJQuery() {
	$('div.container div.wrppr').each(function() {
		$(this).children('div.block-pagesection:nth-child(4n)').addClass('last');
	})
	$('.pagesection-footer-salland').mouseover(function() {
		$(this).addClass('salland')
	})
	$('.pagesection-footer-salland').mouseout(function() {
		$(this).removeClass('salland')
	})
	$('.pagesection-footer-hollandzorg').mouseover(function() {
		$(this).addClass('hollandzorg')
	})
	$('.pagesection-footer-hollandzorg').mouseout(function() {
		$(this).removeClass('hollandzorg')
	})
	$('.pagesection-footer-energiek').mouseover(function() {
		$(this).addClass('energiek')
	})
	$('.pagesection-footer-energiek').mouseout(function() {
		$(this).removeClass('energiek')
	})
	$('.pagesection-footer-verzuim').mouseover(function() {
		$(this).addClass('verzuim')
	})
	$('.pagesection-footer-verzuim').mouseout(function() {
		$(this).removeClass('verzuim')
	})
	$('div.modiv-news div.item').mouseover(function() {
		$(this).addClass('news-item')
	})
	$('div.modiv-news div.item').mouseout(function() {
		$(this).removeClass('news-item')
	})
	$('div.modiv-jobs div.item').mouseover(function() {
		$(this).addClass('news-item')
	})
	$('div.modiv-jobs div.item').mouseout(function() {
		$(this).removeClass('news-item')
	})
	$("div.footer .block-pagesection").click(function() {
		//window.open($(this).find("a").attr("href"))
		//return false;
		window.location = $(this).find("a").attr("href"); 
		return false;
	})
	/*tooltip*/
	$('body').append('<div class="tooltip"></div>');
	$("span.help").mouseover(function(e) {
		$('div.tooltip').show()
		$('div.tooltip').html($(this).html())
		$('div.tooltip').css( { "left": (e.pageX + 10) + "px", "top":e.pageY + "px" } );
	})
	$("span.help").mousemove(function(e) {
		$('div.tooltip').css( { "left": (e.pageX + 10) + "px", "top":e.pageY + "px" } );
	})
	$("span.help").mouseout(function() {$('div.tooltip').hide()})
	$('span.help:empty').css('display', 'none')
		
	$('div.formbutton-default div.field input,div.paragraph-button div.wrapper div.text a').mouseover(function() {$(this).parent().addClass('selected')})
	$('div.formbutton-default div.field input,div.paragraph-button div.wrapper div.text a').mouseout(function() {$(this).parent().removeClass('selected')})
	$('div.formbutton-default div.field input,div.paragraph-button div.wrapper div.text a').focus(function() {$(this).parent().addClass('active')})
	$('div.formbutton-default div.field input,div.paragraph-button div.wrapper div.text a').blur(function() {$(this).parent().removeClass('active')})
	$('div.fieldgrp-bottom').each(function() {$(this).children('div').addClass('bot')})
	$('.first.active').addClass('firstActive');
	$('.last.active').addClass('lastActive');
	$('.hasChild.active').addClass('hasChildActive');
	$('.last.hasChild.active').addClass('lastHasChildActive');
	$('div.print ~ div.block-eccolumns > div.eccolumns-graybox-700').parent().prev('div.print').addClass('graybox');
	
	equalHeight($(".block-col1-home > div, .block-col2-home > div, .block-col3-home > div"));
}

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}