commentHandler = function(){
	$comments 	= new Array();
	return {
		init : function(){
			$T_ch 		= this;
		},
		renderComments : function(_str,_render_obj){
			var response 	= eval("("+_str+")");
			var linkset		= '';
			for(i in response.comments){
				$comments.push({url:response.comments[i].url,user:response.comments[i].user,quote:response.comments[i].quote,article_title:response.comments[i].article_title});
				linkcounter = i;linkcounter++;						
				linkset += '<a href="'+response.comments[i].url+'" onclick="YAHOO.newsLP.blogComments.showComment('+i+');return false;">'+linkcounter+'</a>';}
			$E.onAvailable(_render_obj.ready_container,function(){
				$(_render_obj.ready_container).innerHTML = linkset;
				var links		= $(_render_obj.ready_container).getElementsByTagName('A');
				for(i =0;i<links.length;i++){
					$comments[i].xpos = $D.getX(links[i]);}
				$T_ch.showComment(0);	
			});
		},
		showComment : function(_commentIndex){
			els			= $('commentitems').getElementsByTagName('A');	
			currComment = els[_commentIndex];
						
			for(i=0;i < els.length;i++){ els[i].className = ''; }
			els[_commentIndex].className = 'activeComment';
			$('commentreader').getElementsByTagName('SPAN')[0].innerHTML = $comments[_commentIndex].user;
			$('commentbody').innerHTML = $comments[_commentIndex].quote+'<img src="/includes/gfx/comments/comment_quoteright.gif" />';
			$('commentsource').getElementsByTagName('A')[0].href=$comments[_commentIndex].url;
			$('commentsource').getElementsByTagName('A')[0].innerHTML = $comments[_commentIndex].article_title;
			$D.setX($('commentpoint'),$comments[_commentIndex].xpos-113);
			currComment.blur();
			currComment.className = 'activeComment';
			
		},
		renderFail : function(_str,_render_obj){
			$D.setStyle(_render_obj.htmlobj,'display','none');
		}
	}	
}();
