{if $ajax eq 0}
{include file="$admin_nl_gentemplates/admin_nl_site_head.tpl"}
{/if}
<div style="height:4px;font-size:0px;" class="user_operation_line"></div>
<div class="cr"></div>
	<div class="user_status_line">
        <div id="tab_1" class="user_status_elem" onclick="ShowEditor('1','settings.php?ajax=1');">
            <a>{$lang.admin_menu.nl_general}</a>
        </div>
        <div id="tab_2" class="user_status_elem" onclick="ShowEditor('2','template/index.php?ajax=1');">
            <a>{$lang.admin_menu.nl_templates}</a>
        </div>
        <div id="tab_3" class="user_status_elem_active" onclick="ShowEditor('3','forms/index.php?ajax=1');">
            {$lang.admin_menu.nl_forms}
        </div>
        <div id="tab_4" class="user_status_elem" onclick="ShowEditor('4','attaches/index.php?ajax=1');">
            <a>{$lang.admin_menu.nl_attachments}</a>
        </div>
        <div id="tab_5" class="user_status_elem" onclick="ShowEditor('5','smtp_servers/index.php?ajax=1');">
            <a>{$lang.admin_menu.nl_smtp_servers}</a>
        </div>
        <div class="cr"></div>
        <div class="panel_subtabs" style="width: 100%">
        	<div class="panel_content" style="width: 97%">
<div style="border:0px;">
<div class="panel_content" style="margin-bottom:0px;margin-left: 0px;">
	<FORM id="myform" name="myform" class="myform" action="forms/create3.php?ajax=1&id={$form.id}" method="post" style="margin:0px">
	
		<div class="fl newletter_export"><font color="red">*</font> {$lang.newsletter.forms.form_name}:&nbsp;</div>
		<div class="fl">
			<INPUT type="text" name="FormName" class="inpBox" style="width: 250 px;" maxlength="100" value="{$name}">
			&nbsp;<A onmouseover=doTooltip(event,37) onmouseout=hideTip() href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
		</div>
	
		<div class="cr">&nbsp;</div>
		<div class="fl newletter_export"><font color="red">*</font> {$lang.newsletter.forms.require_confirm}:&nbsp;</div>
		<div class="fl">
			<SELECT class="inpBox" name="RequireConfirm" size="1" >
			<OPTION value="0">{$lang.newsletter.no}</OPTION>
			<OPTION value="1" >{$lang.newsletter.yes}</OPTION>
			</SELECT>
			&nbsp;<A onmouseover=doTooltip(event,38) onmouseout=hideTip() href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
		</div>
	
		<div class="cr">&nbsp;</div>
		<div class="fl newletter_export"><font color="red">*</font> {$lang.newsletter.forms.send_thankyou}:&nbsp;</div>
		<div class="fl">
			<SELECT class="inpBox" name="SendThankyou" size="1" >
			<OPTION value="0" >{$lang.newsletter.no}</OPTION>
			<OPTION value="1" >{$lang.newsletter.yes}</OPTION>
			</SELECT>
			&nbsp;<A onmouseover=doTooltip(event,39) onmouseout=hideTip() href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
		</div>
	
		<div class="cr">&nbsp;</div>
		<div class="fl newletter_export"><font color="red">*</font> {$lang.newsletter.forms.lists_to} {if $FormType == 'sub'}{$lang.newsletter.forms.subscribe}{else}{$lang.newsletter.forms.subscribe}{/if} {$lang.newsletter.forms.to}:&nbsp;</div>
	

		{section name=c loop=$list}
		<div class="cr">&nbsp;</div>
			<div class="fl newletter_export">&nbsp;&nbsp;&nbsp;{$list[c].name}:&nbsp;</div>
			<div class="fl">
				<input type="checkbox" id="c_{$list[c].num}" name="Lists[]" value="{$list[c].id}" {if $list[c].id == $lid} checked{/if}>&nbsp;Yes
				&nbsp;<A onmouseover=doTooltip(event,40) onmouseout=hideTip() href="#"><IMG src="{$site_root}{$template_root}/images/newsletter/icot.gif" width="12" height="12" border=0 align="absmiddle"></A>
			</div>
		{/section}
		<input type="hidden" name="FormType" value="{$FormType}">

	</form>
</div>
</div>
</div>
</div>
		<div class="cr">&nbsp;</div>
		<div>
			<a style="float:left;" class="admin_button_major" onclick="javascript:if (CheckForm())submit();">{$lang.newsletter.button.to_step_3}<span>&nbsp;</span></a>	
			<a style="float:left;margin-top:12px;margin-left:10px;" onClick="{literal}if(confirm('Are you sure?')) { ShowBlock('show_block','forms/index.php?ajax=1'); }{/literal}">{$lang.newsletter.button.cancel}<span>&nbsp;</span></a>
		</div>
{literal}
                <script language="JavaScript">
			var options = { 
				success: function(data){
					ajaxLoadingImage(0, 'show_block');
					$('#show_block').html(data);
					/*$('#show_block').oneTime(3000, function() {
						$('#show_block').fadeOut(500);
					});*/
					return false;
				},
				beforeSubmit: function() { 
					//ajaxIndicator(1, 'show_block');
					ajaxLoadingImage(1, 'show_block');
				}
			};
			function submit(){
					$('.myform').ajaxSubmit(options);
			}
                    function PreparePreview(){
					TemplateID = document.getElementById("TemplateID").options[document.getElementById("TemplateID").selectedIndex].value;
                        window.open("index.php" + TemplateID , "pp");
                    }
                    function CheckForm(){
                        var f = document.forms[0];

                        if(f.FormName.value == ""){
                            alert("{/literal}{$lang.newsletter.forms.alert_enter_name|escape:javascript}{literal}");
                            f.FormName.focus();
                            return false;
                        }
                        var numLists = 0;
{/literal}
                        for (i=0;i<{$listcount};i++) 
{literal}
                        {
                        if(eval('f.c_'+i).checked)
                            numLists++;
                        }
                        if(numLists == 0){
                            alert("{/literal}{$lang.newsletter.forms.choose_mail_list|escape:javascript}{literal}");
                            return false;
                        }
                        return true;
                    }
                </script>

{/literal}
{if $ajax eq 0}
{include file="$admin_nl_gentemplates/admin_nl_site_foot.tpl"}
{/if}