$(document).ready(function(){	
  $('#tabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
  
  $(".round").corner();
  
  $("#message h2").tweet({
    join_text: "auto",
    username: "sebastianj",
    count: 1,
    auto_join_text_default: "I said:", 
    auto_join_text_ed: "I",
    auto_join_text_ing: "I was",
    auto_join_text_reply: "I replied",
    auto_join_text_url: "I was checking out",
    loading_text: "Fetching latest tweet...",
    render: null
  });
  
  $("a.tt-flickr[href$=.jpg]").lightBox();
  $('a[@rel*=lightbox]').lightBox();
  
  if ($("#ieAlert").length > 0 && $(".hideWarning").length > 0) {
    $(".hideWarning").attr('href', 'javascript:');
    $(".hideWarning").click(function () {
		  $("#ieAlert").hide("blind", { direction: "vertical" }, 1000);
    });
  }
  
  if ($("#feedburnerEmailSubscriptionForm").length > 0) {
    $("#feedburnerEmailSubscriptionForm").submit(function () {
		  window.open('http://feedburner.google.com/fb/a/mailverify?uri=SebastianJohnssonCom', 'popupwindow', 'scrollbars=yes,width=550,height=520'); return true;
    });
  }
  
  var searchBar = $('#s');
  var searchBarValue = "Enter your search phrase";
	if (searchBar.length > 0) {
		searchBar.val(searchBarValue);
		
		searchBar.focus(function () {
		  if ($(this).val() == searchBarValue) { $(this).val(''); }
    });
    
    searchBar.blur(function () {
		  if ($(this).val() == '') { $(this).val(searchBarValue); }
    });
	}
	
	var emailSubscribeBox = $('.emailSubscribeTextbox');
  var emailSubscribeValue = "you@domain.com";
	if (emailSubscribeBox.length > 0) {
		emailSubscribeBox.val(emailSubscribeValue);
		
		emailSubscribeBox.focus(function () {
		  if ($(this).val() == emailSubscribeValue) { $(this).val(''); }
    });
    
    emailSubscribeBox.blur(function () {
		  if ($(this).val() == '') { $(this).val(emailSubscribeValue); }
    });
	} 
});