$(function() {
function makeHeightsEqual(p, c) {
  var h = 0;
  $(p).each(function() {
   $(this).find(c).each(function() 
	{
    		if ($(this).height() > h) {h = $(this).height();}
   	}).height(h);
  });}



 makeHeightsEqual('.corpus', '.equaltext');
 makeHeightsEqual('.blocks', '.corpus');
 // makeHeightsEqual('.blocks', '> div');
 makeHeightsEqual('.testimonials', 'blockquote');
 makeHeightsEqual('.four-blocks', '.corpus');

 var elems = $('.testimonials > .testimonial');
 for (var i = 0; i < elems.length; i += 2) {elems.slice(i, i + 2).wrapAll('<div class="testimonials-view"></div>'); };
 $('.testimonials-view').wrapAll('<div class="testimonials-cycle"></div>');
 $('.testimonials-cycle').before('<ul id="testimonial-navigation"><li id="prev" title="← Vorige" tabindex="0">←</li><li id="next" title="Volgende →" tabindex="0">→</li></ul>').cycle({ prev: '#prev', next: '#next', fx: 'scrollHorz', speed: 400, timeout: 15000, containerResize: 1 });

 $('#testimonial-navigation li').mousedown(function() {return false;}); // Maak selectie onmogelijk

 // test for a value
 function oc(a) {
  var o = {};
  for(var i = 0; i < a.length; i++) { o[a[i]] = ''; }
  return o;
 }
});

