![](http://designsintheflesh.angelfire.com/webdesign/test-flash-DITF.gif)
© 2009 Rainbow Phoenix Designs
![SmileyCentral.com](http://smileys.smileycentral.com/cat/3/3_2_123v.gif)
(function() {
// First we get rid of Google Toolbar Ad..
var searchTable = document.evaluate("//a[contains(@href,'http://toolbar.google.com/')]/ancestor::table", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
if (searchTable.snapshotLength > 0)
{
var innerTable = searchTable.snapshotItem(searchTable.snapshotLength - 1);
innerTable.parentNode.removeChild(innerTable);}
// ..and now from Google Desktop Search Ad
var searchTable = document.evaluate("//a[contains(@href,'http://desktop.google.com/')]/ancestor::table", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
if (searchTable.snapshotLength > 0)
{
var innerTable = searchTable.snapshotItem(searchTable.snapshotLength - 1);
innerTable.parentNode.removeChild(innerTable);}
// Finally we remove the infamous Google AdSense Ads
var RemoveGoogleAds =
{
checkPage: function()
{
currentDoc = document;
try {
if (currentDoc.getElementsByTagName("body")[0].innerHTML.match(/google_ads_frame/i))
{
this.injectCSS("iframe[name='google_ads_frame'] { display: none; }");
}
}
catch(e) {}
},
injectCSS: function(css)
{
head = document.getElementsByTagName("head")[0];
style = document.createElement("style");
style.setAttribute("type", 'text/css');
style.innerHTML = css;
head.appendChild(style);
}
}
RemoveGoogleAds.checkPage();
})();