// ==UserScript==
// @name	Audioscrobbler Artist Search Links
// @namespace	http://hublog.hubmed.org/files
// @description	Adds extra search links to Audioscrobbler artist pages
// @include	http://www.audioscrobbler.com/music/*
// ==/UserScript==

(function() {
  var b=new Array();
  b[0]=new Array('http://www.isohunt.com/torrents.php?ihq=', 'http://www.isohunt.com/favicon.ico');
  b[1]=new Array('http://oink.me.uk/browse.php?search=', 'http://oink.me.uk/favicon.ico');
  b[2]=new Array('http://www.indietorrents.com/browse.php?sfield=title&incldead=0&search=', 'http://www.indietorrents.com/favicon.ico');
  var artist=document.body.innerHTML.match(/Search for (.*?) at Google/)[1];
  for (i=0; i<b.length; i++){
    mainURL = b[i][0];
    imageURL = b[i][1];
    var nli=document.createElement('li');
    var na=document.createElement('a');
    na.setAttribute('href',mainURL+artist);
    var np=document.createElement('img');
    np.setAttribute('src',imageURL);
    np.setAttribute('height','16px');
    np.setAttribute('width','16px');
    na.appendChild(np);
    nli.appendChild(na);
    document.getElementById('submenu').appendChild(nli);
  }
})();

