<div class="newletter-subscribe">
<div id="boxes" class="newletter-container">
 <div style="" id="dialog" class="window">
	<div class="box">
	  <div class="newletter-title"><h2>{{ heading_title  }}</h2></div>
	  <div class="box-content newleter-content">
			<label>{{ newletter_lable  }}</label>
		  <div id="frm_subscribe">
			  <form name="subscribe" id="subscribe">
				  <table>
					   <tr>
						 <td><span class="required">*</span><span>{{ entry_email  }}</span><input type="text" value="" name="subscribe_email" id="subscribe_email">
						 <input type="hidden" value="" name="subscribe_name" id="subscribe_name" /></td>
					   </tr>
					   <tr>
						 <td>
							<a class="button" onclick="email_subscribe()"><span>{{ entry_button  }}</span></a>
							{% if option_unsubscribe %}
							<a class="button" onclick="email_unsubscribe()"><span>{{ entry_unbutton  }}</span></a>
							{% endif %} 
						 </td>
					   </tr>
					   
				  </table>
			  </form>
		  </div><!-- /#frm_subscribe -->
		  <div id="notification-normal"></div>
		</div><!-- /.box-content -->
 </div>
</div>	

<script type="text/javascript">
function email_subscribe(){
	$.ajax({
			type: 'post',
			url: 'index.php?route=extension/module/newslettersubscribe/subscribe',
			dataType: 'html',
            data:$("#subscribe").serialize(),
			success: function (html) {
			try {
			
				eval(html);
			
			} catch (e) {
			}
				
			}}); 
	
	
}
function email_unsubscribe(){
	$.ajax({
			type: 'post',
			url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
			dataType: 'html',
            data:$("#subscribe").serialize(),
			success: function (html) {
					try {
					
						eval(html);
					
					} catch (e) {
					}
			}}); 
	$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow'); 
	
}
</script>
<script type="text/javascript">
    $(document).ready(function() {
		$('#subscribe_email').keypress(function(e) {
            if(e.which == 13) {
                e.preventDefault();
                email_subscribe();
            }
			var name= $(this).val();
		  	$('#subscribe_name').val(name);
        });
		$('#subscribe_email').change(function() {
		 var name= $(this).val();
		  		$('#subscribe_name').val(name);
		});
	
    });
</script>


</div><!-- /.box -->
