/*
 jQuery(document).ready(function() {
	
	jQuery('#comments_content').hide();
	
	jQuery('#comments_click').click(function() {
		jQuery('#comments_content').toggle(0);
		return(false);
	});
	
	jQuery('#comments_click').click(function() {
		jQuery('.closed').toggle(0);
		return(false);
	});
	
});

*/

jQuery(document).ready(function(){	
	initAvis();
});
//----------------------------------
// initAvis()
//----------------------------------
function initAvis(){
	jQuery('.tx-comments-pi1 .tx-comments-comments').hide();
	
	if( (jQuery('.tx-comments-required-error').size()<=0) && (jQuery('.tx-comments-form-top-message').size()<=0)){
		//alert((jQuery('.tx-comments-required-error').size())
			jQuery('.tx-comments-pi1 .tx-comments-comment-form').hide();
	}	

	
	jQuery('.commentPage').css("float","left");
	jQuery('.commentPage').css("width","100%");
	
	jQuery('.tx-comments-pi1').css("float","left");
	jQuery('.tx-comments-pi1').css("width","100%");
	
	//jQuery('.commentReaction').css("float","left");

	jQuery('.commentPage').click(function(){
		//jQuery('.tx-comments-pi1 .tx-comments-comment-form').slideToggle("slow");
		
		jQuery('.tx-comments-pi1 .tx-comments-comments').slideToggle("slow", function(){
			jQuery('.tx-comments-pi1 .tx-comments-comment-form').slideToggle("slow");
		});
		
		
	}).mouseover(function(){
		jQuery(this).css("text-decoration","underline");
		jQuery(this).css("cursor","pointer");
	}).mouseout(function(){
		jQuery(this).css("text-decoration","none");
	});
	
	
	jQuery('#gotoCommentBtn').click(function(){
		jQuery('.tx-comments-pi1 .tx-comments-comments').slideToggle("slow", function(){
			jQuery('.tx-comments-pi1 .tx-comments-comment-form').slideToggle("slow");
		});
	});	
	

	
	/*jQuery('.commentReaction').click(function(){
		jQuery('.tx-comments-pi1 .tx-comments-comments').slideToggle("slow");
	}).mouseover(function(){
		jQuery(this).css("text-decoration","underline");
		jQuery(this).css("cursor","pointer");
	}).mouseout(function(){
		jQuery(this).css("text-decoration","none");
	});*/
}
