/* $Id: ajax_blog_entries_functions.js,v 1.1 2009/04/28 15:16:48 theresa Exp $ */

function get_blog_comments(my_link,the_div, the_blog_id, the_member_id, the_blogger_id) {
	//Make sure the correct header type is sent.
	YAHOO.util.Connect.setDefaultPostHeader( false );
 	YAHOO.util.Connect.initHeader( "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8", true );
	
	url = "/async/requests/ajax_requests.php?action=getBlogComments&blog_id=" + the_blog_id + "&member_id=" + the_member_id + "&blogger_id=" + the_blogger_id;
	
	var handle_success = function(o) {
		o.argument.my_div.innerHTML = o.responseText;
		o.argument.my_link.innerHTML = 'Collapse Comments';
		o.argument.my_link.onclick = function(){
			collapseCommentSection(my_link.id, the_div.id, the_blog_id, the_member_id, the_blogger_id);
			return false;
		};
	}
	
	var handle_failure = function(o) {
		alert(o.responseText);
	}
	
	var callback = {
		success : handle_success,
		failure : handle_failure,
		argument : { my_link: my_link, my_div : the_div, blog_id : the_blog_id, member_id : the_member_id, blogger_id : the_blogger_id }
	};
	
	var request = YAHOO.util.Connect.asyncRequest('GET', url, callback); 
	
}