Event.observe(window, 'load', page_loaded_set_show_context);							

function page_loaded_set_show_context(evt) {
	var commentLinks = document.getElementsByClassName("comment");
	for(var t=0; t<commentLinks.length; t++) {
		commentLinks[t].onclick=show_comment_section;
		}
}

function show_comment_section() {
	var idNum = this.id.substring(this.id.indexOf('_')+1,this.id.length);	
	$('commentSection_'+idNum).style.display = "block";	
	$('AddACommentLink_'+idNum).onclick = hide_comment_section;	
	}	
	
function hide_comment_section()	 {
	var idNum = this.id.substring(this.id.indexOf('_')+1,this.id.length);	
	$('commentSection_'+idNum).style.display = "none";		
	$('AddACommentLink_'+idNum).onclick = show_comment_section;	
	}


function toggle_recommend_id(id) {

$$('.recommendAuthorSection').each( function(name,index) {
if ($(name).visible())
Effect.SlideUp($(name), { duration: 0.8 });
});

	el=$('recommendAuthorSection'+id);	
	if (!el.visible()) {
	Effect.BlindDown(el, { duration: 0.8 });
	} else {
	Effect.SlideUp(el, { duration: 0.8 });
	}
	return false;
	}


function toggle_recommend(id) {
	el=$('recommendAuthorSection'+id);	
	if (!el.visible()) {
	Effect.BlindDown(el, { duration: 0.8 });
	} else {
	Effect.SlideUp(el, { duration: 0.8 });
	}
	return false;
	}

