/*

    Hide Golem Ads
    (c) Volker Gropp
    http://www.gropp.org/

    done with alot help by http://diveintogreasemonkey.org, thanks

    This program is free software; you can redistribute it and/or modify       
    it under the terms of the GNU General Public License as published by       
    the Free Software Foundation; either version 2 of the License, or          
    (at your option) any later version.                                        
                                                                               
    This program is distributed in the hope that it will be useful,            
    but WITHOUT ANY WARRANTY; without even the implied warranty of             
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
    GNU General Public License for more details.                               
                                                                               
    You should have received a copy of the GNU General Public License          
    along with this program; if not, write to the Free Software                
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  

*/

// ==UserScript==
// @name            Hide Golem.de Ads
// @namespace       http://www.gropp.org/
// @description     (2005-06-16) Hides Golem Ads
// @include         http://www.golem.de/*
// ==/UserScript==

(function() {

var allTable,thisTable,allImg,thisImg,allH5,thisH5,allAhref,thisAhref,vergleichTable,n;

allTable = document.evaluate("//table[@width='480']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < allTable.snapshotLength; i++) {
    thisTable = allTable.snapshotItem(i);
    allImg = document.evaluate("//img[@alt='ANZEIGE']",thisTable,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
    thisImg = allImg.snapshotItem(0);
    if (thisImg) {
        thisTable.parentNode.removeChild(thisTable);
    }
}

allH5 = document.evaluate("//h5[@class='rightcolhead']",document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < allH5.snapshotLength; i++) {
    thisH5 = allH5.snapshotItem(i);
    allAhref = document.evaluate("//a[@href='http://markt.golem.de/']",thisH5,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
    thisAhref = allAhref.snapshotItem(0);
    if (thisAhref) {
        thisH5.parentNode.removeChild(thisH5);
    }
}

    allAhref = document.evaluate("//td[@class='xsmall']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
    thisAhref = allAhref.snapshotItem(0);
    if (thisAhref) {
        thisAhref.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(thisAhref.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode);
    }

allTable = document.evaluate("//td[@width='160']",document,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
for (var i = 0; i < allTable.snapshotLength; i++) {
    thisTable = allTable.snapshotItem(i);
    allImg = document.evaluate("//iframe",thisTable,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);
    thisImg = allImg.snapshotItem(0);
    if (thisImg) {
        thisTable.parentNode.removeChild(thisTable);
    }
}
    
})();

