diff --git a/js/common.js b/js/common.js index 1d52c9770..686e24d07 100755 --- a/js/common.js +++ b/js/common.js @@ -202,7 +202,7 @@ function refreshNavigation() { function addClass(element, classname) { if (element != null) { - element.className += ' ' + classname; + $("#"+element).addClass(classname); //alert('set class: ' + classname + ', now: ' + element.className); } } @@ -213,9 +213,7 @@ function addClass(element, classname) function removeClass(element, classname) { if (element != null) { - element.className = element.className.replace(' ' + classname, ''); - // if there is no other class anem there is no leading space - element.className = element.className.replace(classname, ''); + $("#"+element).removeClass(classname); //alert('removed class: ' + classname + ', now: ' + element.className); } }