/*

Author: Matt Mayers	http://mattmayers.com/
Update by Garou http://custom.simplemachines.org/mods/index.php?mod=1633

*/

var J = jQuery.noConflict();

function wowheadLinks(){

	J('.wowhead').each(function(){

		var el = J(this)

		J.ajax({

			type: "GET",

			url: el.attr('href'),

			dataType: "xml",

			success: function(data){

				el.attr('href',J('link',data).text())

				el.addClass('q'+J('quality',data).attr('id'))

				el.text('[' + J('name', data).text() + ']');

			}

		})

	})

}

J(document).ready(wowheadLinks)