// JavaScript Document

/*	Show/Hide Comments Form
/*----------------------------------------------------------*/
function toggleCommentForm(){
	$("#comment-form").slideToggle();	
}


/*	Add Comment to Post
/*----------------------------------------------------------*/
function addComment(){
	var author = $("#your_name").val();
	var email = $("#your_email").val();
	var comment = $("#your_comment").val();
	if(author == null || trim(author) == "" || email == null || trim(email) == "" || comment == null || trim(comment) == ""){
		alert("Please fill in all fields before posting your comment!");	
	}else{
		document.commentForm.submit();
	}
}


/*	Blog Search Paging
/*----------------------------------------------------------*/
function viewPage(num){
	$("#postlist").load("/includes/ajax/ajax_blogs.php", {page:num}, null);
}


/*	Toggle Full Post
/*----------------------------------------------------------*/
function showFullPost(id, show){
	if(show){
		$('#blogpost'+id+' .preview').slideUp('fast',function(){
			$('#blogpost'+id+' .full').slideDown('slow');
			$('#blogpost'+id+' .close-link').show();
		});
	}else{
		$('#blogpost'+id+' .full').slideUp('fast',function(){
			$('#blogpost'+id+' .preview').slideDown('slow');
			$('#blogpost'+id+' .close-link').hide();
		});
	}
}