<%
	import org.exoplatform.faq.service.FileAttachment;
	import org.exoplatform.faq.service.Category;
	import org.exoplatform.faq.service.Question;
	import org.exoplatform.faq.service.Answer;
	import org.exoplatform.faq.service.Comment;
	import org.exoplatform.faq.webui.ValidatorDataInput;
	import org.exoplatform.faq.webui.FAQUtils;
	import org.exoplatform.web.application.JavascriptManager;

	String compId = uicomponent.getId(); 
	def rcontext = _ctx.getRequestContext();
	JavascriptManager jsmanager = rcontext.getJavascriptManager();
	jsmanager.importJavascript('eXo.faq.UIAnswersPortlet','/faq/javascript/');
	jsmanager.addOnResizeJavascript('eXo.faq.UIAnswersPortlet.reSizeImages');
	jsmanager.addJavascript("eXo.faq.UIAnswersPortlet.controlWorkSpace();");
	//jsmanager.addJavascript('eXo.webui.UIRightClickPopupMenu.disableContextMenu("'+compId+'");');
	jsmanager.addJavascript('eXo.faq.UIAnswersPortlet.initContextMenu("'+compId+'") ;') ;
	jsmanager.addJavascript("eXo.faq.UIAnswersPortlet.checkCustomView('" + uicomponent.isNotInSpace() + "', '" + _ctx.appRes("UIQuestions.label.HileLeftPanels") + "', '" + _ctx.appRes("UIQuestions.label.ShowLeftPanels") + "');");
	jsmanager.addCustomizedOnLoadScript('eXo.faq.UIAnswersPortlet.loadActionScroll();');
	jsmanager.addJavascript('eXo.faq.UIAnswersPortlet.updateContainersHeight();') ;
	String cateId = uicomponent.getCategoryId();
	uicomponent.setIsModerators(); //reset permission
	boolean canEditQuestion = uicomponent.getCanEditQuestion();
	boolean isViewRootCate = uicomponent.isViewRootCate;
%>
<div class="UIQuestions" id="$uicomponent.id" oncontextmenu="return false">
	<div class="AnswerToolbar" style="float:left; width:100%;">
		<div class="LeftBar">
			<div class="RightBar">
				<div class="CenterBar">
					<table>
						<tbody>
							<tr>
								<td class="ControlButtonContainer">
									<!-- ================== CustomView action ====================== -->
									<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this)" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this)"	class="DefaultStyle FAQBar ControlButton">
										<div style="cursor:pointer" class="SeparatorLine" id="FAQTitlePanels" title="<%=_ctx.appRes("UIQuestions.label.HileLeftPanels")%>" onclick="eXo.faq.UIAnswersPortlet.changeCustomView('true', '<%=_ctx.appRes("UIQuestions.label.HileLeftPanels")%>', '<%=_ctx.appRes("UIQuestions.label.ShowLeftPanels")%>')">
											<div class="LeftOverButton">
												<div class="RightOverButton">
													<div class="CenterOverButton">
														<div class="Icon FAQCustomView" id = "FAQCustomView">
															<span></span>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
									
									<%
									if(uicomponent.faqSetting_.isEnableAutomaticRSS()){
									 	String linkRss = uicomponent.getRSSLink() ;
									%>
										<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this)" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this)" class="DefaultStyle FAQBar ControlButton">
											<div class="SeparatorLine">
												<div class="LeftOverButton">
													<div class="RightOverButton">
														<div class="CenterOverButton">
															<div class="Icon FAQRSS">
																<a href="$linkRss" target="_blank"><%=_ctx.appRes("UIQuestions.action.RSS"); %></a>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
								<%
								}
								if(canEditQuestion) {
								%>
									<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this); eXo.faq.UIAnswersPortlet.setCheckEvent(true); eXo.faq.UIAnswersPortlet.checkAction();" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this);"	class="DefaultStyle FAQBar ControlButton">
										<div class="SeparatorLine">
											<div class="LeftOverButton">
												<div class="RightOverButton">
													<div class="CenterOverButton">
														<div class="Icon CategoryManager">
															<div class="DownArrow1Icon" style="padding-right:16px;" onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');" >
																<a href="javascript:void(0);"><%=_ctx.appRes("UIQuestions.action.ManageCategory"); %></a>
															</div>
														</div>
													</div>
												</div>
											</div>
											
											<!-- ================================================= Begin popup menu ================================ -->
											<div class="UIFAQPopupCategory" id="FAQCategroManager" style="display:none;" onmouseover="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager')" onmouseout="eXo.faq.UIAnswersPortlet.setCheckEvent(true); eXo.faq.UIAnswersPortlet.checkAction();">
											<div class="UIRightClickPopupMenu UIContextMenuContainer" style="display:block; width:150px; min-width:150px;">
											
												<div class="MiddleLeftRightClickPopupMenu">
													<div class="MiddleRightRightClickPopupMenu">
														<div class="UIRightPopupMenuContainer" style="margin:0px; padding:3px 0;">
												
													<%
														String[] actionTollbar = uicomponent.getMenuCateManager();
														for(String action in actionTollbar) {
															if(action.equals("DeleteCategory") && uicomponent.isCategoryHome()) continue; 
													%>
															<div onmousedown="<%=uicomponent.event(action, cateId);%>" class="MenuItem">
																<a class="IconItem $action" href="javascript:void(0);"><%=_ctx.appRes("UIQuestions.action." + action)%></a>
															</div>
													<%
														}%>
																	
														</div>
													</div>
												</div>
											
											</div>
										</div>
									<!-- ================================================= End popup menu ================================ -->
									</div>
								</div>
								<%
								}
								if(canEditQuestion) {
									String[] actionTollbar = uicomponent.getActionTollbar();
									for(String action in actionTollbar) {
								%>
										<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this)" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this)"	class="DefaultStyle FAQBar ControlButton">
											<div onclick="<%=uicomponent.event(action, cateId);%>" class="SeparatorLine">
												<div class="LeftOverButton">
													<div class="RightOverButton">
														<div class="CenterOverButton">
															<div class="Icon $action">
																<a href="javascript:void(0);"><%=_ctx.appRes("UIQuestions.action." + action);%></a>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
								<%
									}
								} else {
									if(uicomponent.isAddQuestion()) {
								%>
										<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this)" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this)"	class="DefaultStyle FAQBar ControlButton">
											<div onclick="<%=uicomponent.event("AddNewQuestion", cateId);%>" class="SeparatorLine">
												<div class="LeftOverButton">
													<div class="RightOverButton">
														<div class="CenterOverButton">
															<div class="Icon AddNewQuestion">
																<a href="javascript:void(0);"><%=_ctx.appRes("UIQuestions.action.AddQuestion")%></a>
															</div>
														</div>
													</div>
												</div>
											</div>
										</div>
								<%}
								}%>
							<%String currentUser = FAQUtils.getCurrentUser() ; 
								if(currentUser != null && currentUser.trim().length() > 0) {
									String actionSetting = uicomponent.event("Setting");
							%>
									<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this)" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this)"	 class="DefaultStyle FAQBar ControlButton">
										<div onclick="$actionSetting" class="SeparatorLine">
											<div class="LeftOverButton">
												<div class="RightOverButton">
													<div class="CenterOverButton">
														<div class="Icon Setting">
															<a href="javascript:void(0);"><%=_ctx.appRes("UIQuestions.action.Settings")%></a>
														</div>
													</div>
												</div>
											</div>
										</div>
									</div>
								<% } %>
								<div onmouseout="eXo.faq.UIAnswersPortlet.OverButton(this)" onmouseover="eXo.faq.UIAnswersPortlet.OverButton(this)"	 class="DefaultStyle FAQBar ControlButton">
									<!--<div onclick="eXo.faq.UIAnswersPortlet.printAll(this)">-->
									<div onclick="<%=uicomponent.event("PrintAllQuestion")%>" class="SeparatorLine">
										<div class="LeftOverButton">
											<div class="RightOverButton">
												<div class="CenterOverButton">
													<div class="Icon Print">
														<a href="javascript:void(0);"><%=_ctx.appRes("UIQuestions.action.Print")%></a>
													</div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="ScrollButtons" style="width:35px;_width:50px;">
									<div title="Previous">
										<div title="Next"><span></span></div>
									</div>
								</div>
								<div style="clear:both;"><span></span></div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	<div style="clear:left;"><span></span></div>
	<div class="AnswersContainer" id="AnswersViewContent">
		<div class="FAQContent">
<!-- ===================================================== View question ======================================================	-->
			<%
				String[] questionActions = uicomponent.getActionQuestion();
				
				Question[] listQuestion = uicomponent.getListQuestion();
				String questionContent = new String();
				int questionIndex = 0 ;
				
				String linkQuestion = "" ;
				
				for(question in listQuestion) {
					String qId = question.getPath();
					uicomponent.setLink(qId, uicomponent.url("ViewQuestion", qId));
					linkQuestion=uicomponent.event("OpenQuestion", qId);
					String questionIcon = "" ;
					String colorViewQuestion = "";
					if(!question.isActivated() || !question.isApproved()) colorViewQuestion = "gray";
					if(question.getAnswers() != null && question.getAnswers().length > 0) {
						questionIcon = "Question" ;
					} else {
						questionIcon = "NotResponse" ;
					}
					
					if(!uicomponent.getQuestionView().equals(qId)){
						questionContent = question.getQuestion();
			%>
						<div class="QuestionContainer" id="$qId" ctxMenuId="UIPopupQuestion$questionIndex" oncontextmenu="return false;">
			
<!---- style for Questions ----->
							<div class="NormalQuest ClearFix">
								<div class="LeftCon ClearFix">
									<a class="BoxNum">
										<p><%= uicomponent.getVoteScore(question); %></p>
										<h4><%= _ctx.appRes("UIQuestions.label.score"); %></h4>
									</a>
									<a class="BoxNum">
										<p><%= question.getNumberOfPublicAnswers(); %></p>
										<h4><%= _ctx.appRes("UIQuestions.label.answers"); %></h4>
									</a>
								</div>
								<div class="RightCon">
								<%
								String titleQuestion = "" ;
								if(questionContent.length() > 140) {
									titleQuestion = questionContent ;
									questionContent = FAQUtils.getSubString(questionContent, 140);
								}
								%>
									<a class="Questions" href="$linkQuestion">$questionContent</a>
									<div class="ClearFix">
									<%if(!question.isApproved()) {%>
									<div class="WarningCon"><p class="Warning"><%=_ctx.appRes("UIQuestions.label.QuestionIsNotApproved")%></p></div>									
									<%}%>
									<%
									String authorOfLastAct = question.getAuthorOfLastActivity();
									if (authorOfLastAct != null && !authorOfLastAct.isEmpty()) {%>
																	
										<p class="Name"><span><%=_ctx.appRes("UIQuestions.label.By");%>&nbsp;</span>
										<a style="cursor:pointer" title="<%=_ctx.appRes("UIQuestionsInfo.title.ViewUserProfile")%>" href="<%=uicomponent.event("ViewUserProfile", authorOfLastAct)%>"><%= FAQUtils.getFullName(authorOfLastAct);%></a> | <%= uicomponent.calculateTimeMessageOfLastActivity(question.getTimeOfLastActivity());%></p>
										<% } %>
									</div>
								</div>
							</div>
<!-- 
							<div class="HighlightQuest ClearFix">
								<div class="LeftCon ClearFix">
									<a class="BoxNum">
										<p>2</p>
										<h4>score</h4>
									</a>
									<a class="BoxNum">
										<p>3</p>
										<h4>answers</h4>
									</a>
								</div>
								<div class="RightCon">
									<p class="Questions">$questionContent</p>
									<div class="ClearFix">
										<div class="WarningCon"><p class="Warning">this question is pending for approval</p></div>
										<p class="Name">By <a>John Smith</a> | 2 minutes ago</p>
									</div>
								</div>
							</div>
-->
<!---- End new style for Questions ----->	
							<div style="width:85%; _width:80%; float:left;">
									<!-- action of this question -->
									<div class="UIFAQPopupCategory" id="UIPopupQuestion$questionIndex" style="display:none;">
										<div class="UIRightClickPopupMenu UIContextMenuContainer" style="display:block;">
												<div class="MiddleLeftRightClickPopupMenu">
													<div class="MiddleRightRightClickPopupMenu">
														<div class="UIRightPopupMenuContainer"	style="margin:0px; border:solid 1px #f6f6f6">														
															<%
																String iconView = "" ;
																for(viewAction in questionActions) {			
																	if(viewAction.equals("CommentQuestion") && !question.isApproved() && !uicomponent.canEditQuestion) continue ;														
																	if(!viewAction.equals("MoveQuestion") && !viewAction.equals("ResponseQuestion"))
																		iconView = viewAction.replace("Question", "");
																	else
																		iconView = viewAction ;
																	String linkView = "";
																	
																	String lockFunction = "" ;
																	if(viewAction.equals("SendQuestion") && (!question.isApproved() || !question.isActivated())) {
																		if(canEditQuestion){
																			linkView = uicomponent.event(viewAction, qId+"/true");
																		} else {
																			linkView = "javaScript:alert('" + _ctx.appRes("UIQuestions.label.CanSendToFriend") + "');" ;
																			lockFunction = "LockFunction" ;
																		}
																	} else {
																		linkView = uicomponent.event(viewAction, qId);
																	}
																	String itemLabelView = _ctx.appRes("UIQuestions.action." + viewAction);
															%>
																	<div class="MenuItem $lockFunction">
																		<a class="IconItem $iconView" href="$linkView">$itemLabelView</a>
																	</div>																
															<%}%>
															
															 
															<%if(uicomponent.currentUser_ != null) {
																	if(!canEditQuestion && uicomponent.currentUser_.equals(question.getAuthor())){
																		String itemLabelView = _ctx.appRes("UIQuestions.action.EditQuestion");
																		String linkView = uicomponent.event("EditQuestion", qId);
																	%>	
																		<div class="MenuItem">
																			<a class="IconItem Edit" href="$linkView">$itemLabelView</a>
																		</div>
																	<%	
																	}
																	if(uicomponent.isDiscussForum()) {
																		String pathDiscuss = question.getTopicIdDiscuss();
																		if(pathDiscuss == null || pathDiscuss.length() <= 0){
															%>
																		<div class="MenuItem">
																			<div title="<%=_ctx.appRes("UIQuestions.title.DiscussForum");%>">
																				<a class="IconItem DiscussForum" href="javascript:void(0);" onclick="<%=uicomponent.event("DiscussForum", question.getPath())%>"><%= _ctx.appRes("UIQuestions.title.DiscussForum"); %></a>
																			</div>
																		</div>
															<%	
																		} 
																	}
																} 
																if(uicomponent.isDiscussForum()) {
																	String topicIdDiscuss = question.getTopicIdDiscuss();
																	if(topicIdDiscuss != null && topicIdDiscuss.length() > 0){
																		String link = FAQUtils.getLinkDiscuss(topicIdDiscuss);
																		if(uicomponent.discussId != null && uicomponent.discussId.length() > 0){
																			if(topicIdDiscuss.equals(uicomponent.discussId)) {
																				jsmanager.addJavascript("eXo.faq.UIAnswersPortlet.openDiscussLink('"+link+"');");
																				uicomponent.discussId = "";
																			}
																		}
															%>
																		<div class="MenuItem">
																			<a class="IconItem DiscussForum" onmousedown="window.open('$link'); return false;" style="display:block"><%= _ctx.appRes("UIQuestions.title.DiscussForum"); %></a>
																		</div>
															<%	} 
																} 
															%>
														</div>
													</div>
												</div>
										</div>
									</div>
									<!-- finish action of this question -->
									
								</div>
							<div style="clear:left;"><span></span></div>
		
						
						</div>
						
						
				<!-- ============================================== View Question which is selected ===================================== -->
				<%} else {
						String[] listQuestLanguage = uicomponent.getQuestionLangauges(question.getPath());
						questionContent = uicomponent.getQuestionContent();
						String responseBy = "..." ;
						String date = "..." ;
						//if(question.getResponses() != null && question.getResponses().trim().length() > 0) {
						//	responseBy = question.getResponseBy();
						//}
					%>					
						<div class="QuestionSelect" style="_width:100%;">
							<div class="DecoratorTL">
								<div class="DecoratorTR">
									<div class="DecoratorTC"><span></span></div>
								</div>
							</div>
							<div class="DecoratorML">
								<div class="DecoratorMR">
									<div class="DecoratorMC">
									
										<div class="QuestionContainer" id="$qId">
											<table style="_width:98%;">
												<tr>
												<% if(uicomponent.viewAuthorInfor || uicomponent.faqSetting_.isEnableViewAvatar()){ %>
													<td style="width:140px; height:100px;">
														<div class="ProfileContainer">
														<%
															if(uicomponent.faqSetting_.isEnableViewAvatar()) {
														%>				
															<div class="AvatarContainer">
																<img class="FAQAvatar ImgAvatarBorder" src="<%=uicomponent.getAvatarUrl(question.getAuthor())%>" alt="Avatar"/>
															</div>
														<%}%>
														<!-- ========================================= view author's infor ================================ -->
														<%
															if(uicomponent.viewAuthorInfor){
																String email = question.getEmail();
																
														%>
															<div class="AuthorInfor" style="text-align:center;">
																<a style="cursor:pointer" title="<%=_ctx.appRes("UIQuestionsInfo.title.ViewUserProfile")%>" href="<%=uicomponent.event("ViewUserProfile", question.getAuthor())%>">
																	<span class="UserName"><%=FAQUtils.getFullName(question.getAuthor())%></span>
																</a>
																<span title="$email"><%=FAQUtils.getSubString(email, 20)%></span>
															</div>
														<%}%>
														</div>
													</td>
												<%}%>
													<td>
														<table>
															<tbody>
																<tr>
																	<td>
																		<!-- Action -->
																		<table class="DisablePrint">
																			<tr>
																				<!-- action translation question -->
																				<td style="white-space:nowrap;font-weight:bold;text-align:right;padding-left:5px;">
																					<%
																						int countLanguage = 2;
																						for(String quesLanguage in listQuestLanguage) {
																							String linkView = uicomponent.event("ChangeLanguage", quesLanguage);
																							String color = "#914ab6";
																							if(quesLanguage.equals(uicomponent.language_)){
																								continue;
																							}
																					%>
																							<a style="line-height:20px;color:$color;" href="$linkView">$quesLanguage</a>
																					<%	if(countLanguage < listQuestLanguage.length){%>
																								 |
																						<%} else {%>
																								&nbsp;
																						<%}
																							countLanguage ++;
																						}
																					%>
																				</td>
																				<!-- Action back page -->
																				<%
																				String backPath = uicomponent.getBackPath() ;
																				if(backPath != null && backPath.trim().length() > 0) {
																					String link = uicomponent.event("ViewQuestion",backPath);
																				%>
																					<td style="width:25px; margin-left:10px;">
																						<div onclick="$link" title="<%=_ctx.appRes("UIQuestions.action.Back")%>" style="cursor:pointer">
																							<div class="BackPageFAq"><span></span></div>
																						</div>
																					</td>
																				<%}%>
																				<!-- action print question -->
																				<td style="width:25px">
																					<a onclick="javaScript:eXo.faq.UIAnswersPortlet.printPreview(this);"
																							title="<%=_ctx.appRes("UIQuestions.action.PrintQuestion")%>" style="cursor:pointer">
																						<div class="PrintScrintFAQ"><span></span></div>
																					</a>
																				</td>
																			<%if(uicomponent.currentUser_ != null) {
																					if(canEditQuestion || uicomponent.currentUser_.equals(question.getAuthor())){
																			%>
																				<td style="width:22px">
																					<a onclick="<%=uicomponent.event("EditQuestion", qId);%>" title="<%=_ctx.appRes("UIQuestions.action.EditQuestion")%>" style="cursor:pointer">
																						<div class="Edit" style="width:20px; height:22px; margin-left:3px;"><span></span></div>
																					</a>
																				</td>
																				<td style="width:22px">
																					<a onclick="<%=uicomponent.event("DeleteQuestion", qId);%>" title="<%=_ctx.appRes("UIQuestions.action.DeleteQuestion")%>" style="cursor:pointer">
																						<div class="Delete" style="width:20px; height:22px; margin-left:3px;"><span></span></div>
																					</a>
																				</td>
																				<td style="width:22px" class="DisablePrint">
																					<a onclick="<%=uicomponent.event("MoveQuestion", qId);%>" title="<%=_ctx.appRes("UIQuestions.action.MoveQuestion")%>" style="cursor:pointer">
																						<div class="MoveQuestion" style="width:20px; height:22px; margin-left:3px;"><span></span></div>
																					</a>
																				</td>
																			<%	}
																				} 
																			%>
																				<!-- action send mail for frend -->
																				<td style="width:25px">
																					<%
																					String SendToFriend = "SendToFriend";
																					if((!question.isApproved() || !question.isActivated())){
																						if(canEditQuestion) {
																							link = uicomponent.event("SendQuestion",qId+"/true");
																						} else {
																							link = "javaScript:alert('" + _ctx.appRes("UIQuestions.label.CanSendToFriend") + "');" ;
																							SendToFriend = "LockSendToFriend" ;
																						}
																					} else {
																						link = uicomponent.event("SendQuestion",qId);
																					}
																					%>
																					<a href="$link" title="<%=_ctx.appRes("UIQuestions.action.SendQuestion")%>" style="cursor:pointer">
																						<div class="$SendToFriend"><span></span></div>
																					</a>																					
																				</td>																		
																				<!-- action Discuss -->
																			<%
																				if(uicomponent.currentUser_ != null) {																						
																					if(uicomponent.isDiscussForum()) {
																						String topicIdDiscuss = question.getTopicIdDiscuss();
																						if(topicIdDiscuss == null || topicIdDiscuss.length() <= 0){
																			%>
																				<td style="width:25px">
																					<a href="javascript:void(0);" onclick="<%=uicomponent.event("DiscussForum", question.getPath())%>" title="<%=_ctx.appRes("UIQuestions.title.DiscussForum");%>">
																						<div class="DiscussForum"><span></span></div>
																					</a>
																				</td>
																			<%		} else {
																						String link = FAQUtils.getLinkDiscuss(topicIdDiscuss);
																						if(uicomponent.discussId != null && uicomponent.discussId.length() > 0){
																							if(topicIdDiscuss.equals(uicomponent.discussId)) {
																								jsmanager.addJavascript("eXo.faq.UIAnswersPortlet.openDiscussLink('"+link+"');");
																								uicomponent.discussId = "";
																							}
																						}
																			%>
																				<td style="width:25px">
																					<div onclick="window.open('$link'); return false;" title="<%= _ctx.appRes("UIQuestions.title.DiscussForum"); %>">
																						<div class="MenuItem DiscussForum" style="margin-left:0px"><span></span></div>
																					</div>
																				</td>
																			<%		}
																					}
																				} %>
																			</tr>
																		</table>
																		<div style="clear:left;"><span></span></div>
																		<%
																		if(uicomponent.faqSetting_.isEnanbleVotesAndComments()){
																		%>
																			<!-- =========================== Vote result ========================== -->
																			<table	style="width:150px; float:right;">
																				<tr>
																					<td>
																						<% 
																						int markVote =(Integer) question.getMarkVote();
																						double sodu = question.getMarkVote() - markVote;
																						%>
																						<div class="RatingInfoContainer">
																							<div class="OptionsContainer">
																							<%
																								if(uicomponent.currentUser_ == null || 
																										(uicomponent.currentUser_ != null && !uicomponent.canVote(question))){
																										onclick = "javaScrip:void(0);";
																										titleMark = "";
																										if(uicomponent.currentUser_ != null && question.isApproved() || uicomponent.canEditQuestion) {
																											onclick = uicomponent.event("UnVoteQuestion",question.getPath());
																											titleMark = _ctx.appRes("UIQuestions.action.UnVoteQuestion");
																										}
																								%>
																									<div onclick="$onclick" title="$titleMark" style="cursor:pointer;">
																										<%
																										for(int mark = 0; mark < 5; mark ++){
																											if(mark < markVote){%>
																												<div class="OverVote"><span></span></div>
																										<%} else if (mark > markVote){%>
																												<div class="RatedVote"><span></span></div>
																										<%} else{
																												if(sodu < 0.3){%>
																													<div class="RatedVote"><span></span></div>
																											<%} else if (sodu > 0.7){%>
																													<div class="OverVote"><span></span></div>
																											<%} else {%>
																													<div class="HaftVote"><span></span></div>
																											<%}
																											}
																										}%>
																									</div>
																							<% } else { %>
																									<div id="faqVoteSpace" class="faqVoteSpace" onmouseover="eXo.faq.UIAnswersPortlet.viewTitle('faqVoteQuestion');eXo.faq.UIAnswersPortlet.hiddenTitle('faqMarkVoteSpace'); " 
																																					onmouseout="eXo.faq.UIAnswersPortlet.viewTitle('faqMarkVoteSpace');eXo.faq.UIAnswersPortlet.hiddenTitle('faqVoteQuestion');">
																										<div id="faqMarkVoteSpace" style="display:block;">
																										<%String classNameForStar = "";
																											for(int mark = 0; mark < 5; mark ++){
																												if(mark < markVote){
																													classNameForStar = "OverVote";
																													
																												} else if (mark > markVote){
																													classNameForStar = "RatedVote";
																												} else{
																													if(sodu < 0.3){
																														classNameForStar = "RatedVote";
																													} else if (sodu > 0.7){
																														classNameForStar = "OverVote";
																													} else {
																														classNameForStar = "HaftVote";
																													}
																												}%>
																												<div class="$classNameForStar"><span></span></div>
																										<%}%>
																										</div>
																										
																											<%
																											if (question.isApproved() || uicomponent.canEditQuestion) {
																											%>
																											<div id="faqVoteQuestion" style="display:none;" onmouseout="eXo.faq.UIAnswersPortlet.changeStarForVoteQuestion('-1', 'FAQHomeStarVote')" title="<%=_ctx.appRes("UIQuestions.action.VoteQuestion")%>">
																											<%
																												for(int i = 0; i < 5; i ++) {
																													number = String.valueOf(i+1);
																													onclick = uicomponent.event("VoteQuestion", number);
																												%>
																													<div id="FAQHomeStarVote$i" class="RatedVote" onmouseover="eXo.faq.UIAnswersPortlet.changeStarForVoteQuestion('$i', 'FAQHomeStarVote')" onclick="$onclick" title=""><span></span></div>
																										 	<%}%>
																										 	</div>
																										 	<%}%>
																											
																								 		
																								 	</div>
																							<%}
																								%>
																							</div>
																						</div>
																					</td>
																					<td>
																						<%
																						String markView = question.getMarkVote() + "";
																						if(markView.length() <= 4){
																						%>
																							<div style="line-height:22px;"><b>$markView</b></div>
																						<%
																						} else {
																						%>
																							<div style="line-height:22px;"><b><%=markView.substring(0, 4)%></b></div>
																						<%}%>
																					</td>
																				</tr>
																			</table>
																			<div style="clear:right;"><span></span></div>
																		<%
																		}
																		%>
																		
																	</td>
																</tr>
																<tr>
																	<td>
																		<div class="LeftQuestionContainer" style="width:99%;">
																			<div class="$questionIcon">
																				
																				<div onmousedown="eXo.webui.UIRightClickPopupMenu.clickRightMouse(event, this, 'UIPopupQuestion$questionIndex', '', null, null)">
																					
																					<!-- question content -->
																					<div class="ViewQuestionNotApproved">
																						<a href="<%=uicomponent.event("CloseQuestion")%>" style="color:$colorViewQuestion; cursor:pointer">
																							<span class="QuestionName" style="line-height:20px;">$questionContent</span>
																						</a>
																					</div>
																					
																				</div>
																				
																				<!-- action of this question -->
																				<div class="UIFAQPopupCategory" id="UIPopupQuestion$questionIndex" style="display:none; left:50px;">
																					<div class="UIRightClickPopupMenu UIContextMenuContainer" style="display:block;">
																						<div>
											
																							<div class="TopLeftRightClickPopupMenu">
																								<div class="TopRightRightClickPopupMenu">
																									<div class="TopCenterRightClickPopupMenu"><span></span></div>
																									<div class="RightClickCustomItem" style="display:none;"><span></span></div>
																								</div>
																							</div>
																							
																							<div class="MiddleLeftRightClickPopupMenu">
																								<div class="MiddleRightRightClickPopupMenu">
																									<div class="UIRightPopupMenuContainer" style="margin:0px;">
																										<%
																											String iconView = "" ;
																											for(viewAction in questionActions) {
																												if(viewAction.equals("CommentQuestion") && !question.isApproved() && !uicomponent.canEditQuestion) continue ;
																												if(!viewAction.equals("MoveQuestion") && !viewAction.equals("ResponseQuestion"))
																													iconView = viewAction.replace("Question", "");
																												else
																													iconView = viewAction ;
																												String linkView = "";
																												String lockFunction = "" ;
																												if(viewAction.equals("SendQuestion") && (!question.isApproved() || !question.isActivated())) {
																													if(canEditQuestion){
																														linkView = uicomponent.event(viewAction, qId+"/true");
																													} else {
																														linkView = "javaScript:alert('" + _ctx.appRes("UIQuestions.label.CanSendToFriend")+"');" ;
																														lockFunction = "LockFunction" ;
																													}
																												} else {
																													linkView = uicomponent.event(viewAction, qId);
																												}
																												String itemLabelView = _ctx.appRes("UIQuestions.action." + viewAction);																												
																										%>
																												<div onclick="javascript:void(0);" onmousedown="$linkView" class="MenuItem $lockFunction" style="cursor:pointer;">
																													<a class="IconItem $iconView" href="javascript:void(0);">$itemLabelView</a>
																												</div>
																										<%
																											}
																										%>																										
																										<%if(!canEditQuestion && uicomponent.currentUser_ != null && uicomponent.currentUser_.equals(question.getAuthor())){
																												String itemLabelView = _ctx.appRes("UIQuestions.action.EditQuestion");
																												String linkView = uicomponent.event("EditQuestion", qId);																				
																										%>
																											<div onclick="javascript:void(0);" onmousedown="$linkView" class="MenuItem" style="cursor:pointer;">
																												<a class="IconItem Edit" href="javascript:void(0);">$itemLabelView</a>
																											</div>
																										<%}%>
																									</div>
																								</div>
																							</div>
																										
																							<div class="BottomLeftRightClickPopupMenu">
																								<div class="BottomRightRightClickPopupMenu">
																									<div class="BottomCenterRightClickPopupMenu"><span></span></div>
																								</div>
																							</div>
																							
																						</div>
																					</div>
																				</div>
																				<!-- finish action of this question -->
																				
																					<!-- ===================================== view Detail =============================== -->
																				<div class="UIDetailContainer">
																					<%
																						String questionDetail = uicomponent.render(uicomponent.getQuestionDetail());
																					%>
																							$questionDetail
																				</div>
																				<span class="QuestionDateTime">&nbsp;<%=FAQUtils.getLongDateFormat(question.getCreatedDate())%>&nbsp;</span>
																					<!-- ===================================== view bottom =============================== -->
																				<%
																				if(uicomponent.currentUser_ != null){
																				%>
																					<div class="UIAction DisablePrint">
												                                        <%
																						if(question.isApproved() || uicomponent.canEditQuestion){
																							%>
												                                          <a href="<%=uicomponent.event("ResponseQuestion", question.getPath());%>" class="ActionButton LightBlueStyle ResponseQuestion"><%=_ctx.appRes("UIQuestions.action.AddAnswerQuestion");%></a>
												                                          <%}
																						if((uicomponent.faqSetting_.isEnanbleVotesAndComments() && question.isApproved())){
																						%>
												                                          <a href="<%=uicomponent.event("CommentQuestion", question.getPath() + "/new")%>" class="ActionButton LightBlueStyle Comment"><%=_ctx.appRes("UIQuestions.action.AddCommentQuestion")%></a>
												                                          <%}%>
												                                        </div>
																					<%}%>
																			</div>
																		</div>
																
																	</td>
																</tr>
															</tbody>
														</table>
													</td>
												</tr>
											</table>
										</div>
										<div class="ButtomQuestion"><span></span></div>
										
										<!-- ===================================== View response content ==================================================== -->
										<% 
										Answer[] answers = uicomponent.getPageListAnswer(question.getPath());
										String classResponsse = "";
										if(answers != null && answers.length > 0)classResponsse = "ResponseExternal";
										%>
										<div class="ResponseContent">
										
											<!-- ============================== View attachment files ============================================== -->
											<%if(!question.getAttachMent().isEmpty()) {%>
													<div class="AttachmentContent" style="background:white;">
														<%
															for(FileAttachment fileAttachment :question.getAttachMent()){
																String fileName = fileAttachment.getName();
																long fileSize = fileAttachment.getSize();
																if(fileSize > 0){
																	String size = uicomponent.convertSize(fileSize);
																	String fileType = fileAttachment.getMimeType();
																	String fileWorkSpace = fileAttachment.getWorkspace();
																	ValidatorDataInput validate = new ValidatorDataInput();
																	String linkImage = FAQUtils.getFileSource(fileAttachment);
																	String typeFileIcon = fileAttachment.getMimeType().substring((fileAttachment.getMimeType().indexOf("/")+1));
																	if(validate.isImage(fileName)) {
																		String attLink = uicomponent.getImageUrl(fileAttachment.getPath());
																%>
																		<div style="float:left; margin:10px 5px 0px 12px;" id="divId${fileName}">
																			<div class="Image">
																				<div onclick="eXo.faq.UIAnswersPortlet.showPicture('$attLink');">
																					<img style="cursor:pointer;" id="imgView${fileName}" src="$attLink" width="100px" height="100px" alt="" class="AttachmentFile"/>
																				</div>
																			</div>
																			<div style="clear:left;"><span></span></div>
													 						<div class="LabelBox">
														 						<div style="line-height:20px; white-space:nowrap;">
															 						<div class="Size AttachmentLabel">
															 							<%
															 								String downloadAtt = uicomponent.event("DownloadAttach");
															 							if(fileName.length() > 60){
															 							%>
						 																	<a class="AttachmentLabel" title="$fileName" onclick="ajaxRedirect('$linkImage');	if(eXo.core.Browser.browserType === 'ie') {$downloadAtt ; } return false;" href="javaScript:void(0);">
							 																	<span><%=FAQUtils.getSubString(fileName, 60);%></span>
							 																</a>
						 																<%}else{%>
						 																	<a class="AttachmentLabel" onclick="ajaxRedirect('$linkImage'); if(eXo.core.Browser.browserType === 'ie') {$downloadAtt ; } return false;" href="javaScript:void(0);">
							 																	<span>$fileName</span>
							 																</a>
						 																<%}%>
															 						</div>
															 						<div style="color:#1052b5; float:left;">
															 							<span>&nbsp;- </span><span style="color:gray;font-size:11px;">$size</span>
															 						</div>
															 					</div>
														 						<div style="clear:left;"><span></span></div>
														 					</div>
													 					</div>
																<%} else { %>
																		<div class="LabelBox" style="margin:10px 5px 0px 12px; line-height:20px; float:left;">
																			<div class="AttachmentIcon FileAttachmentIcon" style="width:auto; height:auto;float:left;">
																			<%
																			if(fileName.length() > 60){
												 							%>
			 																	<a title="$fileName" class="AttachmentLabel" onclick="if(eXo.core.Browser.browserType === 'ie') {<%=uicomponent.event("DownloadAttach");%>; } ajaxRedirect('$linkImage'); return false;" href="javaScript:void(0);">
				 																	<%=FAQUtils.getSubString(fileName, 60);%>
				 																</a>
			 																<%}else{%>
																				<a class="AttachmentLabel" onclick="if(eXo.core.Browser.browserType === 'ie') {<%=uicomponent.event("DownloadAttach");%>; } ajaxRedirect('$linkImage'); return false;" href="javaScript:void(0);">
																					$fileName
																				</a>
			 																<%}%>
																			</div>
																			<div style=" float:left;">&nbsp;-&nbsp;<span style="color:gray;">$size</span></div>
																			<div style="clear:left;"><span></span></div>
																		</div>
																<%}
																} else {
																%>
																	<div class="LabelBox" style="margin:10px 10px 0px 12px;">
																		<div class="FalseIcon" style="padding-left:15px;">
																			<a style="color:red;" href="javaScript:void(0)"><%=_ctx.appRes("UIQuestions.label.lostFile")%></a>
																		</div>
																		<div style="clear:left;"><span></span></div>
																	</div>
																<%
																}
															}%>
														<div style="clear:left;"><span></span></div>
													</div>
											<%}%>
											
											<!-- ======================================= view relation question ========================================= -->
											<%
												List questionRelation = question.getRelations();
												if(!questionRelation.isEmpty()) {
													String linkRelaQues = "" ;
													String relationContent = "" ;
											%>
												<div class="RelationContent">
													<div style="font-weight:bold; font-size:13px; margin:5px 0px 3px;"><%=_ctx.appRes("UIQuestions.label.RelatedQuestion")%>:</div>
											<%
													for(String relationId :questionRelation) {
														relationContent = uicomponent.getQuestionRelationById(relationId).replaceAll("<p>", "").replaceAll("</p>", "");
														linkRelaQues = uicomponent.event("ViewQuestion", relationId + "/language=" + uicomponent.language_+"/relation");
														if(relationContent != null && relationContent.trim().length() > 0) {
											%>
															<div style="padding:0px 0px 5px 10px;">
																<a href="$linkRelaQues" style="text-decoration:yes; color:#1555B5;"> - $relationContent</a><br/>
															</div>
											<% 		}
													}
											%>
													</div>
											<%}%>
											
											<!-- ===================================== Question's answers ==================================================== -->
											<div class="ResponseContainer">
												<div class="TitleResponseContent">
													<div class="IconResponse">
														<table align="center" width="100%">
															<tr>
																<td>
																	<%=_ctx.appRes("UIQuestions.label.Answers")%>
																</td>
																<%if(uicomponent.faqSetting_.isEnanbleVotesAndComments()){%>
																		<!-- action Sort answer by vote -->
																	<td style="width:70px">
																		<a href="<%=uicomponent.event("SortAnswer")%>" title="<%=_ctx.appRes("UIQuestions.action.SortAnswerByVote")%>" style="cursor:pointer; text-align:left;">
																			<div class="SortAnswer DisablePrint"><span></span></div>
																		</a>
																	</td>
																<%}%>
															</tr>
														</table>
													</div>
												</div>
												
												<!-- -------------------------------------- View all answer for this question ----------------------------------- -->
												<div class="Response $classResponsse" id="SetWidthContent">
													<div style="padding-left:0px; _width:98%;">
													<%
													if(answers != null && answers.length > 0){
														String actionAnswer = "";
														int i = 0;
														String owner = "";
														for(Answer answer in answers) {
															res = uicomponent.render(answer);
															if(!uicomponent.canEditQuestion && (!answer.getApprovedAnswers() || !answer.getActivateAnswers())){
																continue;
															}
															date = FAQUtils.getLongDateFormat(answer.getDateResponse());
															owner = answer.getResponseBy();
															responseBy = FAQUtils.getScreenName(owner, answer.getFullName());
															String userProfile = uicomponent.event("ViewUserProfile", owner);
														%>
														<div class="ResponseItemContainer">
															<table width="100%">
																<tbody>
																	<tr>
																		<td>
																			<!-- ============================= View user who answered quesetion ============================ -->
																			<div class="ResponseItemContainerLeft">
																				<div style="padding-bottom:10px">
																					<div class="ProfileContainer">
																						<%
																						if(uicomponent.faqSetting_.isEnableViewAvatar()) {
																						%>				
																						<div class="AvatarContainer" style="margin-top:0px;">
																							<img class="FAQAvatar ImgAvatarBorder" src="<%=uicomponent.getAvatarUrl(owner);%>" alt="Avatar"/>
																						</div>
																						<%}%>
																						<div class="AuthorInfor" style="text-align:center">
																							<a title="<%=_ctx.appRes("UIQuestionsInfo.title.ViewUserProfile")%>" href="<%=uicomponent.event("ViewUserProfile", owner)%>" style="color:gray; cursor:pointer;">
																								<span class="UserName">$responseBy</span>
																							</a>
																						</div>
																					</div>
																				</div>
																			</div>
																			
																			<div class="ResponseItemContainerRight">
																				<div style="overflow:auto;_padding-bottom:15px;">
																					<%
																					if(answer.getApprovedAnswers() && answer.getActivateAnswers()){
																					%>
																						<div class="AnswerContent">$res</div>
																					<%
																					} else {
																					%>
																						<div class="AnswerContent" style="color:gray;">$res</div>
																					<%} %>
																					<div style="color:#721d95;">$date</div>
																				</div>
																				
																				<!-- ============================= View mark vote answer ======================================== -->
																				<div class="DisablePrint" style="overflow:auto; margin-top:5px;">
																					<%
																					if(uicomponent.faqSetting_.isEnanbleVotesAndComments()){
																							String userVoteUpAnswer = "javaScript:alert('" + _ctx.appRes("UIQuestions.alert.LoginBeforVote") + "')";
																							String userVotedownAnswer = "javaScript:alert('" + _ctx.appRes("UIQuestions.alert.LoginBeforVote") + "')";
																							if(uicomponent.currentUser_ != null){
																								userVoteUpAnswer = uicomponent.event("VoteAnswer", answer.getPath() + "/up");
																								userVotedownAnswer = uicomponent.event("VoteAnswer", answer.getPath() + "/down");
																							}
																							String idVote = "FAQVoteAnswerUp" + i;
																						%>
																							<div style="float:left;">
																								<div style="float:left;" title="+1">
																									<div class="VoteAnswerUp" id="$idVote" onmouseover="eXo.faq.UIAnswersPortlet.voteAnswerUpDown('$idVote', 'true')" onmouseout="eXo.faq.UIAnswersPortlet.voteAnswerUpDown('$idVote', null)">
																										<a href="$userVoteUpAnswer" style="width:16px; height:16px; display:block"></a>
																									</div>
																								</div>
																							<%
																								idVote = "FAQVoteAnswerDown" + i;
																								++i;
																							%>
																								<div style="float:left;" title="-1">
																									<div class="VoteAnswerDown" id="$idVote" onmouseover="eXo.faq.UIAnswersPortlet.voteAnswerUpDown('$idVote', 'true')" onmouseout="eXo.faq.UIAnswersPortlet.voteAnswerUpDown('$idVote', null)">
																										<a href="$userVotedownAnswer" style="width:16px; height:16px; display:block"></a>
																									</div>
																								</div>
																								<div style="float:left; line-height:18px; margin-left:4px;">
																									<%=answer.getMarkVotes()%>
																								</div>
																								<div style="clear:left;"><span></span></div>
																							</div>
																						<%
																						}%>
																						<div style="clear:left;"><span></span></div>
																				</div>
																				
																			</div>
																			<div style="clear:left;"><span></span></div>
																
																		</td>
																	
																	<% if(uicomponent.canEditQuestion || owner.equals(uicomponent.currentUser_)){%>
																		<td style="width:20px" class="DisablePrint">
																			<a title="<%=_ctx.appRes("UIQuestions.action.EditAnswer")%>"	style="cursor:pointer;" href="<%=uicomponent.event("EditAnswer", answer.getId())%>">
																				<div class="ItemIcon Edit" style="height:20px;width:16px;">
																						<span></span>
																				</div>
																			</a>
																		</td>
																		<%if(uicomponent.canEditQuestion) { %>
																		<td style="width:20px;" class="DisablePrint">
																		<%
																			actionAnswer = uicomponent.event("ChangeStatusAnswer", answer.getId() + "/Approve");
																			if(answer.getApprovedAnswers()) {
																			%>
																				<a href="$actionAnswer" style="font-size:9px; color:blue; font-style:italic; cursor:pointer;" title="<%=_ctx.appRes("UIQuestionsInfo.title.UnApprove")%>">
																					<div class="ApprovedQuestion"><span></span></div>
																				</a>
																			<%} else {
																			%>
																				<a href="$actionAnswer" style="font-size:9px; color:blue; font-style:italic; cursor:pointer;" title="<%=_ctx.appRes("UIQuestionsInfo.title.Approve")%>">
																					<div class="UnApprovedQuestion"><span></span></div>
																				</a>
																			<%}%>
																		</td>
																		<td style="width:20px;" class="DisablePrint">
																			<%
																				actionAnswer = uicomponent.event("ChangeStatusAnswer", answer.getId() + "/Activate");
																				if(answer.getActivateAnswers()) {
																			%>
																				<a href="$actionAnswer" style="font-size:9px; color:blue; font-style:italic; cursor:pointer;" title="<%=_ctx.appRes("UIQuestionsInfo.title.UnActivated")%>">
																					<div class="ActivateQuestion"><span></span></div>
																				</a>
																			<%} else {
																			%>
																				<a href="$actionAnswer" style="font-size:9px; color:blue; font-style:italic; cursor:pointer;" title="<%=_ctx.appRes("UIQuestionsInfo.title.Activate")%>">
																					<div class="DeActivateQuestion"><span></span></div>
																				</a>
																			<%}%>
																		</td>
																		<%} %>
																		<td style="width:20px" class="DisablePrint">
																				<a href="<%=uicomponent.event("DeleteAnswer", "" + answer.getId())%>" style="font-size:9px; color:blue; font-style:italic; cursor:pointer;" title="<%=_ctx.appRes("UIQuestionsInfo.title.DeleteAnswer")%>">
																					<div class="DeleteAnswer"><span></span></div>
																				</a>
																		</td>
																	<%}%>
																	</tr>
																</tbody>
															</table>
														</div>
														
													<%}
														if(uicomponent.getChildById(uicomponent.ANSWER_ITER + question.getId())!= null){
													%>
															<div style="overflow:auto">
																<% uicomponent.renderChild(uicomponent.ANSWER_ITER + question.getId()) %>
																<div style="clear:right;"><span></span></div>
															</div>	
												<%	}
													} else { %>
													<div align="center" style="width:100%;">
														<div class="NotResponse" style="margin:auto; width:300px; padding-left:20px; font-weight:bold; text-align:left;">
															<%=_ctx.appRes("UIQuestions.label.QuestionNotYetAnswered")%>
														</div>
													</div>
												<%}%>
													</div>
												</div>
												<!-- -------------------------------------- finish View all answer for this question ----------------------------------- -->
												
												<!-- ============================== View question's commnets ============================================== -->
												<%
												if(uicomponent.faqSetting_.isEnanbleVotesAndComments()){
													boolean canEditComment = false;
													Comment[] comments = uicomponent.getPageListComment(question.getPath());
													String classComment = "";
													if(comments.length > 0) {
														classComment = "CommentExternal";
												%>
														<div class="TitleCommentContent">
															<div class="IconComment"><%=_ctx.appRes("UIQuestions.label.Comments")%></div>
														</div>
												<% } %>
													
													<div class="Response $classComment">
													<%
														int commentCount = 0;
														for(Comment comment in comments){
															String owner = comment.getCommentBy();
															if(uicomponent.currentUser_.equals(comment.getCommentBy())) canEditComment = true;
															else canEditComment = false;
													%>
															<div >
																<div class="ResponseItemContainer" style="background:#F0F0F0;">
																<table style="width:100%">
																	<tr>
																		<td>
																		
																				<div class="ResponseItemContainerLeft">
																				<!-- ============================= View user who comment for quesetion ============================ -->
																					<div style="padding:10px 0px">
																						<div class="ProfileContainer">
																							<%
																							if(uicomponent.faqSetting_.isEnableViewAvatar()) {
																							%>				
																							<div class="AvatarContainer" style="margin-top:0px;">
																								<img class="FAQAvatar ImgAvatarBorder" src="<%=uicomponent.getAvatarUrl(owner);%>" alt="Avatar"/>
																							</div>
																							<%}%>
																							<div class="AuthorInfor" style="text-align:center">
																								<a title="<%=_ctx.appRes("UIQuestionsInfo.title.ViewUserProfile")%>" href="<%=uicomponent.event("ViewUserProfile", owner)%>" style="color:gray; cursor:pointer;">
																									<span class="UserName"><%=FAQUtils.getScreenName(owner, comment.getFullName())%></span>
																								</a>
																							</div>
																						</div>
																					</div>
																				</div>
																				<div class="ResponseItemContainerRight">
																					<%
																						String commentDetail = uicomponent.render(comment);
																					%>
																					<span>$commentDetail</span>
																					<div style="color:#721d95"><%=FAQUtils.getLongDateFormat(comment.getDateComment());%></div>
																				</div>
																				<div style="clear:left;"><span></span></div>
			
																		</td>
																		<%
																		if(canEditComment){
																			if (uicomponent.faqSetting_.isCanEdit()){%>
																				<td style="width:20px;" class="DisablePrint">
																					<a title="<%=_ctx.appRes("UIQuestions.action.CommentToAnswer")%>" href="<%=uicomponent.event("CommentToAnswer", comment.getId())%>" style="cursor:pointer;">
																						<div class="ItemIcon CommentToAnswer" style="height:24px;width:16px;">
																								<span></span>
																						</div>
																					</a>
																				</td>
																		<%}%>
																			<td style="width:20px" class="DisablePrint">
																				<a title="<%=_ctx.appRes("UIQuestions.action.EditComment")%>"	style="cursor:pointer;" href="<%=uicomponent.event("CommentQuestion", question.getPath() + "/" + comment.getId())%>">
																					<div class="ItemIcon Edit" style="height:24px;width:16px;">
																							<span></span>
																					</div>
																				</a>
																			</td>
																			<td style="width:20px" class="DisablePrint">
																				<a title="<%=_ctx.appRes("UIQuestions.action.DeleteComment")%>"	style="cursor:pointer;" href="<%=uicomponent.event("DeleteComment", comment.getId())%>">
																					<div class="ItemIcon Delete" style="height:24px;width:16px;">
																							<span></span>
																					</div>
																				</a>
																			</td>
																	<%} else if (uicomponent.faqSetting_.isCanEdit()){%>
																			<td style="width:20px" class="DisablePrint">
																				<a title="<%=_ctx.appRes("UIQuestions.action.CommentToAnswer")%>"	style="cursor:pointer;" href="<%=uicomponent.event("CommentToAnswer", comment.getId())%>">
																					<div class="ItemIcon CommentToAnswer" style="height:24px;width:16px;">
																							<span></span>
																					</div>
																				</a>
																			</td>
																			<td style="width:20px" class="DisablePrint">
																				<a title="<%=_ctx.appRes("UIQuestions.action.DeleteComment")%>"	style="cursor:pointer;" href="<%=uicomponent.event("DeleteComment", comment.getId())%>">
																					<div class="ItemIcon Delete" style="height:24px;width:16px;">
																							<span></span>
																					</div>
																				</a>
																			</td>
																	<%}%>
																	</tr>
																</table>
																</div>
															</div>
													<%}
														if(uicomponent.getChildById(uicomponent.COMMENT_ITER + question.getId())!= null){
													%>
														<div>
															<% uicomponent.renderChild(uicomponent.COMMENT_ITER + question.getId()) %>
															<div style="clear:right;"><span></span></div>
														</div>														
														<%}%>	
													</div>
												<%}%>
													
												</div>
											</div>
										</div>
									</div>
								</div>
								
								<div class="DecoratorBL">
									<div class="DecoratorBR">
										<div class="DecoratorBC"><span></span></div>
									</div>
								</div>
						</div>
		<%		}
					questionIndex ++ ;
				}
		%>
		
			<!-- -------------------------------------- Print function ------------------------------- -->
			
	        <div id="PrintAction" print="<%=_ctx.appRes("UIQuestions.action.Print")%>" cancel="<%=_ctx.appRes("UIQuestions.action.ClosePrintQuestion")%>"></div>
			
		</div>
		<%
			if(uicomponent.getQuestionView() != null && uicomponent.getQuestionView().trim().length() > 0) {
				String divId = uicomponent.getQuestionView();
				jsmanager.addJavascript("eXo.faq.UIAnswersPortlet.jumToQuestion('"+divId+"');");
			}
		%>
	</div>
	
	<div>
		<%uicomponent.renderChild(uicomponent.OBJECT_ITERATOR);%>
	</div>
	
<%/* End View category*/ %>
</div>
