// Repubblicrap
// version 1.0 BETA!
// 2008-04-08
// Copyright (c) 2008, Bucknasty
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// IF YOU ARE UPGRADING FROM A PREVIOUS VERSION OF Repubblicrap, go to
// Tools/Manage User Scripts and manually uninstall the previous
// version before installing this one.  Sorry, this is a limitation
// of Greasemonkey.
// 
// To uninstall, go to Tools/Manage User Scripts,
// select "Repubblicrap", and click Uninstall.
//

// ==UserScript==
// @name            Repubblicrap 1.0
// @namespace       http://www.7yearwinter.com
// @description     Perche' non hai tempo per le stronzate.
// @include         http://*.repubblica.*/*
// ==/UserScript==

var ccenter = document.getElementById('ccenter');
ccenter.style.width = '990px';
var contenitorecentro = document.getElementById('contenitorecentro');
contenitorecentro.style.width = '990px';

var colonnanotizie = document.getElementById('colonnanotizie');
colonnanotizie.style.width = '990px';

var aperturahp = document.getElementById('aperturahp');
aperturahp.style.width = '470px';
aperturahp.style.font = '21px';

var riapertura2hp = document.getElementById('riapertura2hp');
riapertura2hp.style.cssFloat = 'right';
	


var loalpubblica = new Array(  "//*[@id='sottospalla']","//*[@id='multimedia']","//*[@id='rrtg']","//*[@id='opinioni']","//*[@id='cright']","//*[@id='newborsa']","//*[@id='cerca']","//*[@id='sudoku']","//*[@id='shoppingall']","//*[@id='adv160x600r']","//*[@id='propone']","//*[@id='annunci']","//*[@id='sbcolleft']","//*[@id='ge-network']","//*[@id='neworoscopo']","//*[@class='generalbox']","//*[@class='shared-content-vetrina-hp']","//*[@class='deejay-club']","//*[@id='ventiquattrore']","//*[@class='generalbox edizioni-locali']", "//*[@class='generalbox deejay']/.." );

function rimuoviciochefacciamoinvecedifare_inchiesteedomande( xpath_queries )
{
    for( j=0; j<xpath_queries.length; j++ )
    {
        xpath_query = xpath_queries[j];
        console.log( "looking at " + xpath_query );
        // some xpath magic from mark pilgram's dive into greasemonkey
        var data = document.evaluate(xpath_query, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
        for(i=0; i<data.snapshotLength; i++)
        {
            node = data.snapshotItem(i);
            
            node.parentNode.removeChild(node);
        }
    }   
}

rimuoviciochefacciamoinvecedifare_inchiesteedomande( loalpubblica );
