{if $myobj->isAllowedToAsk()}
	{if chkIsPaymentAllowed('payment_answers')}
		{$myobj->overRideConfigs()}
	{/if}
    {literal}
        <script language="javascript" type="text/javascript">
            var videoPreviewUrl = {/literal}'{$postAnswersForm_arr.default_video_preview.url}'{literal};
        </script>
        <script language="javascript" type="text/javascript">
            var audioPreviewUrl = {/literal}'{$postAnswersForm_arr.default_audio_preview.url}'{literal};
     		var video_not_encoded_info = {/literal}'{$LANG.video_not_encoded_info}'{literal};
     		var externalVideoPreviewUrl = {/literal}'{$postAnswersForm_arr.external_video_preview.url}'{literal};
     		var audio_not_encoded_info = {/literal}'{$LANG.audio_not_encoded_info}'{literal};
          	var externalAudioPreviewUrl = {/literal}'{$postAnswersForm_arr.external_audio_preview.url}'{literal};
        </script>
    {/literal}
	{if (chkIsPaymentAllowed('payment_answers') and chkIsPaymentAlertMessageAllowed()) and ($myobj->getFormField('action') neq 'edit')}
 		<ul class="clsQuistionHind">
			{if $postAnswersForm_arr.total_notify eq $CFG.plan.unlimited_text && $postAnswersForm_arr.today_notify eq $CFG.plan.unlimited_text}
				<li> <p>{$LANG.notify_unlimited}</p></li>
			{elseif $postAnswersForm_arr.total_notify eq $CFG.plan.unlimited_text}
				<li> <p>{$LANG.notify_unlimited}</p></li>
				<li> <p>{$postAnswersForm_arr.today_notify}</p></li>
			{else}
	            <li> <p>{$postAnswersForm_arr.total_notify}</p></li>
	            <li> <p>{$postAnswersForm_arr.today_notify}</p></li>
            {/if}
        </ul>
 	{/if}
<div class="clsCommonTopAnalystRoundedCorner">
<div class="clsClearfix">
	<h2 class="clsQuestionHeading">{$LANG.answers_this_question}</h2>
        {if $CFG.admin.answers.point_notification && $CFG.admin.reply_answers.allowed && !$myobj->getFormField('aid')}
            <p class="clsEarnPoint">{$postAnswersForm_arr.earn_points_details_info}</p>
        {/if}
		</div>
		  <!--rounded corners-->
		  <div class="clsShadedBg">
		  <div class="lbtopanalyst">
		    <div class="rbtopanalyst">
		      <div class="bbtopanalyst">
		        <div class="blctopanalyst">
		          <div class="brctopanalyst">
		            <div class="tbtopanalyst">
		              <div class="tlctopanalyst">
		                <div class="trctopanalyst">
    <div class="clsReplyAnswers">
    <form name="selFormReplyAnswers" id="selFormReplyAnswers" method="post" action="{$postAnswersForm_arr.form_action}" autocomplete="off" enctype="multipart/form-data">
    {$myobj->populateHidden($postAnswersForm_arr.hidden_arr)}
        <table summary="{$LANG.post_your_answers}" class="clsAskQuestion">
			<tr>
				<td colspan="2">
					<div class="AskQuestionSubHead">{$LANG.question_basic_info}</div>
				</td>
			</tr>
            <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('question')}"> Question</td>
                <td class="{$myobj->getCSSFormFieldCellClass('question')}"><span class="">{$postAnswersForm_arr.question_manual}</span></td>
            </tr>
            <tr>
                <td class="{$myobj->getCSSFormLabelCellClass('answer')}"><label for="answer">{$LANG.your_answer}</label>&nbsp;<span class="clsMandatory">*</span>
                {$myobj->ShowHelpTip('answers', 'answer')}
                </td>
                <td class="{$myobj->getCSSFormFieldCellClass('answer')}">
                    <textarea name="answer" id="answer" class="{$myobj->getCSSFormFieldElementClass('answer')}" cols="63" rows="5" tabindex="{smartyTabIndex}" maxlength="{$CFG.admin.answers.limit}" onFocus="updatelength(this);" onKeyUp="updatelength(this);">{$myobj->getFormField('answer')}</textarea>
                    {$myobj->getFormFieldElementErrorTip('answer')}
                    <div id="ss" class="clsZeroColour"><span> {$LANG.header_remainig} :</span> <span class="clsCharacterLimit">{literal}<script language="javascript" type="text/javascript">var c = ans_des_max_length - document.getElementById('answer').value.length;document.write(c);</script>{/literal}</span></div>
                </td>
            </tr>
            {if $CFG.admin.answers.source}
                <tr>
                    <td class="{$myobj->getCSSFormLabelCellClass('source')}"><label for="source">{$LANG.know_your_source_list_it_here}</label>
                    {$myobj->ShowHelpTip('answers_source')}
                    </td>
                    <td class="{$myobj->getCSSFormFieldCellClass('source')}">
                        <textarea name="source" id="source" cols="70" rows="5" tabindex="{smartyTabIndex}">{$myobj->getFormField('source')}</textarea>
                        {$myobj->getFormFieldErrorTip('source')}
                    </td>
                </tr>
            {/if}
			</table>

			{if $CFG.admin.attachments_answers.allowed or chkIsVideoAllowed('answer') or chkIsAudioAllowed('answer') or chkExternalVideoAllowed('answer') or chkExternalAudioAllowed('answer')}
			<table summary="{$LANG.post_your_answers}" class="clsAskQuestion clsAskQuestionUpload">
	            <!-- add documents block1 -->
				<tr>
					<td colspan="3">
						<div class="AskQuestionSubHead">{$LANG.common_attachments}</div>
					</td>
				</tr>
				<tr>
					{if $CFG.admin.attachments_answers.allowed && $CFG.admin.attachments_allowed.count > 0}

				          	<td id="tdID" class="{$myobj->getCSSFormFieldCellClass('attachments')} clsQuestionImage">
								<div class="clsImageUpload clsClearfix">
									<div class="clsImageContainer" id="image_uploads">
										<a href="javascript:void(0);">	<span id="spanButtonPlaceholder"></span> </a>
									</div>
									<div class="clsImageDetails">
										<p>{$postAnswersForm_arr.attachments_allowed_manual}</p>
					                    <p>{$postAnswersForm_arr.allowed_formats_manual} | {$postAnswersForm_arr.allowed_size}</p>
									</div>
								</div>
							</td>
			        {/if}
	   				<!-- ends add attachment block1 -->

			        {if chkIsVideoAllowed('answer') or chkExternalVideoAllowed('answer')}
			        		<td class="{$myobj->getCSSFormFieldCellClass('question_video')} clsQuestionVideo">
			        			{if chkIsVideoAllowed('answer')}
									<div class="clsVideoUpload clsClearfix" id="video_first" {$postAnswersForm_arr.style_add_video} >
										<div class="clsVideoContainer">
										<a id="video_add" href="{$postAnswersForm_arr.video_upload.url}" onClick="{$myobj->getBrowser('video_add')}"></a>
				        				{$myobj->getFormFieldErrorTip('question_video')}
										</div>
										<div class="clsVideoDetails">
											<a {$postAnswersForm_arr.style_add_video} href="{$postAnswersForm_arr.video_upload.url}" onClick="{$myobj->getBrowser('video_add')}">
												<p>{$LANG.common_record_video}</p>
												<p>{$LANG.common_using_webcams}</p>
											</a>
										</div>
									</div>
									<div class="clsAudioUpload clsClearfix" id="video_secnd" {if $postAnswersForm_arr.style_add_video==''} style="display:none;" {/if}>
										<div class="clsAudioDetails">
											<div >
												<p class="clsAVDelete"><a {$postAnswersForm_arr.style_delete_video} id="video_delete" href="{$myobj->getCurrentUrl()}" onClick="return confrimRemove('video', 'video_delete', '{$LANG.are_you_sure_to_delete}');">{$LANG.delete_video}</a></p>
												<p class="clsAVPreview"><a {$postAnswersForm_arr.style_preview_video} id="video_preview" href="{$postAnswersForm_arr.video_preview.url}" onClick="{$myobj->getBrowser('video_preview')}">{$LANG.preview_video}</a></p>
											</div>
										</div>
									</div>
								{/if}
								{if chkExternalVideoAllowed('answer')}
									<div class="clsExternalUploadBox">
										<div class="clsVideoUpload clsClearfix" id="external_video_add1" {$postAnswersForm_arr.style_add_external_video} >
											<div class="clsExternalVideoContainer">
											<a {$postAnswersForm_arr.style_add_external_video} id="external_video_add" href="{$postAnswersForm_arr.external_video_upload.url}" onClick="{$myobj->getBrowser('external_video_add')}">{$LANG.add_external_video}</a>
					        				{$myobj->getFormFieldErrorTip('question_video')}
											</div>
										</div>
										<div class="clsAudioUpload clsClearfix" id="external_video_add2" {if $postAnswersForm_arr.style_add_external_video==''} style="display:none;" {/if}>
											<div class="clsAudioDetails">
												<div >
													<p class="clsAVDelete"><a {$postAnswersForm_arr.style_delete_external_video} id="external_video_delete" href="{$myobj->getCurrentUrl()}" onClick="return removeExternalVideo();">{$LANG.delete_external_video}</a></p>
													<p class="clsAVPreview"><a {$postAnswersForm_arr.style_preview_external_video} id="external_video_preview" href="{$postAnswersForm_arr.external_video_preview.url}" onClick="{$myobj->getBrowser('external_video_preview')}">{$LANG.preview_external_video}</a></p>
												</div>
											</div>
										</div>
									</div>
			                    {/if}
			        		</td>
						        {/if}
			        {if chkIsAudioAllowed('answer') or chkExternalAudioAllowed('answer')}
			        		<td class="{$myobj->getCSSFormFieldCellClass('audio')}">
			        			{if chkIsAudioAllowed('answer')}
									<div class="clsAudioUpload clsClearfix" id="audio_first" {$postAnswersForm_arr.style_add_audio} >
										<div class="clsAudioContainer">
											<a id="audio_add" href="{$postAnswersForm_arr.audio_upload.url}" onClick="{$myobj->getBrowser('audio_add')}"></a>
				        					{$myobj->getFormFieldErrorTip('audio')}
										</div>
										<div class="clsAudioDetails">
											<div>
												<a {$postAnswersForm_arr.style_add_audio} href="{$postAnswersForm_arr.audio_upload.url}" onClick="{$myobj->getBrowser('audio_add')}">
													<p>{$LANG.common_record_audio}</p>
													<p>{$LANG.common_using_recorder}</p>
												</a>
											</div>
										</div>
									</div>
									<div class="clsAudioUpload clsClearfix" id="audio_secnd" {if $postAnswersForm_arr.style_add_audio==''} style="display:none;" {/if}>
										<div class="clsAudioDetails clsAudioOptions">
											<div >
												<p class="clsAVDelete"><a {$postAnswersForm_arr.style_delete_audio} id="audio_delete" href="{$myobj->getCurrentUrl()}" onClick="return confrimRemove('audio', 'audio_delete', '{$LANG.are_you_sure_to_delete}');">{$LANG.delete_audio}</a></p>
												<p class="clsAVPreview"><a {$postAnswersForm_arr.style_preview_audio} id="audio_preview" href="{$postAnswersForm_arr.audio_preview.url}" onClick="{$myobj->getBrowser('audio_preview')}">{$LANG.preview_audio}</a></p>
											</div>
										</div>
									</div>
								{/if}
								{if chkExternalAudioAllowed('answer')}
									<div class="clsExternalUploadBox">
				                        <div class="clsAudioUpload clsClearfix" id="external_audio_add1" {$postAnswersForm_arr.style_add_external_audio} >
											<div class="clsExternalAudioContainer">
												<a {$postAnswersForm_arr.style_add_external_audio} id="external_audio_add" href="{$postAnswersForm_arr.external_audio_upload.url}" onClick="{$myobj->getBrowser('external_audio_add')}">{$LANG.add_external_audio}</a>
					        					{$myobj->getFormFieldErrorTip('audio')}
											</div>
										</div>
										<div class="clsAudioUpload clsClearfix" id="external_audio_add2" {if $postAnswersForm_arr.style_add_external_audio==''} style="display:none;" {/if}>
											<div class="clsAudioDetails clsAudioOptions">
												<div >
													<p class="clsAVDelete"><a {$postAnswersForm_arr.style_delete_external_audio} id="external_audio_delete" href="{$myobj->getCurrentUrl()}" onClick="return removeExternalAudio();">{$LANG.delete_external_audio}</a></p>
													<p class="clsAVPreview"><a {$postAnswersForm_arr.style_preview_external_audio} id="external_audio_preview" href="{$postAnswersForm_arr.external_audio_preview.url}" onClick="{$myobj->getBrowser('external_audio_preview')}">{$LANG.preview_external_audio}</a></p>
												</div>
											</div>
										</div>
									</div>
			                    {/if}
							</td>
							 {/if}
			        	</tr>
            <tr>
               {if $CFG.admin.attachments_answers.allowed && $CFG.admin.attachments_allowed.count > 0}
                <td id="tdID" class="{$myobj->getCSSFormFieldCellClass('attachments')}" colspan="3">
					<p id="brsBtn"></p>
                    <div id="thumbnails" class="clsClearfix" {if $myobj->getFormField('qid') && $myobj->answer_attachment_count gt 0} style="display:block;" {else} style="display:none;" {/if}>
                    <p class="clsImageArrow"><!----></p>
					{if $myobj->getFormField('aid')}
		                    {foreach key=gAkey item=gAvalue from=$postAnswersForm_arr.getAttachments}
		                    	<div class="clsAskUploadImg" id="attach_{$gAvalue.record.attachment_id}">
		                    	<span  class="clsRemoveImg"><a href="#" id="{$gAvalue.anchor}" onClick="return Confirmation('selDelAttachconfirm', 'msgAttachConfirmform', Array('act','attach_id', 'attach_content_id', 'attach_name', 'msgAttachConfirmText'), Array('deletemoreattachments','{$gAvalue.record.attachment_id}','{$myobj->getFormField('aid')}', '{$gAvalue.attachment_file_name}', '{$LANG.confirm_remove_info_message}'), Array('value','value','value', 'value','innerHTML'));"></a></span>
		                    	<div class="clsImageAlignDiv">
									<p>
		                        		<a id="{$gAvalue.img_id}" href="{$gAvalue.attachment_path}" onclick="{$myobj->getBrowser($gAvalue.img_id)}"><img src="{$gAvalue.attachment.url_thumb}"  alt="{$gAvalue.record.attachment_name}" /></a>
									</p>
								</div><img src="{$gAvalue.image_large_path}" alt="" style="display: none;" />
		                    	</div>
							{/foreach}
					{/if}
					<div id="content">
						<div id="divFileProgressContainer" class="clsThumbMsgDisplay" style="display:none;"></div>
						<div id="hiddenvals"></div>
						<div id="hiddenoriginalvals"></div>
					</div>
				</div>
				</td>
			{/if}
           	</tr>
			</table>
			{/if}

			 <table summary="{$LANG.post_your_answers}" class="clsAskQuestion">
             <tr>
                <td class="{$myobj->getCSSFormFieldCellClass('submit')}">
				     {if $myobj->getFormField('aid')}
                      <div class="clsSubmitLeft">
									<div class="clsSubmitRight">  <input type="submit" class="clsSubmitButton clsMediumSubmitButton" name="update_answer" id="submit" tabindex="{smartyTabIndex}" value="{$LANG.answers_update_yours}" />
									</div>
									</div>
                     {else}
					 <div class="clsSubmitLeft">
									<div class="clsSubmitRight">
                        <input type="submit" class="clsSubmitButton clsMediumSubmitButton" name="submit" id="submit" tabindex="{smartyTabIndex}" value="{$LANG.answers_submit_yours}" />
						</div>
						</div>
                     {/if}
				     {if $postAnswersForm_arr.for=='main'}
						<div class="clsCancelLeft">
								<div class="clsCancelRight">
                        <input type="submit" class="clsCancelButton" name="cancel" id="cancel" tabindex="{smartyTabIndex}" value="{$LANG.common_cancel}" />
						</div>
						</div>
                    {else}
						<div class="clsCancelLeft">
								<div class="clsCancelRight">
                        <input type="button" class="clsCancelButton" name="cancel" id="cancel" tabindex="{smartyTabIndex}" value="{$LANG.common_cancel}" onClick="answerCancel({$CFG.admin.answers.limit}); Effect.toggle('subAnsPostForm', 'BLIND'); return false;" />
						</div>
						</div>

                    {/if}
                </td>
            </tr>
        </table>
        <input type="hidden" name="aid" value="{$myobj->getFormField('aid')}" />
    </form>
    {literal}
        <script language="javascript" type="text/javascript">
            needLiveValidation('answer',Array('Presence'));
			var audioPreviewUrl = '{/literal}{$postAnswersForm_arr.audio_preview.url}{literal}';
			var videoPreviewUrl = '{/literal}{$postAnswersForm_arr.video_preview.url}{literal}';
        </script>
    {/literal}
    </div>
{else}
    <div id="selMsgAlert">
        <p>{$LANG.info_not_allowed_to_ask}</p>
    </div>
{/if}

</div></div></div></div></div></div></div></div></div></div>