function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            oldonload();
            func();
        }
    }
}

addLoadEvent ( function () {
	selectBox = document.getElementById('m');
  selectBox2 = document.getElementById('d');
  selectForm = document.getElementById('select');
  
  if(selectBox && selectBox2 && selectForm) {
    selectBox2.onchange = selectBox.onchange = function () {
      selectForm.submit();
    }
  }
  
	if(selectBox) {
		selectBox.currentIndex = selectBox.selectedIndex;
		// Ankerlink setzen, um den aktuellen Monat herbeizuscrollen
		if(selectBox.selectedIndex == 0) {
			Datum = new Date();
			Jahr = Datum.getFullYear();
			Monat = Datum.getMonth() + 1;
			if(Monat < 10) Monat = "0" + Monat;			
			document.location.href = "#m" + Jahr + Monat;
		}
	}

} );
