function changecss(theClass,element,value) {
//documentation for this script at http://www.shawnolson.net/a/503/
/*
Example....
Function Name: changecss(theClass,element,value)
<span class="exampleA">Example A</span>
<span class="exampleB">Example B</span>
<span class="exampleA">Example A</span>
<input type="button" value="Change A Red" onclick="changecss('.exampleA','color','red')"/>
<input type="button" value="Change A Black" onclick="changecss('.exampleA','color','black')"/>
*/
 var cssRules;
 if (document.all) {
  cssRules = 'rules';
 }
 else if (document.getElementById) {
  cssRules = 'cssRules';
 }
 for (var S = 0; S < document.styleSheets.length; S++){
  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	document.styleSheets[S][cssRules][R].style[element] = value;
   }
  }
 }	
}

function changeClass(fieldName, className)
{
  var myField = document.getElementById(fieldName);
  myField.className = className;
}