jQuery.fn.hint = function () {
  return this.each(function (){
    // get jQuery version of 'this'
    var t = jQuery(this); 
    // get it once since it won't change
    var title = t.attr('title'); 
    // only apply logic if the element has the attribute
    if (title) { 
      // on blur, set value to title attr if text is blank
      t.blur(function (){
        if (t.val() == '') {
          t.val(title);
          t.addClass('blur');
        }
      });
      // on focus, set value to blank if current value 
      // matches title attr
      t.focus(function (){
        if (t.val() == title) {
          t.val('');
          t.removeClass('blur');
        }
      });

      // clear the pre-defined text when form is submitted
      t.parents('form:first()').submit(function(){
          if (t.val() == title) {
              t.val('');
              t.removeClass('blur');
          }
      });

      // now change all inputs to title
      t.blur();
    }
  });
}
$(function() {
	$(".hint").hint();
	$(".caption").each(function(){
		$(this).after("<span class='caption' style='width:" + $(this).attr("width") + "px;'>" + $(this).attr("alt") + "</span>");
	});
	$(".dropshadow").wrap("<div class='wrap1'><div class='wrap2'><div class='wrap3'>" + "</div></div></div>");
	$("a[rel='external'],a[rel='non-html']").attr("target","_blank");
	$("#content h1").append("<span class='circa'></span>");
});
