// ==UserScript==
// @name          Yahoo My Web 2.0
// @namespace     http://www.rhyley.org/gm/
// @include       http://myweb2.search.yahoo.com/*
// ==/UserScript==

/* make link descriptions not bold. it's just prettier. */

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('.yschnote strong { font-weight: normal ! important; }');


/* replace the redirects yahoo uses with the actual URL. */
/* not very nice, but again, it's just prettier.         */

window.allLinks = Array();
window.thisLink = Object();
allLinks = document.evaluate(
    "//a[contains(@href,'rds.yahoo.com')]",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
for (var i = 0; i < allLinks.snapshotLength; i++) {
    thisLink = allLinks.snapshotItem(i);
    blah = decodeURI(thisLink.href.substring(thisLink.href.indexOf('*-http')+2, thisLink.href.length));
    thisLink.href = blah.replace("%3A", ":");
}
