/**
 * @abstract Link converter
 *
 * @author Justin Johnson (johnsonj) <justin@zebrakick.com>
 * @version 20081115 johnsonj
 *
 * @package zk.jackal.javascript.linkconverter
 */

$(function() {
	$('a.jackal-ad').each(function() {
		var rel     = this.getAttribute('rel'),
			matches = rel.match(/(jackal-ad-gateway:([^\s]+))/);

		if ( matches[2] ) {
			// Replace the href
			this.href = matches[2];
			// Clean out the rel
			this.setAttribute('rel', rel.replace(matches[1], ''));
		}
	});
});