на тему добавить удалить класс )))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.Green{
color: #FF0000;
}
.green{
background-color: #008000;
}
</style>
</head>
<body> <div class="Green" onclick="addclass(this,'green');addclass(this,'Green');addclass(this,'green');alert(this.className+' '+this.className.length);">12345</div>
<script language="JavaScript" type="text/javascript">
function delclass(obj, c) { obj.className = obj.className.replace(RegExp('(\\s+|^)' + c + '(\\s+|$)', 'g'), " ").replace(/^\s+|\s+$/,'')}
function addclass(obj, c) { delclass(obj, c); obj.className += " " + c}
</script>
</body>
</html>