<div id="selListAll">
	<h2 class="clsManageAnswers">{$LANG.editmembers_title}</h2>
	{include file='../general/information.tpl'}
	{if $myobj->isShowPageBlock('form_settings')}
		<p><a href="viewMembers.php?uid={$myobj->getFormField('uid')}">{$LANG.view_this_member}</a></p>
		<p>&nbsp;</p>
		 {if $myobj->getFormField('name') eq $CFG.user.not_allowed }
		 	{$LANG.twitter_user}
		 {/if}
		<form name="form_edit_settings" id="form_edit_settings" enctype="multipart/form-data" method="post" action="{$myobj->getCurrentUrl(true)}" autocomplete="off">
			<table summary="{$LANG.editmembers_tbl_summary}" class="clsManageSettings">
			  <tr>
				<th colspan="2">{$LANG.common_account_details}</th>
			  </tr>

			  {if (!$CFG.admin.module.facebook or !$myobj->isFacebookUser($myobj->getFormField('uid'))) && ($myobj->getFormField('name') neq $CFG.user.not_allowed)}
			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('email')}">
				  <label for="email">{$LANG.common_user_email}</label>{$myobj->ShowHelpTip('email')}</td>
				<td class="{$myobj->getCSSFormFieldCellClass('email')}">
				  {if $myobj->chkIsNingUser($myobj->getFormField('uid'))}
				    <input type="text" class="clsTextBox {$myobj->getCSSFormFieldElementClass('email')}" name="email" id="email" title="{$myobj->getFormField('email')}" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('email')}" readonly="readonly" />{$myobj->getFormFieldElementErrorTip('email')}</td>
				  {else}
				  	<input type="text" class="clsTextBox {$myobj->getCSSFormFieldElementClass('email')}" name="email" id="email" title="{$myobj->getFormField('email')}" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('email')}" />{$myobj->getFormFieldElementErrorTip('email')}</td>
				  {/if}
			  </tr>
			  {/if}

			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('display_name')}">
				  <label for="display_name">{$LANG.common_display_name}</label>
				  <span id="selCompulsoryField">*</span>{$myobj->ShowHelpTip('display_name')}</td>
				<td class="{$myobj->getCSSFormFieldCellClass('display_name')}">
				<input type="text" class="clsTextBox {$myobj->getCSSFormFieldElementClass('display_name')}" name="display_name" id="display_name" maxlength="{$CFG.admin.display_name_max_size}" title="{$myobj->ShowToolTip('display_name')}"  tabindex="{smartyTabIndex}" value="{$myobj->getFormField('display_name')}" />{$myobj->getFormFieldElementErrorTip('display_name')}</td>
			  </tr>

			  {if (!$CFG.admin.module.facebook or !$myobj->isFacebookUser($myobj->getFormField('uid'))) && (!$myobj->chkIsNingUser($myobj->getFormField('uid'))) && ($myobj->getFormField('name') neq $CFG.user.not_allowed)}
			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('password')}">
				  <label for="password">{$LANG.signup_password}</label>{$myobj->ShowHelpTip('password')}</td>
				<td class="{$myobj->getCSSFormFieldCellClass('password')}">
				  <input type="password" class="clsTextBox {$myobj->getCSSFormFieldElementClass('password')}" name="password" id="password" title="{$myobj->ShowToolTip('password')}" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('password')}" />{$myobj->getFormFieldElementErrorTip('password')}</td>
			  </tr>
			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('confirm_password')}">
				  <label for="confirm_password">{$LANG.common_confirm_password}</label>{$myobj->ShowHelpTip('confirm_password')}
			    </td>
				<td class="{$myobj->getCSSFormFieldCellClass('confirm_password')}">
				  <input type="password" class="clsTextBox {$myobj->getCSSFormFieldElementClass('confirm_password')}" name="confirm_password" id="confirm_password" title="{$myobj->ShowToolTip('confirmpassword')}" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('confirm_password')}" />{$myobj->getFormFieldElementErrorTip('confirm_password')}</td>
			  </tr>
			  {/if}

			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('gender')}">
				  <label for="sex_male">{$LANG.common_gender}</label>{$myobj->ShowHelpTip('sex_male')}</td>
				<td class="{$myobj->getCSSFormFieldCellClass('gender')}">
					<input type="radio" name="gender" id="sex_male" value="Male"  {$myobj->isCheckedRadio('gender','Male')} />{$LANG.common_male_option}
					<input type="radio" name="gender" id="sex_female" value="Female" {$myobj->isCheckedRadio('gender','Female')} />{$LANG.common_female_option}
					{$myobj->getFormFieldElementErrorTip('gender')}
				</td>
			  </tr>
			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('user_access')}">
				  <label for="user_access_user">{$LANG.common_user_access}</label>
	                {$myobj->ShowHelpTip('user_access', 'user_access_user')}
                </td>
				<td class="{$myobj->getCSSFormFieldCellClass('user_access')}">
					<input type="radio" name="user_access" id="user_access_admin" value="Admin" {$myobj->isCheckedRadio('user_access', 'Admin')} />{$LANG.common_user_access_admin}
					<input type="radio" name="user_access" id="user_access_user" value="User" {$myobj->isCheckedRadio('user_access', 'User')} />{$LANG.common_user_access_user}
					{$myobj->getFormFieldElementErrorTip('user_access')}
				</td>
			  </tr>
			  <tr>
				<td class="{$myobj->getCSSFormLabelCellClass('bio')}"><label for="bio">
				  {$LANG.common_bio}</label>{$myobj->ShowHelpTip('bio')}</td>
				<td class="{$myobj->getCSSFormFieldCellClass('bio')}">
				  <p>{$LANG.common_allowed_htmltags} {$htmlspecialchars}</p>
					<textarea name="bio" id="bio" rows="5"  maxlength="{$CFG.admin.bio_count}" tabindex="{smartyTabIndex}" onFocus="updatelength(this);" onKeyUp="updatelength(this);">{$myobj->getFormField('bio')}</textarea>{$myobj->getFormFieldElementErrorTip('bio')}
					<div id="ss" class="clsZeroColour"><span> {$LANG.header_remainig} : </span> <span class="clsCharacterLimit">{literal}<script language="javascript" type="text/javascript">var c = bio_count - document.getElementById('bio').value.length;document.write(c);</script>{/literal}</span></div>
				</td>
			  </tr>
			   <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('subscribe_keywords')}"><label for="subscribe_keywords">{$LANG.editmembers_subscribe_keywords}</label>{$myobj->ShowHelpTip('subscribe_keywords')}</td>
					<td class="{$myobj->getCSSFormFieldCellClass('subscribe_keywords')}">
						<input type="text" class="clsTextBox" name="subscribe_keywords" id="subscribe_keywords" maxlength="250" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('subscribe_keywords')}" />{$myobj->getFormFieldElementErrorTip('subscribe_keywords')}
						<p>{$LANG.editmembers_subscribe_keywords_info |cat:' '|$LANG.tag_size}</p>
					</td>
			   </tr>
			    {if !$CFG.admin.module.facebook or !$myobj->isFacebookUser($myobj->getFormField('uid'))}
				{if isUserImageAllowed()}
				<tr>
					<td class="clsFormFieldCellDefault"></td>
					<td class="clsFormFieldCellDefault">
						<div id="selUserImage">
						{if ($user_details_arr.photo_server_url AND $user_details_arr.photo_ext) OR ($user_details_arr.image_path)}
							<p id="selImageBorder">{$myobj->displayProfileImage($user_details_arr, 'small' , false)}</p>
						{/if}
						</div>
					</td>
				</tr>
			   <tr>
				{if $CFG.admin.use_profile_external_image}
					<td class="{$myobj->getCSSFormLabelCellClass('image_path')}">{$myobj->getFormField('image_path')}<label for="image_path">{$LANG.editmembers_image_path}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('image_path')}">
						<p><input type="text" class="clsTextBox" name="image_path" id="image_path" tabindex="{smartyTabIndex}" value="{$myobj->getFormField('image_path')}" />{$myobj->getFormFieldElementErrorTip('image_path')}</p>
						<p>{$LANG.editmembers_image_path_info}</p>
					</td>
					{else}
					<td class="{$myobj->getCSSFormLabelCellClass('photo')}"><label for="photo">{$LANG.upload_photo}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('photo')}">
						<input type="file" class="clsFileBox" name="photo" id="photo" tabindex="{smartyTabIndex}" />{$myobj->getFormFieldElementErrorTip('photo')}
						<p>{$var_size_photo}</p>
						<p>{$photo_allowed_image_type}</p>
					</td>
				{/if}
			   </tr>
			   <tr>
					<td colspan="2" class="clsVerticalAlign {$myobj->getCSSFormLabelCellClass('avatar')}">{$LANG.select_avartar}</td>
			   </tr>
			   <tr>
					<td colspan="2" class="{$myobj->getCSSFormFieldCellClass('avatar')}"><div id="selShowAvatarImages"></div></td>
			   </tr>
			   {/if}
			   {/if}
			   {if !$CFG.admin.module.facebook or !$myobj->isFacebookUser($myobj->getFormField('uid'))}
			   <tr>
					<td class="clsAllEmail"><label for="all_email_notification">{$LANG.editmembers_all_email_notification}</label></td>
					<td class="clsAllEmail"><p class="clsBgCheckBox"><input type="checkbox" name="all_email_notification" id="all_email_notification" onClick="checkAllMail(this.form);" tabindex="{smartyTabIndex}"  /></p></td>
			   </tr>
			   <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('keyword_mail')}"><label for="keyword_mail_yes">{$LANG.editmembers_keyword_mail}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('keyword_mail')}">
						<input type="radio" name="keyword_mail" id="keyword_mail_yes" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="Yes" {$myobj->isCheckedRadio('keyword_mail', 'Yes')} /><label for="keyword_mail_yes">{$LANG.common_yes_option}</label>
						<input type="radio" name="keyword_mail" id="keyword_mail_no" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="No" {$myobj->isCheckedRadio('keyword_mail', 'No')} /><label for="keyword_mail_no">{$LANG.common_no_option}</label>{$myobj->getFormFieldElementErrorTip('keyword_mail')}
					</td>
			   </tr>
			     <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('reply_mail')}"><label for="reply_mail_yes">{$LANG.editmembers_reply_mail}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('reply_mail')}">
						<input type="radio" name="reply_mail" id="reply_mail_yes" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="Yes" {$myobj->isCheckedRadio('reply_mail', 'Yes')} /><label for="reply_mail_yes">{$LANG.common_yes_option}</label>
						<input type="radio" name="reply_mail" id="reply_mail_no" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="No" {$myobj->isCheckedRadio('reply_mail', 'No')} /><label for="reply_mail_no">{$LANG.common_no_option}</label>{$myobj->getFormFieldElementErrorTip('reply_mail')}
					</td>
			   </tr>
			   <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('favorite_mail')}"><label for="favorite_mail_yes">{$LANG.editmembers_favorite_mail}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('favorite_mail')}">
						<input type="radio" name="favorite_mail" id="favorite_mail_yes" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="Yes" {$myobj->isCheckedRadio('favorite_mail', 'Yes')} /><label for="favorite_mail_yes">{$LANG.common_yes_option}</label>
						<input type="radio" name="favorite_mail" id="favorite_mail_no" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}"  value="No"  {$myobj->isCheckedRadio('favorite_mail', 'No')} /><label for="favorite_mail_no">{$LANG.common_no_option}</label>{$myobj->getFormFieldElementErrorTip('favorite_mail')}
					</td>
			   </tr>
			   <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('best_ans_mail')}"><label for="best_ans_mail_yes">{$LANG.editmembers_best_answer_mail}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('best_ans_mail')}">
						<input type="radio" name="best_ans_mail" id="best_ans_mail_yes" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="Yes" {$myobj->isCheckedRadio('best_ans_mail', 'Yes')} /><label for="best_ans_mail_yes">{$LANG.common_yes_option}</label>
						<input type="radio" name="best_ans_mail" id="best_ans_mail_no" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="No" {$myobj->isCheckedRadio('best_ans_mail', 'No')} /><label for="best_ans_mail_no">{$LANG.common_no_option}</label>{$myobj->getFormFieldElementErrorTip('best_ans_mail')}
					</td>
			   </tr>
			   <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('abuse_mail')}"><label for="abuse_mail_yes">{$LANG.editmembers_abuse_mail}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('abuse_mail')}">
						<input type="radio" name="abuse_mail" id="abuse_mail_yes" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="Yes" {$myobj->isCheckedRadio('abuse_mail', 'Yes')} /><label for="abuse_mail_yes">{$LANG.common_yes_option}</label>
						<input type="radio" name="abuse_mail" id="abuse_mail_no" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="No" {$myobj->isCheckedRadio('abuse_mail', 'No')} /><label for="abuse_mail_no">{$LANG.common_no_option}</label>{$myobj->getFormFieldElementErrorTip('abuse_mail')}
					</td>
			   </tr>
			   <tr>
					<td class="{$myobj->getCSSFormLabelCellClass('internal_mail')}"><label for="internal_mail_yes">{$LANG.editmembers_internal_mail}</label></td>
					<td class="{$myobj->getCSSFormFieldCellClass('internal_mail')}">
						<input type="radio" name="internal_mail" id="internal_mail_yes" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="Yes" {$myobj->isCheckedRadio('internal_mail', 'Yes')} /><label for="internal_mail_yes">{$LANG.common_yes_option}</label>
						<input type="radio" name="internal_mail" id="internal_mail_no" onClick="checkOnLoadMail(this.form, '_home');" tabindex="{smartyTabIndex}" value="No" {$myobj->isCheckedRadio('internal_mail', 'No')} /><label for="internal_mail_no">{$LANG.common_no_option}</label>{$myobj->getFormFieldElementErrorTip('internal_mail')}
					</td>
			   </tr>
			  {/if}
			   <tr>
				<td class="clsAllEmail"><label for="all_home_settings">{$LANG.index_block_settings}</label></td>
				<td class="clsAllEmail"><p class="clsBgCheckBox"><input type="checkbox" name="all_home_settings" id="all_home_settings" onClick="checkAllSettings(this.form, '_home');" tabindex="{smartyTabIndex}"  /></p></td>
			   </tr>
			   {$myobj->populateIndexPageFields($index_block_arr)}
				{foreach key=pifKey item=pifValue from=$populateIndexPageFields_arr}
                    <tr>
                        <td class="{$myobj->getCSSFormLabelCellClass($pifValue.value)}"><label for="{$pifValue.value}_yes">{$pifValue.label}</label></td>
                        <td class="{$myobj->getCSSFormFieldCellClass($pifValue.value)}">{$myobj->getFormFieldErrorTip($pifValue.value)}
                            <input type="radio" name="{$pifValue.value}" id="{$pifValue.value}_yes" onClick="checkOnLoadSettings(this.form, '_home');" tabindex="{smartyTabIndex}" value="yes" {$myobj->isCheckedRadio($pifValue.value, 'yes')} /><label for="{$pifValue.value}_yes">{$LANG.common_yes_option}</label>
                            <input type="radio" name="{$pifValue.value}" id="{$pifValue.value}_no" onClick="checkOnLoadSettings(this.form, '_home');" tabindex="{smartyTabIndex}"  value="no" {$myobj->isCheckedRadio($pifValue.value, 'no')} /><label for="{$pifValue.value}_no">{$LANG.common_no_option}</label>
                        </td>
                    </tr>
				{/foreach}
			   <tr>
					<td class="clsFormFieldCellDefault">&nbsp;</td>
					<td class="{$myobj->getCSSFormFieldCellClass('submit')}">
						<input type="submit" class="clsSubmitButton" name="editmembers_submit" id="submit" tabindex="{smartyTabIndex}" value="{$LANG.common_update}" />
						&nbsp;&nbsp;
						<input type="submit" class="clsCancelButton" name="editmembers_cancel" id="editmembers_cancel" tabindex="{smartyTabIndex}" value="{$LANG.common_cancel}" />
					</td>
			   </tr>
			</table>
			<input type="hidden" name="avatar" value="{$myobj->getFormField('avatar')}" />
			<input type="hidden" name="old_email" value="{$myobj->getFormField('old_email')}" />
			<input type="hidden" name="name" value="{$myobj->getFormField('name')}" />
		</form>
	{/if}
</div>
{literal}
	<script type="text/javascript" defer="defer">
		function checkOnLoadSettings(frm1)
			{
				var frmLength = frm1.elements.length;
				var is_ok = true;
				for ( var i=0; i<frmLength; i++)
					{
						if ( (frm1.elements[i].name.indexOf('_mail')==-1) && (frm1.elements[i].type == 'radio') && ($(frm1.elements[i]).name)!= 'gender' && ($(frm1.elements[i]).name)!= 'user_access' )
							{
								if($(frm1.elements[i]).value == 'no' && $(frm1.elements[i]).checked == true)
									{
										is_ok = false;
									}
							}
					}
				if(is_ok)
					$('all_home_settings').checked = true;
				else
					$('all_home_settings').checked = false;
				return true;
			}

	</script>
{/literal}
{if (!$CFG.admin.module.facebook or !$myobj->isFacebookUser($myobj->getFormField('uid'))) && ($myobj->getFormField('name') neq $CFG.user.not_allowed) }
	{literal}
		<script type="text/javascript" defer="defer">
			checkOnLoadMail(document.form_edit_settings);
			function checkOnLoadMail(frm)
				{
					var frmLength = frm.elements.length;
					var is_ok = true;
					for ( var i=0; i<frmLength; i++)
						{
							if ((frm.elements[i].name.indexOf('_mail')!=-1) && (frm.elements[i].type == 'radio'))
								{
									if($(frm.elements[i]).value == 'No' && $(frm.elements[i]).checked == true)
										{
											is_ok = false;
										}
								}
						}
					if(is_ok)
						$('all_email_notification').checked = true;
					else
						$('all_email_notification').checked = false;
					return true;
				}
			checkOnLoadSettings(document.form_edit_settings);
		</script>
	{/literal}
{/if}