(function($){
	jQuery.fn.autofill = function(options) {
		return this.each(function() {
      if ($(this).val() == $(this).attr('rel'))
        $(this).addClass('disabled');
      else
        $(this).removeClass('disabled');
      
      $(this).focus(function() {if ($(this).val() == $(this).attr('rel')) { $(this).val(''); $(this).removeClass('disabled');}});
      $(this).blur (function() {if ($(this).val() == '') { $(this).val($(this).attr('rel')); $(this).addClass('disabled');}});
      $(this).blur();

		});
	};
})(jQuery);

$(document).ready(function() {

	// Fix the a/img problem
        $('.autofill').autofill();
	$(".content img").each(function() {
		var parentTag = $(this).parent().get(0).tagName;
		if (parentTag == 'A') {
			$(this).parent().addClass('linkedImage');
		};
	});

});

