{include file="$gentemplates/$header_tpl"}

{literal}
<SCRIPT language="JavaScript" type="text/javascript">
<!--
 var ptn_empty=/^\s*$/;
 var ptn_email=/^\s*\w+([\.\w\-]+)*\w@\w+([\.\w\-]+)*\w\.\w{2,}\s*$/;
 var ptn_latin=/^[0-9a-z_\sA-Z]*$/;

 function check_empty(field, name)
 {
    if (!field.value || ptn_empty.test(field.value))
    {
{/literal}
        error = "'"+name+"' {$lang.affiliate.empty_error|escape:javascript}";
{literal}
        alert(error); field.focus(); field.select();
        return false;
    }
    return true;
 }

 function checkLatin(field, name){
 	if (!ptn_latin.test(field.value)){
		alert(name+' {/literal}{$lang.affiliate.login_not_latin|escape:javascript}{literal}');
		field.focus();
		return false;
	}
	return true;
 }

 function check(field, pattern, name)
 {
    if (field.value && pattern.test(field.value) == false)
    {
{/literal}
        error = "'"+name+"' {$lang.affiliate.incorrect_error|escape:javascript}";
{literal}
        alert(error); field.focus(); field.select();
        return false;
    }
    return true;
 }

 function check_signup()
 {
 	data_form = document.data;
{/literal}
    res = (check_empty(data_form.contactName, '{$lang.affiliate.contact_name}')
	 && checkLatin(data_form.contactName, '{$lang.affiliate.contact_name}')
     && check_empty(data_form.emailAddress, '{$lang.affiliate.email}')
     && check_empty(data_form.streetAddress, '{$lang.affiliate.address}')
     && check_empty(data_form.city, '{$lang.affiliate.city}')
     && check_empty(data_form.state, '{$lang.affiliate.state}')
     && check_empty(data_form.zip, '{$lang.affiliate.zip}')
     && check_empty(data_form.country, '{$lang.affiliate.country}')
     && check(data_form.emailAddress, ptn_email, '{$lang.affiliate.email}'));
    if (res == false) return res;
    return true;
{literal}
 }

//-->
</SCRIPT>
{/literal}
<h2>{$lang.affiliate.razdel_name}</h2>
<h3>{$lang.affiliate.signup_header}</h3>
<p>
	{$lang.affiliate.signup_comments}
</p>
<!-- begin register form -->
{*if $error}<p class="error_msg">*&nbsp;{$error}</p>{/if*}
<form action="aff_signup.php" method="post" name="data" style="margin:0px">
	<input type="hidden" name="action" value="res">
	<p>
		{$lang.affiliate.contact_name}:&nbsp;*<br />
		<input name="contactName" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.web_site}:<br />
		<input name="webSiteAddress" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.unique_month_visitors}:<br />
		<input name="visitors" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.email}:&nbsp;*<br />
		<input name="emailAddress" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.address}:&nbsp;*<br />
		<input name="streetAddress" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.city}:&nbsp;*<br />
		<input name="city" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.state}&nbsp;*<br />
		<input name="state" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.zip}&nbsp;*<br />
		<input name="zip" value="" size=8>
	</p>
	<p>
		{$lang.affiliate.country}&nbsp;*<br />
		<input name="country" value="" size=30>
	</p>
	<p>
		{$lang.affiliate.phone}<br />
		<input name="telephoneNumber" value="" size=30>
	</p>
	<p>
		<input type="button" class="button" onclick="javascript: if (check_signup()) document.data.submit(); else return false;" value="{$lang.button.send}"></TD>
	</p>
</form>
				<!-- end register form -->
{include file="$gentemplates/$footer_tpl"}