
	var replyOpen = 0;
	
	function openReply(commentId, scrollToForm){
		
		if(scrollToForm){
			goToReply(commentId);
			return;
		}
		
		if(replyOpen != 0){
			$('replyComment_' + replyOpen).innerHTML = "";	
		}
		
		//cancel
		if(replyOpen == commentId){
			$('mainCommentForm').style.display = "";
			$('replyLink_' + commentId).innerHTML = "Reply";
			$('cellReply_' + commentId).style.lineHeight = "0px";
			replyOpen = 0;
			return;
		}
		
		var formHtml = $('mainCommentForm').innerHTML;
		
		formHtml = formHtml.replace(/ comment /gm, " reply ");
		
		$('replyComment_' + commentId).innerHTML = formHtml;
		$('replyLink_' + commentId).innerHTML = "Cancel";
		$('cellReply_' + commentId).style.lineHeight = "20px";
		replyOpen = commentId;

		$('mainCommentForm').style.display = "none";
		
		var element = YAHOO.util.Dom.getElementsByClassName('hiddenReply', null, "replyComment_" + commentId);
		
		element[0].value = commentId;
	
		
	}

	var submitted = false;
	function markSubmit(){
		if(submitted){
			return false;
		}
		
		submitted = true;
		return true;
	}
	
	function goToReply(commentId){
		
		location.href = "#commentForm";
		
		$('replyLink_' + commentId).innerHTML = "Cancel";
		
		replyOpen = commentId;
		
		var element =YAHOO.util.Dom.getElementsByClassName('hiddenReply');
		
		element[0].value = commentId;
		
	}
	
