// ==UserScript==
// @name Maxima.org ad remover
// @author Paul Mohr (pmohr)
// @namespace http://boredmder.com/
// @description  Removes Maxima.org's annoying ass ads. Main incentive was the sidebar.
// @download http://boredmder.com/
// ==/UserScript==

if (location.hostname.match(/.*\.maxima\.org/i)) {
  document.addEventListener('load', function(ev) {
    var rows = document.getElementsByTagName("td");
    var row;
    for (var i = 0; row = rows[i]; i++) {

      // Sidebar width is set to 160, so we get rid of it.
      // That sidebar pisses me the fuck off.
      if (row.getAttribute("width") == "160") {
        row.style.display = "none";
      }

    }
  }, false);

  // If the site tries to pull in anything but vbulletin javascript functions,
  // then we go ahead and fsck that up.
  window.opera.addEventListener('BeforeScript', function(e) {
    if( !e.element.getAttribute('src').match(/.*vbulletin.*\.js.*/) ) {
      e.element.setAttribute('src', "");
    }
  }, false);
}

