$(document).ready(function() {

	// hide all ul elements in tree
	$('#navigation_list ul').each ( function(i) { $(this).hide(); } );

	// get href as unique identifier
	var urluid = $('#service_row a').attr("href");

	// search in #navigation_list for link and activate
	var activeElement = $('#navigation_list a[@href='+urluid+']');
		activeElement.removeClass();
		activeElement.addClass('subnav_active');

	// is next element a subnavigation: show, no need to highlight
	if (activeElement.next().is("ul")) {
		activeElement.next().show();
	}

	// is previous higher element a subnavigation: show	and highlight prev link
	if (activeElement.parent().parent().is("ul")) {
		activeElement.parent().parent().show();
		activeElement.parent().parent().prev().removeClass();;
		activeElement.parent().parent().prev().addClass('subnav_active');
	}

	// is previous previous higher element a subnavigation: show	and highlight prev link
	if (activeElement.parent().parent().parent().parent().is("ul")) {
		activeElement.parent().parent().show();
		activeElement.parent().parent().prev().removeClass();;
		activeElement.parent().parent().prev().addClass('subnav_active');
		activeElement.parent().parent().parent().parent().show();
		activeElement.parent().parent().parent().parent().prev().removeClass();;
		activeElement.parent().parent().parent().parent().prev().addClass('subnav_active');
	}

});

function validateForm(formID) {
	var error = false;
	$('#'+formID+' :input').each(function(){
		$(this).css({ background: "#FFFFFF" });
		if (this.title == 'required' && this.value == '') {
			$(this).css({ background: "#FFFF99" });
			error = true;
		}
	});
	if (error == false) $('#'+formID).submit();
};
