﻿/*
* Heed Js Functions.
*/


/*
Zorgt ervoor dat de linker en rechterpane een identieke hoogte hebben.
*/
matchSameHeightContainersExt = function () {
  var leftpane = document.getElementById("leftpane");
  var rightpane = document.getElementById("rightpane");
  if (leftpane != null && $('#leftpane').hasClass('sameheightcontainer') && rightpane != null && $('#rightpane').hasClass('sameheightcontainer')) {
    var maxHeight = Math.max(leftpane.style.pixelHeight + leftpane.offsetHeight, rightpane.style.pixelHeight + rightpane.offsetHeight);
    if ((leftpane.style.pixelHeight + leftpane.offsetHeight) != maxHeight)
      leftpane.style.height = maxHeight + "px";
    if ((rightpane.style.pixelHeight + rightpane.offsetHeight) != maxHeight)
      rightpane.style.height = maxHeight + "px";
  }
}

/*
Support script voor collabsible divs. Let op dat de CSS dingen er zijn.
*/
jQuery(document).ready(function () {
  jQuery(".collapsiblecontent").hide();
  //toggle the componenet with class msg_body
  jQuery(".collapsibleheading").click(function () {
    var leftpane = document.getElementById("leftpane");
    if (leftpane != null && $('#leftpane').hasClass('sameheightcontainer'))
      leftpane.style.height = "";
    var rightpane = document.getElementById("rightpane");
    if (rightpane != null && $('#rightpane').hasClass('sameheightcontainer'))
      rightpane.style.height = "";

    jQuery(this).next(".collapsiblecontent").slideToggle(400, function () {
      matchSameHeightContainersExt();
    });
  });
});


