{include file="$admingentemplates/admin_top.tpl"}
<div class="back">
    <a href="{$site_url}{$site_root}/admin/admin_reference.php?ref={$ref}&page={$page}">{$lang.button.back}</a>
</div>
<div class="cr"></div>
<div class="show_help" style="display: none;">&nbsp;</div>
<div class="red_header">{$header.list_option}</div>
<div class="cr">&nbsp;</div>
<div class="cr">&nbsp;</div>
<div class="help_text" style="display:block;">
    <div class="close_help">
        <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
    </div>
    <div class="help_body">
        <span class="help_title">{$lang.help}:</span>{$lang.builder.help_list_answers}
    </div>
</div>
<div id="tooltip" onclick="hideToolTip()" style="text-align:center; background-color: #FFFFFF; border: 1px dotted; text-align: {$default_left}; position:absolute; display:none; padding:5px;"></div>
{literal}
<script type="text/javascript">
$(function() {
$('#tool_tip_4 *').tooltip();
});
</script>
{/literal}
<form method="POST" action="admin_reference.php" name="add_new_answer">
<input type="hidden" name="sel" value="addcustopt">
<input type="hidden" name="ref" value="{$ref}">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="page" value="{$page}">

<table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
        <td colspan=3 align="left" class="sg_subheader"><font class="user_status_elem" style="padding-left:0px;">{$lang.ref.add_answer}</font></td>
    </tr>
    {if $form.err}
    <tr >
        <td height="200%" colspan="3" align="left" class="main_error_text">{$form.err}</td>
    </tr>
    {/if}
    <tr >
        <td align="left" width="1%" nowrap class="main_header_text" style="padding-left:0px;">{$lang.ref.new_answer}:&nbsp;</td>
        <td class="main_content_text" align="left">
            <input style="width: 400px;" type="text" name="name" value="" size=60>
        </td>
        <td align="left" width="99%" style="padding-left: 10px;">
            <a class="admin_button_major" onclick="document.add_new_answer.submit();" >{$button.add}<span>&nbsp;</span></a>
        </td>
    </tr>
</table>
</form>
<br>
<form method="POST" action="admin_reference.php" name="variants">
    <input type="hidden" name="sel" value="savecustoption">
    <input type="hidden" name="ref" value="{$ref}">
    <input type="hidden" name="id" value="{$id}">
    <input type="hidden" name="page" value="{$page}">
    <table border=0 cellspacing=0 cellpadding=5 width="100%">
    <tr class="table_header">
        <td align="left" width="10">{$header.number}</td>
        <td  align="center">{$lang.ref.options}</td>
        <td  align="right" width="100">{$lang.users.actions}</td>
    </tr>
    {strip}
    {if $references}
        {section name=spr loop=$references}
        <tr {if $smarty.section.spr.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
            <td align="left">{$references[spr].num}</td>
            <td align="center"><input style="width: 400px;" name="values[]" type="text" value="
                {assign var="name_for_lang" value=$references[spr].name_for_lang}
                {if $lang.usersprval[$name_for_lang] ne ''}{$lang.usersprval[$name_for_lang]}{else}{$name_for_lang}{/if}">
                <input type="hidden" name="name_for_lang[]" value="{$name_for_lang}">
            </td>
            <td align="right" width="100">
                <div class="block_action" style="float:center;">  
                    <img src="{$site_root}{$template_root}/images/photo_delete.png" onmouseout="javascript:hideToolTip();" onmouseover="javascript: showToolTip(event,'{$lang.button.delete}');return false" alt="" height="13" style="cursor: pointer;" onclick="javascript: location.href='{$references[spr].dellink}'" />                                    
                </div>
            </td>
        </tr>
        {/section}
    {else}
        <tr height="40">
        <td class="main_error_text" align="left" colspan="4" bgcolor="#FFFFFF">{$header.empty_option}</td>
    </tr>
    {/if}
	<tr class="table_header"><td colspan="3">&nbsp;</td></tr>
    {/strip}
    </table>
    <a class="admin_button_major" onclick="javascript: document.variants.submit();" >{$button.save}<span>&nbsp;</span></a>
</form>

<form method="POST" action="admin_reference.php" name="add_form">
<input type="hidden" name="sel" value="savetemplate">
<input type="hidden" name="ref" value="{$ref}">
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="page" value="{$page}">

<table border=0 cellspacing="0" cellpadding="0" width="100%">
    <tr>
        <td colspan=2 align="left" class="sg_subheader"><font class="user_status_elem" style="padding-left: 0px;">{$lang.ref.selecttype}&nbsp;</font></td>
    </tr>
    <tr>
        <td class="main_content_text" align="left" width="85%" style="padding-left: 0px;">
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                {section name=exm loop=$examples}
                <tr {if $smarty.section.exm.index mod 2 eq 1}class="even"{else}class="odd"{/if}>
                    <td width="200px" valign="top" style="padding-top:5px;padding-bottom:5px;">
                        <input {if ($examples[exm].count < 7 && $references[0].num eq 0)}disabled{/if} name="input_type" {if $examples[exm].count eq $template_number}checked{/if} type="radio" value="{$examples[exm].count}">&nbsp;{$examples[exm].descr}
                    </td>
                    <td align="left" style="padding-top:5px;padding-bottom:5px;">
                        {$examples[exm].html}
                    </td>
                </tr>
                {/section}
            </table>
        </td>
    </tr>
    <tr >
        <td colspan="2">
            <a class="admin_button_major" onclick="document.add_form.submit();" >{$button.save}<span>&nbsp;</span></a>
        </td>
    </tr>
</table>
</form>
<script type="text/javascript">
{literal}
		function showToolTip(e,text){
			if(document.all)e = event;
			var obj = document.getElementById('tooltip');
			obj.innerHTML = text;
			obj.style.display = 'block';
			var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
			if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
			var leftPos = e.clientX - $('#tooltip').width()-10;
			if(leftPos<0)leftPos = 0;
			obj.style.left = leftPos + 'px';
			obj.style.top = e.clientY - obj.offsetHeight -10 + st + 'px';
		}
		function hideToolTip(){
			document.getElementById('tooltip').style.display = 'none';
		}
{/literal}		
</script>
{include file="$admingentemplates/admin_bottom.tpl"}