function webstats_toggle_class(elm,div) {
 var tabs = $(div).getElementsByTagName('li');
 for(j = 0; j < tabs.length; j++) {
   link = tabs[j].getElementsByTagName('a')[0];
   link.className = "";
 }
 $(elm).className='w_active';
}

function webstats_toggle_display(elm) {
  var e = $(elm);
  if (!e || !e.style) return;
  var visible = 'block';
  if (e.get && 'span'==e.get('tag')) visible='inline';
  e.style.display = ('none'==e.style.display ? visible : 'none');
}

// Prototype compat
if (this.Element && !this.Element.toggle) {
  Element.toggle = function(element) {
    webstats_toggle_display(element);
  };
}
if (!this.Event && this.Element) { 
  Event = Element.Event;
}
if (this.Event && !Event.observe) {
  Event.observe = function(element, eventName, handler) {$(element).addEvent(eventName, handler)};
}
if (!this.$F) {
  $F = function(element) {return $(element).value;}
}
if (this.Element && !this.Element.getInputs) {
  Element.prototype.getInputs = function(type, name) {
    return this.getElements('input[name=search_type]');
  }
}
