function initServiceArea() {

	var div = document.getElementById('service-area');
	if (div) {
		
		var node = findFirstSub(div, 'DIV', 'service-element');
		while(node) {
			var headline = getDeepSub(node, 'H1', null);
			var content = getDeepSub(node, 'DIV', 'service-content');
			if (headline && content) {
				addClass(headline, 'hasJs');
				if (matchClassName('open', node.className)) {
					removeClass(node, 'open');
					headline.onclick = function() {
						closeServiceElement(this);
					}
				} else {
					addClass(node, 'closed');
					headline.onclick = function() {
						openServiceElement(this);
					}
				}
			}
			node = findNextSub(node, 'DIV', 'service-element');
		}
	}

}

function openServiceElement(element) {

	if (element) {
		var openNode = element.parentNode;
		var div = document.getElementById('service-area');
		if (div) {
			
			var node = findFirstSub(div, 'DIV', 'service-element');
			while(node) {
				addClass(node, 'closed');
				var headline = getDeepSub(node, 'H1', null);
				if (headline) {
					headline.onclick = function() {
						openServiceElement(this);
					}
				}
				node = findNextSub(node, 'DIV', 'service-element');
			}
		}

		if (openNode) {
			removeClass(openNode, 'closed');
			element.onclick = function() {
				closeServiceElement(this);
			}
		}
	}
}

function closeServiceElement(element) {
	if (element) {
		var node = element.parentNode;
		if (node) {
			addClass(node, 'closed');
			element.onclick = function() {
				openServiceElement(this);
			}
		}
	}
}

addInitFunction(initServiceArea);