// search box input field clearing
$(document).ready(function(){	
	
	function searchBox (sb) {
	  var searchField = $("#searchform .field:input");
		
		searchField.focusin(function() {
			if($(this).val()==='SEARCH BY KEYWORD'){ //If the value is still the default, in this case, "Search"
				$(this).val('');//If it is, set it to blank
			}
		});
		
		searchField.blur(function(){//When the user tabs/clicks out of the input
			if($(this).val()===''){//If the value is blank (such as the user clicking in it and clicking out)...
				$(this).val('SEARCH BY KEYWORD'); //... set back to the original value
			}
		});
		
		$('#searchsubmit').click(function() {   
  			if( searchField.val() === 'SEARCH BY KEYWORD' ) 
    			searchField.val('');
		});		
		
	};
	searchBox ();
	
});

//set the class for home and archive pages
$(document).ready(function(){
	$("#post-list .post").addClass('home-post');
	$("#post-list .home-post").removeClass('post');
	$("#post-list .home-post:odd").addClass('odd');	
});

// to adjust the heights of the home page block so all are even

function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
						
		if(thisHeight > tallest) {
			tallest = thisHeight;
	}
	
	});
	group.height(tallest);
}
$(document).ready(function() {
	equalHeight($(".home-post .section"));
});
$(document).ready(function() {
	 
	 if ($('body').hasClass('blog')) {
        $("ul#nav li:first a").addClass("on");
    }

});
