// ==UserScript==
// @name          SL vote link fix0r
// @namespace     http://markpasc.org/code/gm/
// @description   fix links in Second Life feature voting to not reload the whole frameset
// @include       http://secondlife.com/vote/*
// @exclude       http://secondlife.com/vote/sidebar.php
// ==/UserScript==

(function() {

    var result = document.evaluate(
        "//a[@target='_top']",
        document, null, XPathResult.ANY_TYPE, null);

    var links = new Array();
    var node;
    while(node = result.iterateNext()) {
        links.push(node);
    }

    for(var i in links) {
        node = links[i];
        node.removeAttribute('target');

        var href = node.getAttribute('href');
        href = href.replace(/index\.php/, 'get_feature.php');
        node.setAttribute('href', href);
    }

})();


