$(document).ready(function() {
    // Don't Cache Ajax
    $.ajaxSetup ({
    	cache: false
    });  
    
    // Ajax for Recommended entries
	$("a.recommend").live("click",function(){
		$("div#recommend_save").load(this.href);
		$(".recommend_count").load(location.href+" .recommend_count");
		return false;
	});
	
	$("a.recommend_footer").live("click",function(){
		$("div#recommend_save_footer").load(this.href);
		$(".recommend_count_footer").load(location.href+" .recommend_count_count");
		return false;
	});
	
	$("a.recommend_blog").live("click",function(){
		$("div.recommend_save").load(this.href);
		return false;
	});

	// Inline Field Labels
	$('input[title]').each(function() {
	  if($(this).val() === '') {
	   $(this).val($(this).attr('title')); 
	  }
	  
	  $(this).focus(function() {
	   if($(this).val() === $(this).attr('title')) {
	    $(this).val('').addClass('focused'); 
	   }
	  });
	  
	  $(this).blur(function() {
	   if($(this).val() === '') {
	    $(this).val($(this).attr('title')).removeClass('focused'); 
	   }
	  });
	 });
	 
	 // Print Article
	 $("a.print").click(function() {
	 	window.print();
	 	return false;
	 });
	
	
	// Gallery Images
	
	//Submit Search
	$("#search-community").change(function() {
	    document.profile_search_form.submit();
	});
	
	   // Display Comment Form
	   $("a.post_comment").click(function() {
	   	$("#comment_form_container").slideDown("fast");
	   	return false;
	   });
});
