<div id="selMembers">
  <h2 class="clsManageAnswers">
  	{if $myobj->getFormField('did')}
		{$LANG.member_edit_title}
	{else}
		{$LANG.member_title}
	{/if}
  </h2>
  <div id="selMsgConfirm" class="selMsgConfirm" style="display:none;position:absolute;">
    <form name="formConfirm" id="formConfirm" method="post" action="{$myobj->getCurrentUrl()}">
      <p id="confirmMessage"></p>
      <table summary="{$LANG.container_to_get_confirmation}">
        <tr>
          <td><input type="button" class="clsSubmitButton" name="confirm_action" id="confirm_action" value="{$LANG.common_yes_option}" tabindex="{smartyTabIndex}" onClick="hideAllBlocks(); doRemoveAction();"/>
            &nbsp;
            <input type="button" class="clsCancelButton" name="cancel" id="cancel" value="{$LANG.common_no_option}" tabindex="{smartyTabIndex}" onClick="return hideAllBlocks();" />
          </td>
        </tr>
      </table>
      <input type="hidden" name="action" />
    </form>
  </div>
  {include file='information.tpl'}
{if $myobj->isShowPageBlock('show_form_confirm')}
  <div id="selMsgError">
    <form name="form_delete_event" id="selFormselDeleteEvents" method="post" action="{$myobj->getCurrentUrl()}" autocomplete="off">
      <table class="clsCommonTable" summary="{$LANG.member_tbl_summary}" >
        <tr>
          <td colspan="2">{$LANG.confirm_message}</td>
        </tr>
        <tr>
          <td>{$myobj->common_hidden($myobj->getFormField('debate_ids'))}
            <input type="hidden" name="action" value="{$myobj->getFormField('action')}" />
            <input type="submit" class="clsSubmitButton" name="cdelete" id="cdelete" value="{$LANG.common_yes_option}" tabindex="{smartyTabIndex}" />
          </td>
          <td><input type="submit" class="clsCancelButton" name="dcancel" id="dcancel" value="{$LANG.common_no_option}" tabindex="{smartyTabIndex}" />
          	{$myobj->populateHidden($myobj->show_form_confirm.hidden_arr)}
          </td>
        </tr>
      </table>
    </form>
  </div>
{/if}
{if $myobj->isShowPageBlock('form_edit')}
 	<form name="selFormAskQuestion" id="selFormAskQuestion" method="post" action="{$myobj->getCurrentUrl(true)}" autocomplete="off">
		{$myobj->populateHidden($myobj->form_edit.hidden_arr)}
		<table class="clsCommonTable" summary="{$LANG.post_your_debate}">
			<tr>
				<td class="{$myobj->getCSSFormLabelCellClass('subject')}"><label for="subject">{$LANG.member_debates}</label></td>
				<td class="{$myobj->getCSSFormFieldCellClass('subject')}">
					<input type="text" class="clsTextBox" name="subject" id="subject" maxlength="250" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('subject')}" />
					{$myobj->getFormFieldElementErrorTip('subject')}
				</td>
			</tr>
			<tr>
				<td class="{$myobj->getCSSFormLabelCellClass('description')}"><label for="description">{$LANG.add_details}</label></td>
				<td class="{$myobj->getCSSFormFieldCellClass('description')}">
					<textarea name="description" id="description" maxlength="{$CFG.admin.description.limit}" tabindex="{smartyTabIndex}" onFocus="updatelength(this);" onKeyUp="updatelength(this);">{$myobj->form_edit.description_manual}</textarea>
                    {$myobj->getFormFieldElementErrorTip('description')}
					<div>{$LANG.total_characters_entered} <span id="ss">0  ({$LANG.limit} {$CFG.admin.description.limit})</span></div>
				</td>
			</tr>
			{if chkIsVideoAllowed('debate')}
				<tr>
					<td class="{$myobj->getCSSFormLabelCellClass('video')}"><label for="video">{$LANG.debates_add_video_details}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('video')}">
						<div class="clsVideoUpload clsClearfix" id="video_first" {$myobj->form_edit.video.style_add_video}>
							<div class="clsVideoContainer">
							<a id="video_add" href="{$myobj->form_edit.video_upload_url}" onClick="{$myobj->getBrowser('video_add')}"></a>
		    				{$myobj->getFormFieldErrorTip('debate_video')}
							</div>
							<div class="clsVideoDetails">
								<a href="{$myobj->form_edit.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 $myobj->form_edit.video.style_add_video==''} style="display:none;" {/if}>
								<div class="clsAudioDetails clsAudioOptions">
									<div >
										<p class="clsAVDelete"><a {$myobj->form_edit.video.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 {$myobj->form_edit.video.style_preview_video} id="video_preview" href="{$myobj->form_edit.video.video_preview_url}" onClick="{$myobj->getBrowser('video_preview')}">{$LANG.preview_video}</a></p>
									</div>
								</div>
						</div>
						{$myobj->getFormFieldElementErrorTip('video')}
					</td>
				</tr>
			{/if}
			{if chkIsAudioAllowed('debate')}
				<tr>
				  <td class="{$myobj->getCSSFormLabelCellClass('audio')}"><label for="audio">{$LANG.debates_add_audio_details}</label></td>
				  <td class="{$myobj->getCSSFormFieldCellClass('audio')}">
					  <div class="clsAudioUpload clsClearfix" id="audio_first" {$myobj->form_edit.audio.style_add_audio}>
						<div class="clsAudioContainer">
							<a id="audio_add" href="{$myobj->form_edit.audio_upload_url}" onClick="{$myobj->getBrowser('audio_add')}"></a>
	    					{$myobj->getFormFieldErrorTip('audio')}
						</div>
						<div class="clsAudioDetails">
							<div>
								<a href="{$myobj->form_edit.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 $myobj->form_edit.audio.style_add_audio==''} style="display:none;" {/if}>
							<div class="clsAudioDetails clsAudioOptions">
								<div >
									<p class="clsAVDelete"><a {$myobj->form_edit.audio.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 {$myobj->form_edit.audio.style_preview_audio} id="audio_preview" href="{$myobj->form_edit.audio.audio_preview_url}"  onClick="{$myobj->getBrowser('audio_preview')}">{$LANG.preview_audio}</a></p>
								</div>
							</div>
						</div>
					  {$myobj->getFormFieldElementErrorTip('audio')}
				  </td>
				</tr>
			{/if}

		   	<tr id="selCategoryBlock">
				<td class="{$myobj->getCSSFormLabelCellClass('category')}"><label for="category">{$LANG.select_category_for_debate}</label></td>
				<td class="{$myobj->getCSSFormFieldCellClass('category')}">
								<div id="selGeneralCategory">
									{if $myobj->CFG.admin.debate_category.mandatory}
										<select name="category" id="category" tabindex="{smartyTabIndex}" onchange="addNewStatusMessage(this);return call_ajax_populate_sub_categories('{$CFG.site.url}{$CFG.admin.index.anova_module}/debate_ajax.php', 'new=1&amp;t={smartyTabIndex}','subCatDiv');" onBlur="manualLiveValidation(this);return false;">
										{else}
											<select name="category" id="category" tabindex="{smartyTabIndex}" onchange="addNewStatusMessage(this);return call_ajax_populate_sub_categories('{$CFG.site.url}{$CFG.admin.index.anova_module}/debate_ajax.php', 'new=1&amp;t={smartyTabIndex}','subCatDiv');" >
									{/if}

									<option value="">{$LANG.choose}</option>
                                    {$myobj->generalPopulateArray($myobj->categories_arr, $myobj->getFormField('category'))}
									<optgroup label="{$LANG.account_profile_status_new_optgroup}">
									<option value="add">{$LANG.account_profile_status_custom_add}</option>
									</optgroup>
									</select>
								</div>
								{$myobj->getFormFieldElementErrorTip('category','select')}
								<input type="hidden" name="new_status_hidden" id="new_status_hidden" />
								<div id="selGeneralCategory"></div>
							</td>
			</tr>
			<tr>
				<td class="{$myobj->getCSSFormLabelCellClass('sub_category')}"><label for="sub_category">{$LANG.select_sub_category_for_debate}</label></td>
				<td id="subCatDiv" class="{$myobj->getCSSFormFieldCellClass('sub_category')}">
								<div id="selGeneralCategory">
									<select name="sub_category" id="sub_category" tabindex="{smartyTabIndex}" onchange="addNewSubStatusMessage(this);">
									<option value="">{$LANG.choose}</option>
                                    {if $myobj->getFormField('category')}
	                                    {$myobj->generalPopulateArray($myobj->sub_categories_arr, $myobj->getFormField('sub_category'))}
                                    {/if}
									<optgroup label="{$LANG.account_profile_status_new_optsubgroup}">
									<option value="add">{$LANG.account_profile_status_custom_subadd}</option>
									</optgroup>
									</select>
								</div>
                                {$myobj->getFormFieldErrorTip('sub_category')}
								<input type="hidden" name="new_substatus_hidden" id="new_substatus_hidden" />
								<input type="hidden" name="option_length" id="option_length" value="{$myobj->populateSubCategoriesCount($myobj->getFormField('category'), $myobj->getFormField('sub_category'))}" />
							</td>
			</tr>
			<tr>
				<td class="{$myobj->getCSSFormLabelCellClass('tags')}"><label for="tags">{$LANG.tags_for_debates}</label></td>
				<td class="{$myobj->getCSSFormFieldCellClass('tags')}">
					<input type="text" class="clsTextBox" name="tags" id="tags" maxlength="250" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('tags')}" />
                    {$myobj->getFormFieldElementErrorTip('tags')}
				</td>
			</tr>
			{if $CFG.admin.response_publish_option.allowed and !$CFG.admin.debate_auto_publish.allowed}
                <tr>
                    <td class="{$myobj->getCSSFormLabelCellClass('publish')}"><label for="publish">{$LANG.debates_publish_all_responses}</label></td>
                    <td class="{$myobj->getCSSFormFieldCellClass('publish')}">
                        <input type="radio" name="publish" id="status_yes" value="Yes"{$myobj->isCheckedRadio('publish', 'Yes')} /><label for="status_yes">{$LANG.common_yes_option}</label>
                        <input type="radio" name="publish" id="status_no" value="No"{$myobj->isCheckedRadio('publish', 'No')} /><label for="status_no">{$LANG.common_no_option}</label>
                        {$myobj->getFormFieldElementErrorTip('publish')}
                    </td>
                </tr>
			{/if}

			<tr>
				<td class="{$myobj->getCSSFormFieldCellClass('submit')}" colspan="2">
					<input type="submit" class="clsSubmitButton" name="submit" id="submit" tabindex="{smartyTabIndex}" value="{$LANG.common_update}" />
					&nbsp;&nbsp;
					<input type="submit" class="clsSubmitButton" name="cancel" id="cancel" tabindex="{smartyTabIndex}" value="{$LANG.debates_cancel}" />
				</td>
			</tr>
		</table>
		<input type="hidden" name="did" value="{$myobj->getFormField('did')}" />
	</form>
{literal}
	<script language="javascript">
		var videoPreviewUrl = '{/literal}{$myobj->form_edit.video.video_preview_url}{literal}';
		var audioPreviewUrl = '{/literal}{$myobj->form_edit.audio.audio_preview_url}{literal}';
		needLiveValidation('subject',Array('Presence'));
{/literal}
		{if $myobj->CFG.admin.debate_description.mandatory}
			{literal}
				needLiveValidation('description',Array('Presence'));
			{/literal}
		{/if}
{literal}
	</script>
{/literal}
{/if}

{if $myobj->isShowPageBlock('show_form_search')}

		 <form name="searchDebatesForum" id="searchDebatesForum" method="post" action="{$myobj->getCUrrentUrl()}" autocomplete="off">
   			 <table class="clsCommonTable" summary="{$LANG.member_tbl_summary}">
				  <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('search_name')}"><label for="search_name">{$LANG.member_search_name}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('search_name')}">
					  <input type="text" class="clsTextBox" name="search_name" id="search_name" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('search_name')}" />{$myobj->getFormFieldElementErrorTip('search_name')}</td>
				  </tr>
				  <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('search_cat')}"><label for="search_cat">{$LANG.member_search_cat}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('search_cat')}">
					  <select class="clsCommonListBox" name="search_cat" id="search_cat" tabindex="{smartyTabIndex}" >
                        {$myobj->generalPopulateArray($myobj->populateSearchOptions_arr, $myobj->getFormField('search_cat'))}
					  </select>{$myobj->getFormFieldElementErrorTip('search_cat')}
					</td>
				  </tr>
				  <tr>
				  	<td class="{$myobj->getCSSFormFieldCellClass('submit')}">&nbsp;</td>
					<td class="{$myobj->getCSSFormFieldCellClass('submit')}">
						<input type="submit" class="clsSubmitButton" name="go" tabindex="{smartyTabIndex}" value="{$LANG.member_go}" />
						<input type="reset" class="clsCancelButton" name="cancel" tabindex="{smartyTabIndex}" value="{$LANG.common_reset}" />
					</td>
				  </tr>
				</table>
  </form>

{/if}
{if $myobj->isShowPageBlock('list_records')}

  <div id="selMsgConfirmlist" class="clsPopupConfirmation" style="display:none;position:absolute;">
      <p id="msgConfirmText"></p>
      <form name="msgConfirmform" id="msgConfirmform" method="post" action="{$myobj->getCUrrentUrl()}" autocomplete="off">
        <table class="clsCommonTable" summary="{$LANG.member_tbl_summary}">
          <tr>
          <tr>s
            <td>
		 	<input type="submit" class="clsSubmitButton" name="yes" id="yes" value="{$LANG.common_yes_option}" tabindex="{smartyTabIndex}" />
              	&nbsp;
              	<input type="button" class="clsCancelButton" name="no" id="no" value="{$LANG.common_no_option}" tabindex="{smartyTabIndex}" onClick="return hideAllBlocks();" />
              	<input type="hidden" name="act" id="act" />
              	<input type="hidden" name="did" id="did" />
              	<input type="hidden" name="debate_ids" id="debate_id" />
              	<input type="hidden" name="action" id="action" />
              	<input type="hidden" name="search_name" id="search_name" value="{$myobj->getFormField('search_name')}"/>
              	<input type="hidden" name="search_cat" id="search_cat" value="{$myobj->getFormField('search_cat')}" />
				{$myobj->populateHidden($myobj->list_records_confirm_arr)}
            </td>
          </tr>
        </table>
      </form>
  </div>




        {if $myobj->isResultsFound()}
         <form name="selMemberForum" id="selMemberForum" method="post" action="{$myobj->getCUrrentUrl()}" autocomplete="off">

            {if $CFG.admin.navigation.top}
                {include file='pagination.tpl'}
            {/if}

        <a href="#" id="dAltMlti"></a>
        <table class="clsCommonTable" summary="{$LANG.member_tbl_summary}" border="1">
          <tr>
            <th>&nbsp;<input type="checkbox" class="clsCheckRadio" id="checkall" onclick="selectAll(this.form)" name="checkall" tabindex="{smartyTabIndex}" /></th>
            <th  class="clsQuestions{$myobj->getOrderCss('subject')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','subject')">{$LANG.member_debates}</a></th>
            <th>{$LANG.member_category}</th>
            <th class="clsTags{$myobj->getOrderCss('tags')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','tags')">{$LANG.member_tags}</a></th>
			<th class="clsMembers{$myobj->getOrderCss('display_name')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','display_name')">{$LANG.member_name}</a></th>
            <th class="clsAnswers{$myobj->getOrderCss('total_fors')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','total_fors')">{$LANG.member_debates_for}</a></th>
            <th class="clsAnswers{$myobj->getOrderCss('total_againsts')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','total_againsts')">{$LANG.member_debates_against}</a></th>
            <th class="clsAbuse{$myobj->getOrderCss('abuse_count')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','abuse_count')">{$LANG.member_abuse_count}</a></th>
			<th class="clsDate{$myobj->getOrderCss('featured')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','featured')">{$LANG.member_feature}</a></th>
            <th class="clsPortCount{$myobj->getOrderCss('status')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','status')">{$LANG.member_status}</a></th>
            <th class="clsDate{$myobj->getOrderCss('date_asked')}"><a href="#" onclick="return changeOrderbyElements('selMemberForum','date_asked')">{$LANG.member_date_asked}</a></th>
            <th>{$LANG.manage}</th>
          </tr>


            {foreach key=lrKey item=lrValue from=$myobj->list_records}

                  <tr>
                    <td class="clsSelectAllMember"><input type="checkbox" class="clsCheckRadio" name="debate_ids[]" tabindex="{smartyTabIndex}" value="{$lrValue.debate_id}" /></td>
                    <td>
                        <a href="{$CFG.site.relative_url}viewDebates.php?did={$lrValue.debate_id}">{$lrValue.subject}</a>
                        {if chkIsVideoAllowed('debate') and $lrValue.video_id}
                            <span><a id="video_add{$lrValue.debate_id}" href="{$lrValue.ans_view_video.url}" onClick="{$myobj->getBrowser($lrValue.ans_view_video.on_click)}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/root/images/{$CFG.html.stylesheet.screen.default}/icon-qusvideo.gif" alt="{$LANG.debates_video_available}" /></a></span>
                        {/if}
                        {if chkIsAudioAllowed('debate') and $lrValue.audio_id}
                            <span><a id="audio_add{$lrValue.debate_id}" href="{$lrValue.ans_view_audio.url}" onClick="{$myobj->getBrowser($lrValue.ans_view_audio.on_click)}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/root/images/{$CFG.html.stylesheet.screen.default}/icon-qusaudio.gif" alt="{$LANG.debates_audio_available}" /></a></span>
                        {/if}
                    </td>
                    <td>{$lrValue.getCategoryName}</td>
                    <td>{$lrValue.tags}</td>
                    <td>{$lrValue.display_name_manual}</td>
                    <td>
                        {$lrValue.total_fors}<p>
                        {if chkIsVideoAllowed('debate') and $lrValue.total_videos > 0}
                            <span><a href="{$CFG.site.relative_url}viewDebates.php?did={$lrValue.debate_id}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/root/images/{$CFG.html.stylesheet.screen.default}/icon-qusvideo.gif" alt="{$LANG.debates_video_available}" /></a></span>
                        {/if}
                        {if chkIsAudioAllowed('debate') and $lrValue.total_audios > 0}
                            <span><a href="{$CFG.site.relative_url}viewDebates.php?did={$lrValue.debate_id}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/root/images/{$CFG.html.stylesheet.screen.default}/icon-qusaudio.gif" alt="{$LANG.debates_audio_available}" /></a></span>
                        {/if}</p>
                    </td>
                   <td>
                        {$lrValue.total_againsts}<p>
                        {if chkIsVideoAllowed('debate') and $lrValue.total_videos > 0}
                            <span><a href="{$CFG.site.relative_url}viewDebates.php?did={$lrValue.debate_id}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/root/images/{$CFG.html.stylesheet.screen.default}/icon-qusvideo.gif" alt="{$LANG.debates_video_available}" /></a></span>
                        {/if}
                        {if chkIsAudioAllowed('debate') and $lrValue.total_audios > 0}
                            <span><a href="{$CFG.site.relative_url}viewDebates.php?did={$lrValue.debate_id}"><img src="{$CFG.site.url}design/templates/{$CFG.html.template.default}/root/images/{$CFG.html.stylesheet.screen.default}/icon-qusaudio.gif" alt="{$LANG.debates_audio_available}" /></a></span>
                        {/if}</p>
                    </td>
                    <td>{$lrValue.abuse_count}</td>
                    <td>
						{if $lrValue.featured == 0}
							{$LANG.debate_no}
							{else}
								{$LANG.debate_yes}
						{/if}
					</td>
                    <td class="clsPortCount">{$lrValue.status}</td>
                    <td>
                            {if $lrValue.date_asked}
                                {$myobj->getTimeDiffernceFormat($lrValue.date_asked)}
                            {/if}
                    </td>
                    <td>
                        <div><a href="manageDebates.php?did={$lrValue.debate_id}">{$LANG.common_edit}</a></div>
                        {*if chkIsVideoAllowed('debate') and $lrValue.video_id*}
                            <!--<div><a id="{$lrValue.anchor}"  href="#" title="{$LANG.delete_video}" onClick="return Confirmation( 'selMsgConfirm', 'msgConfirmform', Array('act', 'action', 'did', 'msgConfirmText'), Array('deletevideo', '', '{$lrValue.video_id}', '{$LANG.delete_video_confirmation}'), Array('value', 'value', 'value', 'innerHTML'));">{$LANG.delete_video}</a></div>-->
                        {*/if*}
                        {*if chkIsAudioAllowed('debate') and $lrValue.audio_id*}
                            <!--<div><a id="{$lrValue.anchor}"  href="#" title="{$LANG.delete_audio}" onClick="return Confirmation('selMsgConfirm', 'msgConfirmform', Array('act', 'action', 'did', 'msgConfirmText'), Array('deleteaudio', '', '{$lrValue.audio_id}', '{$LANG.delete_audio_confirmation}'), Array('value', 'value', 'value', 'innerHTML'));">{$LANG.delete_audio}</a></div>-->
                        {*/if*}
                    </td>
                  </tr>

            {/foreach}

              <tr>
                <td colspan="12"  class="{$myobj->getCSSFormFieldCellClass('submit')}">
                    <select class="clsCommonListBox" name="action" id="action" tabindex="{smartyTabIndex}" >
                        {$myobj->generalPopulateArray($myobj->action_arr, $myobj->getFormField('action'))}
                  </select>
                  &nbsp;
                  <input type="button" class="clsSubmitButton" name="todo" id="todo" onclick="getMultiCheckBoxValue('selMemberForum', 'checkall', '{$LANG.select_a_debate}');if(multiCheckValue!='')getAction()" value="{$LANG.member_go}" tabindex="{smartyTabIndex}" />
                </td>
              </tr>
            </table>
			{$myobj->populateHiddenFormFields($myobj->list_records_confirm_arr)}
            {if $CFG.admin.navigation.bottom}
                {include file='pagination.tpl'}
            {/if}

</form>

    {else}
          <div id="selMsgAlert">
                <p>{$LANG.common_no_records_found}</p>
          </div>
    {/if}

{/if}


</div>