// ==UserScript==
// @name           HideMyAss Cleanup
// @namespace      www.daddy.sk
// @description    Removes junk from top of the pages browsed through hidemyass web proxy; moves the link input to the bottom of the page.
// @include        *.hidemyass.com/index.php?*
// @include        *.cantbustme.com/surf.php?*
// ==/UserScript==

function xpath(query) {
    return document.evaluate(query, document, null,
        XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
}

var elements, singleElement;

// Elements to be removed
elements = xpath("//body/div[2] | //div[@class = 'nethead']");

GM_log("Found " + elements.snapshotLength + " element(s)");

// Link input form to be preserved
var form, center;
form = document.getElementById("nethead");
center = document.createElement("center");
center.appendChild(form);
document.body.appendChild(center);

for (var i = 0; i < elements.snapshotLength; i++) {
	singleElement = elements.snapshotItem(i);	
	singleElement.parentNode.removeChild( singleElement )
}

