
<script language="javascript" src="{$jspath}/jvalidate.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!-- //
{include file="$incpath/other/validate_conf.tpl"}

$(document).ready(function() {ldelim}
	var validator = $("#cf").validate(
	{ldelim} 
		rules: 
		{ldelim}
			subject: {ldelim}required: true{rdelim},
			email: {ldelim}required: true, email:true{rdelim},
			body: {ldelim}required: true{rdelim},
			scode:{ldelim}required: true{if !get_active('img_captcha')},number:true, remote: "index.php?action=checkcode&p=comments"{/if}{rdelim}
		{rdelim},
		messages: 
		{ldelim}
			scode: {ldelim}remote:'{#Validate_wrong#}'{rdelim}
		{rdelim},
			
		submitHandler: function() 
		{ldelim}
			document.forms['f'].submit();
		{rdelim},
		
		success: function(label) 
		{ldelim}
			label.html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").addClass("checked");
		{rdelim}
	{rdelim});
{rdelim});


// -->
</script>

{if $not_logged==1}
<div class="popup_header">{$sname}</div>
<div class="popup_content" style="padding:5px">
<div class="popup_box">
{#Profile_Email_Error#}
</div>
</div>
<p align="center">
<input type="button" class="button" onclick="window.close();" value="{#WinClose#}" />
</p>
{else}
{if $smarty.request.mailsend==1 && !$error}
<div class="popup_header">{$sname}</div>
<table width="100%"  border="0" cellpadding="4" cellspacing="1" class="box_inner">
  <tr>
    <td width="10%" class="row_first"><div align="center">{#SendEmail_Ok#}<br />
        <br />
        <input onclick="window.close();" type="button" class="button" value="{#WinClose#}" />
    </div></td>
  </tr>
</table> 
{else}
<form id="cf" name="f" action="index.php" method="post">
<div class="popup_header">{$sname}</div>
<!--[if IE]> 
<br />
<![endif]-->
<div class="popup_content" style="padding:5px">
<div class="popup_box">
{if $error}
<div class="error_box">{$error}</div>
{/if}

<fieldset>
<legend>{#SendEmail_Email#}</legend>
<input name="email" type="text" class="input" style="width:98%" value="{$smarty.request.email|stripslashes|escape:html|default:$smarty.session.login_email}" maxlength="35" />
</fieldset>

<fieldset>
<legend>{#SendEmail_Title#}</legend>
<input name="subject" type="text" class="input" id="subject" style="width:98%" value="{$smarty.request.subject|stripslashes|escape:html}" maxlength="35" />
</fieldset>

<fieldset>
<legend>{#SendEmail_Body#}</legend>
<textarea class="input"  name="body" rows="8" style="width:98%">{$smarty.request.body|stripslashes|escape:html}</textarea>
</fieldset>


<fieldset>
<legend>{#Reg_SmallQ#}</legend>
  {#Reg_SmallH#}&nbsp;&nbsp;&nbsp;<strong style="font-size:130%">{$secureIMG}</strong> =
  <input class="input" name="scode" type="text" style="width:80px;font-size:17px;" value="{$smarty.request.scode|koobispecialchars}" maxlength="5" />
  {$codeerror_t}
</fieldset>

</div>
</div>
<p align="center">
<input type="submit" class="button" value="{#SendEmail_Send#}" />&nbsp;<input type="button" class="button" onclick="window.close();" value="{#WinClose#}" />
<input name="uid" type="hidden" value="{$smarty.request.uid}" />
<input name="p" type="hidden" value="misc" />
<input name="do" type="hidden" value="EMAIL" />
<input name="mailsend" type="hidden" value="1" />
</p>


</form>
{/if} 
{/if} 
