$(document).ready(function() {
  $(".directLink").fancybox({
  	'hideOnContentClick': false
  });
});

function updateFriendStatus(user_id, friend_id, friend_status) {
  if($('#startFollowing_' + friend_id).css('display') == "none") {
     $('#stopFollowing_' + friend_id + " a").html('No longer following')
     $('#stopFollowing_' + friend_id + " a").removeAttr('onclick')
   } else {
     $('#startFollowing_' + friend_id + " a").html('<img src="/images/icon-tick.gif"> Now Following!')
     $('#startFollowing_' + friend_id + " a").removeAttr('onclick')
   }
  
  $.ajax({
     type: "POST",
     url: "/users/" + user_id + "/" + friend_status,
     data: "friend_id=" + friend_id,
     dataType: "json",
     success: function(msg){
       if(msg.status == 'success') {
       } else { }
     }
   });
}

// Sam's janky JS! Not Mike's. Sorry.
function highlight(field) {
	field.focus();
	field.select();
}