var colors;
$(function(){
	
	/*	=Links
	--------------------------------------*/
	var bd = $('#bd'); //for speed
	/* external links */
	bd.find("a[@rel~='external']").click(function(){
		window.open($(this).attr("href"));
		return false;
	}).addClass('external');
	/* lightbox links */
	bd.find("a[@href$='.jpg'], a[@href$='.gif'], a[@href$='.png']").lightBox().each(function(){
		var a = $(this);
		if( a.children('img').length == 0 )
			a.addClass('pic');
		
	});
	/**
	 * XFN Links
	 * 
	 * Priority me, sweetheart, friend, colleague
	 * Then add met to the end of those.
	 * I'm not going to worry about "me" or "sweetheart" links
	 */
	var friend_links = bd.find("a[@rel~='friend']");
	var colleague_links = bd.find("a[@rel~='colleague'],a[@rel~='co-worker']").not(friend_links); 
	
	friend_links.each(function(){
		var link = $(this);
		if( link.attr('rel').indexOf('met') > -1 ) link.addClass('friend-met');
		else link.addClass('friend');
	});
	
	colleague_links.each(function(){
		var link = $(this);
		if( link.attr('rel').indexOf('met') > -1 ) link.addClass('colleague-met');
		else link.addClass('colleague-met');
	});
	/**
	 * Tags
	 */
	/*
	colors = ['blue','green','orange','pink','purple','red','yellow'];
	var i = colors.length - 1;
	do colors[i] = 'url(http://tr0y.com/wp/wp-content/themes/tr0y/img/ico/tag/' + colors[i] + '.png)'; while(i--);
	$('a[@rel=tag]').each(function(){ $(this).css('background-image',colors[Math.round((colors.length - 1)*Math.random())]); });
	*/
});