// Based on Butler, copyright (c) 2005 by Mark Pilgrim.  See
// http://diveintomark.org/projects/butler/
// This script is licensed under the GNU GPL.  See
// http://www.gnu.org/copyleft/gpl.html for more details
//
// ==UserScript==
// @name          Remove Sponsored Links on Google
// @namespace     http://www.bhelpuri.net/Trixie
// @description	  Removes sponsored links (ads) off Google
// @include       http://*.google.*/*
// ==/UserScript==

(function()
{
    var aw1 = document.getElementById('aw1');
	while (aw1)
	{
	    var table = aw1.parentNode;
	    while (table.nodeName != 'TABLE')
	    {
		    table = table.parentNode;
	    }
	    table.parentNode.removeChild(table);
	    // yes Virginia, some Google pages have more than one link with the same ID
	    aw1 = document.getElementById('aw1');
	}

	var tpa1 = document.getElementById('tpa1');
	if (tpa1)
	{
	    var p = tpa1.parentNode.parentNode.parentNode.parentNode;
	    p.parentNode.removeChild(p);
	}
})();