<script language='javascript'>
        <!--//
        function myimage_onclick(counter){
            window.opener.xoopsGetElementById("user_avatar").options[counter].selected = true;
            showAvatar();
            window.opener.xoopsGetElementById("user_avatar").focus();
            window.close();
        }
        function showAvatar() {
            window.opener.xoopsGetElementById("avatar").src='<?php echo XOOPS_UPLOAD_URL;?>/' + window.opener.xoopsGetElementById("user_avatar").options[window.opener.xoopsGetElementById("user_avatar").selectedIndex].value;
        }
        //-->
</script>

<h4><{$smarty.const._MSC_AVAVATARS}></h4>
<form name="avatars" action="misc.php?action=avatars">
<{xoops_token form=$actionForm}>
<table witdh="100%">
  <tr>
    <{foreach key=key item=avatar from=$avatarsList}>
      <td>
        <img src="<{$smarty.const.XOOPS_UPLOAD_URL}>/<{$avatar.fileName}>" alt="<{$avatar.avatarName}>" title="<{$avatar.avatarName}>" style="padding:10px; vertical-align:top;" /><br />
        <{$avatar.avatarName}><br />
        <input name="myimage" type="button" value="<{$smarty.const._SELECT}>" onclick="myimage_onclick(<{$avatar.counter}>)" />
      </td>
      <{if $key && $key is div by 8}><tr></tr><{/if}>
    <{/foreach}>
  </tr>
</table>
</form>
