$(document).ready(function(){  
$('a').regex("href", "^(http://)(?!(www\.)?rhymesayers\.com).*$").attr({
 		target: "_blank", 
		rel: "external",
    	title: "Opens in a new window"
  });

$('a').regex("href", "(\.mp3)$").attr("href", function(){
		console.log($(this).attr('href'));
		if($(this).attr("href").indexOf("download.php") == -1){
			if($(this).attr('href').indexOf('get.php') != -1){
				if($(this).attr('href').indexOf('/radio/get.php') != -1){
					return '/download.php?file=' + $(this).attr('href');
				}
			} else {
				return '/download.php?file=' + $(this).attr('href');
			}
		}
		
  });

$('a').regex("href", "^(get\.php)").attr("href", function(){
		return '/download.php?file=' + 'http://www.rhymesayers.com/radio/' + $(this).attr('href');
  });
});  
