I need help modifying a function.

Robert Nyman (www.robertnyman.com) wrote a small collection of functions that handle some dom manipulation, and I'm attempting to use them. One of the functions is called addClassName, and looks like this:

function addClassName(oElm, strClassName){
	var strCurrentClass = oElm.className;
	if(!new RegExp(strClassName, "i").test(strCurrentClass)){
		oElm.className = strCurrentClass + ((strCurrentClass.length > 0)? " " : "") + strClassName;
He sums it up as follows (emphasis mine):
A function to add a class name to an element. It automatically takes into consideration if the element already has that class, and doesnít apply it again if thatís the case. It also adds necessary spaces if the element already has other class names. Called like this:
addClassName(elementReference, "class-name-to-add");
The problem: I wanted to add a class of "on" to an element that already had a class of "option". It appears that the function notices the "on" at the end of "optiON", falsely assumes that element already has "on" as a class, and chooses not to add the new class.

Does anyone know how to modify the function to accommodate for these kinds of scenarios? I've tried to write the author directly, but he's on family leave.

Please note that I'm well aware of javascript libraries out there that can add a class name. My goal with this post is not so much to adopt a new function, but to learn how this current function would change to fix this shortcoming.

Any help is greatly appreciated.