<script type="text/javascript">
	$(document).ready(function(){
		$("form#profile-form").validate();
		$("form#profile-form #firstName").rules("add", {required: true});
		$("form#profile-form #lastName").rules("add", {required: true});
		$("form#profile-form #email").rules("add", {required: true, email: true});
	});
</script>
<form id="profile-form" class="form-styled" action="" method="post">

	<script type="text/javascript">
	$(document).ready(function(){	
		$("form#profile-form #password2").rules("add", {required: false, equalTo: "#password"});
	});
	</script>
	<div class="block50">
		<fieldset id="personal-data">
			<input type="hidden" name="sOption" value="save" />
			<h2>{{$lang.Your_personal_information}}</h2>
			<table>
				<tr>
					<th>{{$lang.First_name}}</th><td><input type="text" name="sFirstName" value="{{$aUserProfile.sFirstName}}" class="input" id="firstName" maxlength="30" /></td>
				</tr><tr>
					<th>{{$lang.Last_name}}</th><td><input type="text" name="sLastName" value="{{$aUserProfile.sLastName}}" class="input" id="lastName" maxlength="30" /></td>
				</tr><tr>
					<th>{{$lang.Pesel}}</th><td><input type="text" name="sPesel" value="{{$aUserProfile.sPesel}}" class="input" id="pesel" maxlength="30" /></td>
				</tr><tr>
					<th>{{$lang.Street}}</th><td><input type="text" name="sStreet" value="{{$aUserProfile.sStreet}}" class="input" id="street" maxlength="40" /></td>
				</tr><tr>
					<th>{{$lang.Zip_code}}</th><td><input type="text" name="sZipCode" value="{{$aUserProfile.sZipCode}}" class="input" id="zipcode" maxlength="20" /><img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_zipcode}}" title="{{$lang.tooltip_zipcode}}" /></td>
				</tr><tr>
					<th>{{$lang.City}}</th><td><input type="text" name="sCity" value="{{$aUserProfile.sCity}}" class="input" id="city" maxlength="40" /></td>
				</tr><tr>
					<th>{{$lang.Country}}</th>
					<td>
						<select name="iCountry" class="select" id="country"><option value="">{{$lang.none}}</option>
							{{foreach from=$aCountries item=sCountry}}
								<option value="{{$sCountry@key}}" {{if $sCountry@key == $aUserProfile.iCountry}}selected="selected"{{/if}}>{{$sCountry}}</option>
							{{/foreach}}
						</select>
						<img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_country}}" title="{{$lang.tooltip_country}}" />
					</td>
				</tr><tr>
					<th>{{$lang.Phone}}</th><td><input type="tel" name="sPhone" value="{{$aUserProfile.sPhone}}" class="input" id="phone" maxlength="40" /><img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_phone}}" title="{{$lang.tooltip_phone}}" /></td>
				</tr><tr>
					<th>{{$lang.Email}}</th><td><input type="text" name="sEmail" value="{{$aUserProfile.sEmail}}" class="input" id="email" maxlength="60" /><img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_email}}" title="{{$lang.tooltip_email}}" /></td>
				</tr>
				<tr>
					<td class="value" colspan="2"><label><input name="iForumNotifyEmail" type="hidden" value="0" /><input id="iForumNotifyEmail" name="iForumNotifyEmail" type="checkbox"{{if $aUserProfile.iForumNotifyEmail}} checked="checked"{{/if}} value="1" /> {{$lang.send_forum_notify_user_email}}</label></td>
				</tr>
				{{if $config.sms_send_forum_notify_user}}
					<tr>
						<td colspan="2" class="value"><label><input name="iForumNotifySMS" type="hidden" value="0" /><input name="iForumNotifySMS" type="checkbox"{{if $aUserProfile.iForumNotifySMS}} checked="checked"{{/if}} value="1" /> {{$lang.send_forum_notify_user_sms}}</label></td><td class="help"></td>
					</tr>
				{{/if}}
			</table>
		</fieldset>
	</div>
	<div class="block50">
		<fieldset id="company-data">
			<h2>{{$lang.Company}}</h2>
			<p>{{$lang.Fill_if_company}}</p>
			<table>
				<tr>
					<th>{{$lang.Company}}</th><td><input type="text" name="sCompanyName" value="{{$aUserProfile.sCompanyName}}" class="input" id="company" maxlength="100" /><img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_company}}" title="{{$lang.tooltip_company}}" /></td>
				</tr><tr>
					<th>{{$lang.Nip}}</th><td><input type="text" name="sNip" value="{{$aUserProfile.sNip}}" class="input" maxlength="30" id="nip" /><img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_nip}}" title="{{$lang.tooltip_nip}}" /></td>
				</tr>
			</table>
		</fieldset>	
		<fieldset id="login-data">
			<h2>{{$lang.Password_change}}</h2>
			<table>
				<tr>
					<th>{{$lang.Login}}</th>
					<td><input type="text" disabled="disabled" value="{{$aUserProfile.sLogin}}" /></strong></td>
				</tr><tr>
					<th><label for="password">{{$lang.Password_change}}</label></th>
					<td><input type="password" name="sPass" value="" class="input" maxlength="30" id="password" /><img class="tTip info" src="templates/images/info.png" alt="{{$lang.tooltip_pass_change}}" title="{{$lang.tooltip_pass_change}}" /></td>
				</tr><tr>
					<th><label for="password2">{{$lang.Password_confirm}}</label></th>
					<td><input type="password" name="sPass2" value="" class="input" maxlength="30" id="password2" /></td>
				</tr>
				<tr>
					<td colspan="2" class="buttons"><input type="submit" value="{{$lang.add_account_save}}" class="submit submit-styled" /></td>
				</tr>
			</table>
		</fieldset>
	</div>
</form>