{assign var="title" value=$smarty.const._TPL_MEMBER_TITLE}
{include file="header.html"}
<div id="content">		
        <div class="indent-main">
            <div class="container">
                <div class="col-1 maxheight">
                	<div class="box maxheight">
                        <div class="border-top maxheight">
                            <div class="border-bottom maxheight">
                                <div class="border-right maxheight">
                                    <div class="border-left maxheight">
                                        <div class="corner-top-right maxheight">
                                            <div class="corner-top-left maxheight">
                                                <div class="corner-bottom-left maxheight">
                                                    <div class="corner-bottom-right maxheight"> 
                                                        <div class="indent-box">
                                                            <img alt="" src="{$config.root_surl}/templates/images//1page_title1.gif" class="title" /><br />
                    <div class="container tail">
                                                            	
        
<table width="100%"><tr><td style="width: 50%; vertical-align: top;">
<div class="centered">
   {*$smarty.session._amember_id*}
<!-- display links to protected areas for customer -->
{if $smarty.session._amember_products}{* Customer have active subscriptions, display it if config allows *}
    <h3>#_TPL_MEMBER_SUBSCR#</h3>
    <table><tr><td><ul> <!-- table to align subscriptions -->
    {foreach from=$member_products item=p}
    <li>
    {if $p.url gt "" }
        <a href="{$p.url}">{$p.title}</a>
    {else}
        <b>{$p.title}</b>
    {/if}
    </li>
    {foreach from=$p.add_urls item=t key=url}  
        <li><a href="{$url}">{$t}</a></li>
    {/foreach}
    {/foreach}
    </ul></td></tr></table>
{else}{* Customer doesn't have any active subscriptions *}
    <h3>#_TPL_MEMBER_NO_SUBSCR#</h3>    
    #_TPL_MEMBER_USE|<i>|</i>#<br /> 
    #_TPL_MEMBER_ORDER_SUBSCR#<br />
{/if}
<br />
<table><tr><td>
{foreach from=$left_member_links item=t key=u}
    <li> <a href="{$u|escape}">{$t}</a></li>
{/foreach}
</td></tr></table>
<!-- end of display links to protected areas for customer -->
</div>

<div class="centered">
<!-- -->
<!-- newsletters form -->

<script language="JavaScript" type="text/javascript">
<!--
function checkboxes(num){
    if (num == 1){
        is_checked = document.subs.unsubscribe.checked;
        for (i = 0; i < document.subs.elements.length; i++){
            if (document.subs.elements[i].name == 'threads[]' && document.subs.elements[i].checked){
                is_checked = false;
            }
        }
        document.subs.unsubscribe.checked = is_checked;
    }
    if (num == 2){
        for (i = 0; i < document.subs.elements.length; i++){
            if (document.subs.elements[i].name == 'threads[]'){
                if (document.subs.unsubscribe.checked){
                    document.subs.elements[i].checked = false;
                }
                document.subs.elements[i].disabled = document.subs.unsubscribe.checked;
                
            }
        }
        if (document.subs.unsubscribe.checked){
            document.getElementById('newsletters_td').className = 'disabled';
        } else {
            document.getElementById('newsletters_td').className = '';
        }
    }
}
-->
</script>

<form method="post" name="subs" action="{$smarty.server.PHP_SELF|escape}">

<table class="newsletters">
<tr><td id="newsletters_td" {if $unsubscribed}class="disabled"{else}{/if}>
{foreach from=$threads_list item=tr}
{if $tr.is_active}
<input type="checkbox" id="tr{$tr.thread_id}" name="threads[]" value="{$tr.thread_id}" 
    {if $threads[$tr.thread_id] eq '1'}checked="checked"{/if} 
    onclick="checkboxes(1)" {if $unsubscribed}disabled="disabled"{/if} />
<label for="tr{$tr.thread_id}">
<strong>{$tr.title}</strong><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="small">{$tr.description}</span>
</label>
<br />
{/if}
{/foreach}
</td></tr>
</table>


</form>
<!-- end of newsletters form -->


<!-- end of newsletters archive -->

</div>

</td><td style="vertical-align: top;">
<div class="centered">

<!-- renew and payment history options -->
<h3>#_TPL_MEMBER_USEFUL_LINKS#</h3>
<table><tr><td><!-- right top links -->
<a href="{$config.root_url}/logout.php">#_TPL_MEMBER_LOGOUT#</a><br />
<a href="{$config.root_url}/profile.php">#_TPL_MEMBER_CH_PSWD#</a><br />
<a href="{$config.root_url}/checks.php?id={$smarty.session._amember_id}">Checks</a><br />
<a href="{$config.root_url}/contacts.php?id={$smarty.session._amember_id}">Contacts</a><br />
<a href="{$config.root_url}/report.php?id={$smarty.session._amember_id}">Report</a><br />
{foreach from=$member_links item=t key=u}
<a href="{$u|escape}">{$t}</a><br />
{/foreach}
</td></tr></table>

<h3>#_TPL_MEMBER_ADD_RENEW#</h3>    
{include file="error.inc.html"}

<form id="payment" name="payment" method="post" action="member.php#e">
<table class="vedit">

<!-- product selection code -->
<tr><th>#_TPL_SIGNUP_MEMB_TYPE# *</th><td>
{if $config.member_select_multiple_products}
    {foreach from=$products_to_renew item=p} 
    <input type="checkbox" id="product{$p.product_id}" name="product_id[]" value="{$p.product_id|escape}"
        {if in_array($p.product_id, (array)$smarty.request.product_id)}checked="checked"{/if}
        />
        <label for="product{$p.product_id}"><b>{$p.title} ({$p.terms})</b><br />
        <span class="small">{$p.description}</span></label><br /><br />
    {if $p.price <= 0.0 }
    {assign var="paysys_id_not_required" value="1"}
    {/if}        
    {/foreach}
{else}
<select name="product_id" size="1">
    <option value="">#_TPL_MEMBER_SELECT#</option>
{foreach from=$products_to_renew item=p}
    <option value="{$p.product_id}"
    {if $p.product_id == $smarty.request.product_id}selected="selected"{/if}>{$p.title} ({$p.terms}) 
    </option>
    {if $p.price <= 0.0 }
    {assign var="paysys_id_not_required" value="1"}
    {/if}        
{/foreach}
</select>
{/if}
{if $paysys_id_not_required }
      <input type="hidden" name="paysys_id_not_required" value="for javascript" />
{/if}
</td></tr>

<!-- paysystem selection code -->
{if $config.product_paysystem}{else}
{if count($paysystems_select) > 1 }
<tr>
    <th>#_TPL_SIGNUP_PAYSYS# *</th>
    <td><select name="paysys_id" size="1">
    <option value=''>#_TPL_MEMBER_SELECT2#</option>
    {html_options options=$paysystems_select selected=$smarty.request.paysys_id}
</select></td></tr>
{else}
{foreach from=$paysystems_select item=p key=i}
    <input type="hidden" name="paysys_id" value="{$i|escape}" />
{/foreach}
{/if}
{/if}

<!-- coupon text box -->
{if $config.use_coupons}
<tr>
    <th><b>#_TPL_SIGNUP_COUPON_CODE#</b></th>
<td>
<input type="text" name="coupon" value="{$smarty.request.coupon|escape}" size="15" />
</td></tr>
{/if}
</table><!-- end of add/renew subscription controls -->
<input type="hidden" name="action" value="renew" /> 
<br /><div style="text-align: center;"><input type="submit" value="&nbsp;&nbsp;&nbsp;#_TPL_MEMBER_ORDER_BUT#&nbsp;&nbsp;&nbsp;" /></div>
</form>



</div>
<!-- end of renew and payment history options -->
</td></tr></table>

<br /><br />

<script type="text/javascript" src="{$config.root_surl}/includes/jquery/jquery.js?smarty"></script>
<script type="text/javascript" src="{$config.root_surl}/includes/jquery/jquery.select.js?smarty"></script>
<script type="text/javascript" src="{$config.root_surl}/includes/jquery/jquery.metadata.min.js?smarty"></script>
<script type="text/javascript" src="{$config.root_surl}/includes/jquery/jquery.validate.pack.js?smarty"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("form#payment").validate({
    rules: {
		{/literal}{if !$config.member_select_multiple_products}{literal}
		product_id: "required", 
		{/literal}{else}{literal}
		"product_id[]": "required", 
		{/literal}{/if}{literal}
    	paysys_id: "required"
	},
  	errorPlacement: function(error, element) {
		error.appendTo( element.parent());
	}
    });
});
</script>

                                                                <br class="clear" />
                                                            </div>
                                                            
                                                           
                                                           <!-- -->
                                                        </div>                                     
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
              
{include file="footer.html"}