function nabu_str_replace(search, replace, subject)   {  return subject.split(search).join(replace);  }


function nabu_getAlias(href){
	
	var result = nabu_str_replace('.html','',href);
	var parts = result.split('/');
	result = parts[parts.length-1];
	
	return result; 
	
}//nabu_getAlias(href){


function nabu_hasCalendarParameters(){
	
	var params = window.location.search;
	var day = params.split('day');
	var month = params.split('month');
	
	return day.length>1 || month.length>1;
	
}//function nabu_hd__hasCalendarParameters(){


$(document).ready(function(){
	//$('.nabu-rno #nabu-deutschland-termindatenbank div').css('display','none');
	
	if (nabu_hasCalendarParameters()){
		$('#nabu-hd-veranstaltungen,#nabu-hd-presse').hide();
		$('#nabu-hd-veranstaltungs-archiv,#nabu-hd-presse-archiv').show();
	}
	else{
		$('#nabu-hd-veranstaltungen,#nabu-hd-presse').show();
		$('#nabu-hd-veranstaltungs-archiv,#nabu-hd-presse-archiv').hide();
	}
		
	var hauptmenueEintrag = $('#navigationspfad > a:eq(1)');if(!hauptmenueEintrag)return;//=====================================>
	hauptmenueEintrag = hauptmenueEintrag.attr('href');if(!hauptmenueEintrag)return;//=====================================>
	var parts = hauptmenueEintrag.split('.');
	var aTag = $('#hauptmenue a[href="' + parts[0] + '.html"]');if(!aTag)return;//==============================================>
	aTag.parent().addClass('active');
	aTag.addClass('active');
	
	var href = nabu_getAlias($(location).attr('href'));
	
	if (href=='kontakt-bestaetigung'){
		
		//var parent = $('li a[title="Kontakt"]').parent();
		$('ul.untermenue li a[title="Kontakt"]').parent().html('<span class="active">Kontakt</span>').addClass('active');
		//parent.addClass('active');
	}
	
});//$(document).ready(function(){

