
<script language="javascript" type="text/javascript">
<!--
{include file="$incpath/other/validate_js.tpl"}

$.validator.setDefaults({ldelim}
	submitHandler: function() 
	{ldelim}
		document.forms['nlform'].submit();
		var message = '<h2>{#Global_Wait#}</h2>';
		jQuery.blockUI({ldelim} message: message{rdelim}); 
		setTimeout(jQuery.unblockUI, 2000); 
	{rdelim}
});

$().ready(function() 
{ldelim}
	$("#nlform").validate({ldelim}
	rules: {ldelim}
				absname: {ldelim}required: true{rdelim},
				absmail: {ldelim}required: true,email:true{rdelim},
				betreff: {ldelim}required: true{rdelim}
			{rdelim}, 
	messages: 
			{ldelim}
			{rdelim}
	{rdelim});
{rdelim});

$(function() {ldelim}
	 $('#container-options ul').tabs({ldelim} {rdelim});
	 $('div.textv').toggleElements( {ldelim} fxAnimation:'false', fxSpeed:'normal', className:'toggler'{rdelim} );
	 $('div.htmlv').toggleElements( {ldelim} fxAnimation:'true', fxSpeed:'normal', className:'toggler'{rdelim} );
{rdelim});


function getEditorValue( instanceName )
{ldelim}
	var oEditor = FCKeditorAPI.GetInstance( instanceName ) ;
	return oEditor.GetXHTML( true ) ; // "true" means you want it formatted.
{rdelim}

function setEditorValue( instanceName, text )
{ldelim}
	var oEditor = FCKeditorAPI.GetInstance( instanceName ) ;
	oEditor.InsertHtml( text ) ;
{rdelim}
// -->
</script>

<div class="popbox">

<form name="nlform" id="nlform" action="index.php?do=newsletter&amp;sub=new&amp;to={$smarty.request.to}&amp;area={$area}&amp;noframes=1" method="post" enctype="multipart/form-data" style="display:inline;" onsubmit="">

<div class="header"> {#NewsletterNew#}</div>
<table width="100%"  border="0" cellpadding="4" cellspacing="0" class="tableborder">
{if $smarty.request.to=='groups'}
<tr>
  <td valign="top" nowrap="nowrap" class="row_left">{#Newsletter_SelGroups#}</td>
  <td class="row_right">
  <table>
  <tr>
  {foreach from=$UserGroups item=cb name=gr}
  {if $cb->Id!=2}
  {assign var=break value=$break+1}
  <td>
    <label><input type="checkbox" name="ToCateg[{$cb->Id}]" {if $smarty.foreach.gr.first}checked="checked"{/if}>{$cb->Name_Intern}</label>
   </td>
   {if $break%4==0}
   </tr><tr>
   {/if}
   {/if}
    {/foreach}
    </tr>
   </table>
  </td>
</tr>
{else}
<tr>
<td width="20%" valign="top" nowrap="nowrap" class="row_left">{#Newsletter_SelCateg#}</td>
<td class="row_right">
{foreach from=$NewsletterCategs item=cb}
<input type="checkbox" name="ToCateg[{$cb->Id}]" checked>{$cb->Name}<br />
{/foreach}
</td>
</tr>
{/if}
<tr>


<td width="20%" nowrap="nowrap" class="row_left"> {#Newsletter_AbsName#}</td>
<td class="row_right">
<input class="input" type="text" name="absname" id="absname" value="{$smarty.session.user_name}" style="width:250px" size="32" /></td>
</tr>
<tr>
<td width="20%" nowrap="nowrap" class="row_left">{#Newsletter_AbsEmail#}</td>
<td class="row_right">
<input class="input" type="text" name="absmail" id="absmail" value="{$smarty.session.login_email}" style="width:250px" size="32" /></td>
</tr>
<tr>
<td width="20%" nowrap="nowrap" class="row_left"> {#Newsletter_NlSubject#}</td>

<td class="row_right">
<input class="input"  type="text" name="betreff" id="betreff"  value="{$DefSubject}" style="width:250px" size="32" /></td>
</tr>
</table>

<div class="subheaders">{#Newsletter_PathWarn#}</div>

<div id="container-options">
<ul>
<li><a href="#opt-1"><span>{#Newsletter_TabNl#}</span></a></li>
<li><a href="#opt-2"><span>{#Newsletter_TabAttach#}</span></a></li>
</ul>
</div>

<div id="opt-1">
{$HtmlV}
<br />
<select class="input" onchange="eval(this.options[this.selectedIndex].value);selectedIndex=0;">
<option value="">- {#Newsletter_InsertElems#} -</option>
<option value="setEditorValue('htmlversion','[NEWS:5]')">{#Newsletter_InsertLastNews#}</option>
<option value="setEditorValue('htmlversion','[GALLERY:5]')">{#Newsletter_InsertLastGals#}</option>
{if $is_pro==1}
<option value="setEditorValue('htmlversion','[SHOP:5]')">{#Newsletter_InsertLastShop#}</option>
{/if}
</select>
    
</div>

<div id="opt-2">
 {section name=attach loop=5} 
  <p>#{$smarty.section.attach.index+1} <input class="input" name="files[]" type="file" id="files[]" size="40" /></p>
  {/section}
</div>

<input name="delattach" type="hidden" id="delattach" value="0" />
<input name="to" type="hidden" id="to" value="{$smarty.request.to}">
  <input name="nltype" type="hidden" id="nltype" value="{$smarty.request.to}" />
  <input name="area" type="hidden" id="area" value="{$area}">
  <input name="send" type="hidden" id="send" value="1" />
<input name="nlsend" type="submit" class="button" id="nlsend" value="{#Newsletter_Button#}" />
<input type="button" class="button" value="{#Close#}" onclick="window.close()" />
</form>
</div>