var lcase = text.toLowerCase();
var ucase = text.toUpperCase();
if(lcase == text) repl = ucase; /* was lowercase */
else if(ucase != text) repl = lcase; /* neither lower- or upper-case */
else { /* upper case -> camel-case */
var lcase = text.toLowerCase();
var ucase = text.toUpperCase();
if(lcase == text) repl = ucase; /* was lowercase */
else if(ucase != text) repl = lcase; /* neither lower- or upper-case */
else { /* upper case -> camel-case */