
function showHide(e) {
	// element vinden dat de click veroorzaakt
	if (window.event) {
		// IE
		var targetClick = e.srcElement;
	} else {
		// Alle andere browsers
		var targetClick = e.target;
	}
	
	// id van targetClick opvragen en daar de laatste 2 cijfers van pakken
	var targetId = targetClick.id;
	targetId = targetId.substr(11,12);
	// id opbouwen van te tonen comment block
	var targetId = "comment" + targetId;

	//Alle openstaande comments sluiten
	hideAllTableCommants();
	// Kijken of de table row nu al getoond wordt
	if (document.getElementById(targetId).style.visibility == "hidden" || document.getElementById(targetId).style.visibility == "" )
	{
	document.getElementById(targetId).style.visibility = "visible"; 
	document.getElementById(targetId).style.position = "relative";
	}
	else
	{
	document.getElementById(targetId).style.visibility = "hidden"; 
	document.getElementById(targetId).style.position = "absolute";
	}
}

function hideAllTableCommants (e) {
	// commentaar blocken ophalen
	var tableCommant01 = document.getElementById('comment01');
	tableCommant01.style.visibility = "hidden";
	tableCommant01.style.position = "absolute";
	
	var tableCommant02 = document.getElementById('comment02');
	tableCommant02.style.visibility = "hidden";
	tableCommant02.style.position = "absolute";
	
	var tableCommant03 = document.getElementById('comment03');
	tableCommant03.style.visibility = "hidden";
	tableCommant03.style.position = "absolute";
	
	var tableCommant04 = document.getElementById('comment04');
	tableCommant04.style.visibility = "hidden";
	tableCommant04.style.position = "absolute";
	
	var tableCommant05 = document.getElementById('comment05');
	tableCommant05.style.visibility = "hidden";
	tableCommant05.style.position = "absolute";
	
	var tableCommant06 = document.getElementById('comment06');
	tableCommant06.style.visibility = "hidden";
	tableCommant06.style.position = "absolute";
	
	var tableCommant07 = document.getElementById('comment07');
	tableCommant07.style.visibility = "hidden";
	tableCommant07.style.position = "absolute";
	
	var tableCommant08 = document.getElementById('comment08');
	tableCommant08.style.visibility = "hidden";
	tableCommant08.style.position = "absolute";
	
	var tableCommant09 = document.getElementById('comment09');
	tableCommant09.style.visibility = "hidden";
	tableCommant09.style.position = "absolute";
	
	var tableCommant10 = document.getElementById('comment10');
	tableCommant10.style.visibility = "hidden";
	tableCommant10.style.position = "absolute";
	
	var tableCommant11 = document.getElementById('comment11');
	tableCommant11.style.visibility = "hidden";
	tableCommant11.style.position = "absolute";
	
	var tableCommant12 = document.getElementById('comment12');
	tableCommant12.style.visibility = "hidden";
	tableCommant12.style.position = "absolute";
	
	var tableCommant13 = document.getElementById('comment13');
	tableCommant13.style.visibility = "hidden";
	tableCommant13.style.position = "absolute";
	
	var tableCommant14 = document.getElementById('comment14');
	tableCommant14.style.visibility = "hidden";
	tableCommant14.style.position = "absolute";
	
	var tableCommant15 = document.getElementById('comment15');
	tableCommant15.style.visibility = "hidden";
	tableCommant15.style.position = "absolute";
	
	var tableCommant16 = document.getElementById('comment16');
	tableCommant16.style.visibility = "hidden";
	tableCommant16.style.position = "absolute";
	
	var tableCommant17 = document.getElementById('comment17');
	tableCommant17.style.visibility = "hidden";
	tableCommant17.style.position = "absolute";
	
	var tableCommant18 = document.getElementById('comment18');
	tableCommant18.style.visibility = "hidden";
	tableCommant18.style.position = "absolute";
	
	var tableCommant19 = document.getElementById('comment19');
	tableCommant19.style.visibility = "hidden";
	tableCommant19.style.position = "absolute";
	
	var tableCommant20 = document.getElementById('comment20');
	tableCommant20.style.visibility = "hidden";
	tableCommant20.style.position = "absolute";
	
	var tableCommant21 = document.getElementById('comment21');
	tableCommant21.style.visibility = "hidden";
	tableCommant21.style.position = "absolute";
	
	var tableCommant22 = document.getElementById('comment22');
	tableCommant22.style.visibility = "hidden";
	tableCommant22.style.position = "absolute";
	
	var tableCommant23 = document.getElementById('comment23');
	tableCommant23.style.visibility = "hidden";
	tableCommant23.style.position = "absolute";
	
	var tableCommant24 = document.getElementById('comment24');
	tableCommant24.style.visibility = "hidden";
	tableCommant24.style.position = "absolute";
	
	var tableCommant25 = document.getElementById('comment25');
	tableCommant25.style.visibility = "hidden";
	tableCommant25.style.position = "absolute";
	
	var tableCommant26 = document.getElementById('comment26');
	tableCommant26.style.visibility = "hidden";
	tableCommant26.style.position = "absolute";
	
	var tableCommant27 = document.getElementById('comment27');
	tableCommant27.style.visibility = "hidden";
	tableCommant27.style.position = "absolute";
	
	var tableCommant100 = document.getElementById('comment100');
	tableCommant100.style.visibility = "hidden";
	tableCommant100.style.position = "absolute";
	
	var tableCommant101 = document.getElementById('comment101');
	tableCommant101.style.visibility = "hidden";
	tableCommant101.style.position = "absolute";
	
	var tableCommant102 = document.getElementById('comment102');
	tableCommant102.style.visibility = "hidden";
	tableCommant102.style.position = "absolute";
	
	var tableCommant103 = document.getElementById('comment103');
	tableCommant103.style.visibility = "hidden";
	tableCommant103.style.position = "absolute";
	
	var tableCommant105 = document.getElementById('comment105');
	tableCommant105.style.visibility = "hidden";
	tableCommant105.style.position = "absolute";
}
function addListeners(e){
/*
if (!document.getElementsByName) return;

var all_comments = document.getElementsByName("showComment");
for(var i = 0; i<all_comments.length; i++) {
	addEvent(all_comments[i], 'click', showHide, false);
}
*/
/* table comments */
var linkShowCommant01 = document.getElementById('showCommant01');
addEvent(linkShowCommant01, 'click', showHide, false);

var linkShowCommant02 = document.getElementById('showCommant02');
addEvent(linkShowCommant02, 'click', showHide, false);

var linkShowCommant03 = document.getElementById('showCommant03');
addEvent(linkShowCommant03, 'click', showHide, false);

var linkShowCommant04 = document.getElementById('showCommant04');
addEvent(linkShowCommant04, 'click', showHide, false);

var linkShowCommant05 = document.getElementById('showCommant05');
addEvent(linkShowCommant05, 'click', showHide, false);

var linkShowCommant06 = document.getElementById('showCommant06');
addEvent(linkShowCommant06, 'click', showHide, false);

var linkShowCommant07 = document.getElementById('showCommant07');
addEvent(linkShowCommant07, 'click', showHide, false);

var linkShowCommant08 = document.getElementById('showCommant08');
addEvent(linkShowCommant08, 'click', showHide, false);

var linkShowCommant09 = document.getElementById('showCommant09');
addEvent(linkShowCommant09, 'click', showHide, false);

var linkShowCommant10 = document.getElementById('showCommant10');
addEvent(linkShowCommant10, 'click', showHide, false);

var linkShowCommant11 = document.getElementById('showCommant11');
addEvent(linkShowCommant11, 'click', showHide, false);

var linkShowCommant12 = document.getElementById('showCommant12');
addEvent(linkShowCommant12, 'click', showHide, false);

var linkShowCommant13 = document.getElementById('showCommant13');
addEvent(linkShowCommant13, 'click', showHide, false);

var linkShowCommant14 = document.getElementById('showCommant14');
addEvent(linkShowCommant14, 'click', showHide, false);

var linkShowCommant15 = document.getElementById('showCommant15');
addEvent(linkShowCommant15, 'click', showHide, false);

var linkShowCommant16 = document.getElementById('showCommant16');
addEvent(linkShowCommant16, 'click', showHide, false);

var linkShowCommant17 = document.getElementById('showCommant17');
addEvent(linkShowCommant17, 'click', showHide, false);

var linkShowCommant18 = document.getElementById('showCommant18');
addEvent(linkShowCommant18, 'click', showHide, false);

var linkShowCommant19 = document.getElementById('showCommant19');
addEvent(linkShowCommant19, 'click', showHide, false);

var linkShowCommant20 = document.getElementById('showCommant20');
addEvent(linkShowCommant20, 'click', showHide, false);

var linkShowCommant21 = document.getElementById('showCommant21');
addEvent(linkShowCommant21, 'click', showHide, false);

var linkShowCommant22 = document.getElementById('showCommant22');
addEvent(linkShowCommant22, 'click', showHide, false);

var linkShowCommant23 = document.getElementById('showCommant23');
addEvent(linkShowCommant23, 'click', showHide, false);

var linkShowCommant24 = document.getElementById('showCommant24');
addEvent(linkShowCommant24, 'click', showHide, false);

var linkShowCommant25 = document.getElementById('showCommant25');
addEvent(linkShowCommant25, 'click', showHide, false);

var linkShowCommant26 = document.getElementById('showCommant26');
addEvent(linkShowCommant26, 'click', showHide, false);

var linkShowCommant27 = document.getElementById('showCommant27');
addEvent(linkShowCommant27, 'click', showHide, false);

var linkShowCommant100 = document.getElementById('showCommant100');
addEvent(linkShowCommant100, 'click', showHide, false);

var linkShowCommant101 = document.getElementById('showCommant101');
addEvent(linkShowCommant101, 'click', showHide, false);

var linkShowCommant102 = document.getElementById('showCommant102');
addEvent(linkShowCommant102, 'click', showHide, false);

var linkShowCommant103 = document.getElementById('showCommant103');
addEvent(linkShowCommant103, 'click', showHide, false);

var linkShowCommant105 = document.getElementById('showCommant105');
addEvent(linkShowCommant105, 'click', showHide, false);

//-------------------------------------------- Kruisjes
var linkHideCommant01 = document.getElementById('closeAllCom01');
addEvent(linkHideCommant01, 'click', hideAllTableCommants, false);

var linkHideCommant02 = document.getElementById('closeAllCom02');
addEvent(linkHideCommant02, 'click', hideAllTableCommants, false);

var linkHideCommant03 = document.getElementById('closeAllCom03');
addEvent(linkHideCommant03, 'click', hideAllTableCommants, false);

var linkHideCommant04 = document.getElementById('closeAllCom04');
addEvent(linkHideCommant04, 'click', hideAllTableCommants, false);

var linkHideCommant05 = document.getElementById('closeAllCom05');
addEvent(linkHideCommant05, 'click', hideAllTableCommants, false);

var linkHideCommant06 = document.getElementById('closeAllCom06');
addEvent(linkHideCommant06, 'click', hideAllTableCommants, false);

var linkHideCommant07 = document.getElementById('closeAllCom07');
addEvent(linkHideCommant07, 'click', hideAllTableCommants, false);

var linkHideCommant08 = document.getElementById('closeAllCom08');
addEvent(linkHideCommant08, 'click', hideAllTableCommants, false);

var linkHideCommant09 = document.getElementById('closeAllCom09');
addEvent(linkHideCommant09, 'click', hideAllTableCommants, false);

var linkHideCommant10 = document.getElementById('closeAllCom10');
addEvent(linkHideCommant10, 'click', hideAllTableCommants, false);

var linkHideCommant11 = document.getElementById('closeAllCom11');
addEvent(linkHideCommant11, 'click', hideAllTableCommants, false);

var linkHideCommant12 = document.getElementById('closeAllCom12');
addEvent(linkHideCommant12, 'click', hideAllTableCommants, false);

var linkHideCommant13 = document.getElementById('closeAllCom13');
addEvent(linkHideCommant13, 'click', hideAllTableCommants, false);

var linkHideCommant14 = document.getElementById('closeAllCom14');
addEvent(linkHideCommant14, 'click', hideAllTableCommants, false);

var linkHideCommant15 = document.getElementById('closeAllCom15');
addEvent(linkHideCommant15, 'click', hideAllTableCommants, false);

var linkHideCommant16 = document.getElementById('closeAllCom16');
addEvent(linkHideCommant16, 'click', hideAllTableCommants, false);

var linkHideCommant17 = document.getElementById('closeAllCom17');
addEvent(linkHideCommant17, 'click', hideAllTableCommants, false);

var linkHideCommant18 = document.getElementById('closeAllCom18');
addEvent(linkHideCommant18, 'click', hideAllTableCommants, false);

var linkHideCommant19 = document.getElementById('closeAllCom19');
addEvent(linkHideCommant19, 'click', hideAllTableCommants, false);

var linkHideCommant20 = document.getElementById('closeAllCom20');
addEvent(linkHideCommant20, 'click', hideAllTableCommants, false);

var linkHideCommant21 = document.getElementById('closeAllCom21');
addEvent(linkHideCommant21, 'click', hideAllTableCommants, false);

var linkHideCommant22 = document.getElementById('closeAllCom22');
addEvent(linkHideCommant22, 'click', hideAllTableCommants, false);

var linkHideCommant23 = document.getElementById('closeAllCom23');
addEvent(linkHideCommant23, 'click', hideAllTableCommants, false);

var linkHideCommant24 = document.getElementById('closeAllCom24');
addEvent(linkHideCommant24, 'click', hideAllTableCommants, false);

var linkHideCommant25 = document.getElementById('closeAllCom25');
addEvent(linkHideCommant25, 'click', hideAllTableCommants, false);

var linkHideCommant26 = document.getElementById('closeAllCom26');
addEvent(linkHideCommant26, 'click', hideAllTableCommants, false);

var linkHideCommant27 = document.getElementById('closeAllCom27');
addEvent(linkHideCommant27, 'click', hideAllTableCommants, false);

var linkHideCommant100 = document.getElementById('closeAllCom100');
addEvent(linkHideCommant100, 'click', hideAllTableCommants, false);

var linkHideCommant101 = document.getElementById('closeAllCom101');
addEvent(linkHideCommant101, 'click', hideAllTableCommants, false);

var linkHideCommant102 = document.getElementById('closeAllCom102');
addEvent(linkHideCommant102, 'click', hideAllTableCommants, false);

var linkHideCommant103 = document.getElementById('closeAllCom103');
addEvent(linkHideCommant103, 'click', hideAllTableCommants, false);

var linkHideCommant105 = document.getElementById('closeAllCom105');
addEvent(linkHideCommant105, 'click', hideAllTableCommants, false);

}

//window.addEventListener('load', addListeners, false);
addEvent(window, 'load', addListeners, false);

function addEvent(elm, evType, fn, useCapture)
      // cross-browser event handling for IE5+, NS6+ and Mozilla/Gecko
// By Scott Andrew
      // Tijmen: als elm niet bestaat, doe dan niks
{
    if (!elm)
        return
        if (elm.addEventListener) {
          elm.addEventListener(evType, fn, useCapture); 
          return true; 
        } else if (elm.attachEvent) {
          var r = elm.attachEvent('on' + evType, fn); 
          return r; 
        } else {
          elm['on' + evType] = fn;
        }
      }
