$(document).ready(initPage);

function initPage()
{
	$('h3').each(function()
	{
		if($(this).text().length < 1) {
			$(this).remove();
		}
	});
	var rowsArr = new Array();
	var colArr = new Array();
	$('.container-title').each(function()
	{
		var parentId = $($(this).parent().get(0)).attr('id');
		colArr.push({headlineObj: $(this), valueLength: $(this).text().length, empty: ($(this).text().length == 0)});
		if(parentId == 'vier')
		{
			removeHeadlineOnRow = true;
			for(var i=0; i < colArr.length; i++)
			{
				if(!colArr[i].empty)
				{
					removeHeadlineOnRow = false;
				}
			}
			rowsArr.push({removeHeadlines:removeHeadlineOnRow, cols: colArr});
			colArr = new Array();
		}
	});
	for(var i=0; i < rowsArr.length; i++)
	{
		if(rowsArr[i].removeHeadlines)
		{
			for(var z=0; z < rowsArr[i].cols.length; z++)
			{
				$(rowsArr[i].cols[z].headlineObj).remove();
			}
		}
	}
}
