function addClass(el, cls, forceBefore) {
	if(forceBefore != null && el.className.match(new RegExp('(^| )' + forceBefore))) {
		el.className = el.className.replace(new RegExp("( |^)" + forceBefore), '$1' + cls + ' ' + forceBefore);

	} else if(!el.className.match(new RegExp('(^| )' + cls + '($| )'))) {
		el.className += ' ' + cls;
		el.className = el.className.replace(/(^ +)|( +$)/g, '');
	}
}
/*
 * Functions to add and remove class names
 * Mac IE hates unnecessary spaces
 */
Functions to add and remove class names
Mac IE hates unnecessary spaces
Functions to add and remove class names Mac IE hates unnecessary spaces
function addClass(el, cls, forceBefore) {
	if(forceBefore != null && el.className.match(new RegExp('(^| )' + forceBefore))) {
		el.className = el.className.replace(new RegExp("( |^)" + forceBefore), '$1' + cls + ' ' + forceBefore);
	} else if(!el.className.match(new RegExp('(^| )' + cls + '($| )'))) {
		el.className += ' ' + cls;
		el.className = el.className.replace(/(^ +)|( +$)/g, '');
	}
}
function addClass ( el , cls , forceBefore ) { if ( forceBefore != null && el . className . match ( new RegExp ( '(^| )' + forceBefore ) ) ) { el . className = el . className . replace ( new RegExp ( "( |^)" + forceBefore ) , '$1' + cls + ' ' + forceBefore ) ; } else if ( ! el . className . match ( new RegExp ( '(^| )' + cls + '($| )' ) ) ) { el . className += ' ' + cls ; el . className = el . className . replace ( / (^ +)|( +$) / g , '' ) ; } }
Functions to add and remove class names
 Mac IE hates unnecessary spaces
Functions to add and remove class names Mac IE hates unnecessary spaces