$.kv = $.kv || {};
$.extend($.kv, {
  prettyHeaderLink: function() {
  	$(".first-post h2 a").each(function(){
		  var title = $(this).html();
		  if (title) {
			  title = title.replace(/(\B[qQypfjg@\(\)\[\]\{\}\;\,\|])/g, '</b>$1<b>');
			  title = title.replace(/([34579j\,])/g, '</b>$1<b>');
			  $(this).html("<b>"+title+"</b>");
        $(this).css({"text-decoration":"none"});
		  }
	  });
  },
  prettyHeaderAmp: function() {
  	$("body:not([class]) .post h2").each(function(){
		  var title = $(this).html();
		  if (title) {
			  title = title.replace(/&amp;/g, '<i class="amp">&amp;</i>');
			  $(this).html(title);
		  }
	  });
  },
  prettyHeaderAmp: function() {
	  $("body:not([class]) .post h2").each(function(){
		  var title = $(this).html();
		  if (title) {
			  title = title.replace(/&amp;/g, '<i class="amp">&amp;</i>');
			  $(this).html(title);
		  }
	  });
  },
  contextHover: function() {
	  $("a").each(function() {
		  var a = $("a[href="+$(this).attr("href")+"]");
		  $(this).hover(
			  function() {a.addClass("hover");},
			  function() {a.removeClass("hover");}
		  );
	  });
  },
  IEwarning: function() {
    if($.browser.msie) {
        $("#top").prepend('<div class="iesux notice" style="position:relative;"><h2>Why does this site look like crap in internet explorer?</h2><p>This is my personal playground, and I\'m using CSS that has been available in other browsers for years. If Internet explorer can\'t keep up, that\'s their problem. In the mean time, you should <strong><a href="http://getfirefox.com">use a better browser</a> :)</strong></p></div>');
      }
  }
});

$(document).ready(function(){
	$.kv.contextHover();
	$.kv.prettyHeaderLink();
	$.kv.prettyHeaderAmp();
	//$.kv.IEwarning();
});

