code: function(element, name) {
          if(OpenLayers.Element.hasClass(element, name)) {
              OpenLayers.Element.removeClass(element, name);
          } else {
              OpenLayers.Element.addClass(element, name);
          }
          return element;
      }
docs: Function: toggleClass
  Remove a CSS class name from an element if it exists.  Add the class name
  if it doesn't exist.
  
  Parameters:
  element - {DOMElement} A DOM element node.
  name - {String} The CSS class name to toggle.
  
  Returns:
  {DOMElement} The element.