<script type="text/javascript">
<!--
var LocationMax  = "{$this->ipsclass->vars['max_location_length']}";
var InterestMax  = "{$this->ipsclass->vars['max_interest_length']}";
	function CheckLength(Type){
		LocationLength  = document.theForm.Location.value.length;
		InterestLength  = document.theForm.Interests.value.length;
		message  = "";
			if (Type == "location"){
				if (LocationMax !=0) {
					message = "{$this->ipsclass->lang['js_location']}: {$this->ipsclass->lang['js_max']} " + LocationMax + " {$this->ipsclass->lang['js_characters']}.";
				}
			else{
            	message = "";
            }
            	alert(message + "  {$this->ipsclass->lang['js_used']} " + LocationLength + " {$this->ipsclass->lang['js_so_far']}.");
            }
    		
            if (Type == "interest"){
	            if (InterestMax !=0){
		            message = "{$this->ipsclass->lang['js_interests']}: {$this->ipsclass->lang['js_max']} " + InterestMax + " {$this->ipsclass->lang['js_characters']}.";
		        }
		        else{
			        message = "";
			    }
			    alert(message + "  {$this->ipsclass->lang['js_used']} " + InterestLength + " {$this->ipsclass->lang['js_so_far']}.");
			}
	}
	
	function ValidateProfile(){
    	LocationLength  = document.theForm.Location.value.length;
    	InterestLength  = document.theForm.Interests.value.length;
    	errors = "";
    		if (LocationMax !=0){
	    		if (LocationLength > LocationMax) {
		    		errors = "{$this->ipsclass->lang['js_location']}:  {$this->ipsclass->lang['js_max']} " + LocationMax + " {$this->ipsclass->lang['js_characters']}.  {$this->ipsclass->lang['js_used']}: " + LocationLength;
		    	}
		    }
		   	if (InterestMax !=0){
        		if (InterestLength > InterestMax){
	        		errors = errors + "  {$this->ipsclass->lang['js_interests']}:  {$this->ipsclass->lang['js_max']} " + InterestMax + " {$this->ipsclass->lang['js_characters']}.  {$this->ipsclass->lang['js_used']}: " + InterestLength;
	        	}
	        }
	        if (errors != ""){
		        alert(errors);
		        return false;
		       	}
		    else{
			    return true;
			   	}
	}
-->
</script>
<form action="{$this->ipsclass->base_url}auth_key={$member['key']}" method="post" name="theForm" onsubmit="return ValidateProfile()">
<input type="hidden" name="act" value="UserCP" />
<input type="hidden" name="CODE" value="21" />
<if="$required_output">
	<div class='subtitle'>{$this->ipsclass->lang['cf_required']}</div>
		<table cellpadding='0' cellspacing='0' width='100%'>
		$required_output
		</table>
	<br />
</if>
	<div class='subtitle'>{$this->ipsclass->lang['profile_title']}</div>
	<table cellpadding='0' cellspacing='0' width='100%'>
	<if="($this->ipsclass->vars['post_titlechange']) and ($member['posts'] > $this->ipsclass->vars['post_titlechange'])">
		<tr>
			<td width="30%" class="row1" style='padding:6px;'><b>{$this->ipsclass->lang['member_title']}</b></td>
			<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" maxlength="120" name="member_title" value="{$this->ipsclass->member['title']}" /></td>
		</tr>
	</if>
	<if="$day AND $mon AND $year">
		<tr>
			<td width="30%" class="row1" style='padding:6px;'><b>{$this->ipsclass->lang['birthday']}</b></td>
			<td width="70%" class="row2" style='padding:6px;'>
				<select name="month">&nbsp;
					{$mon}
				</select>			
				<select name="day">&nbsp;
					{$day}
				</select> 
				<select name="year">&nbsp;
					{$year}
				</select>
			</td>
		</tr>
	</if>
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['panel_gender']}</td>
		<td width="70%" class="row2" style='padding:6px;'><select class='select' name='gender'>
			<option value='male'<if="$this->ipsclass->member['pp_gender']=='male'"> selected='selected'</if>>{$this->ipsclass->lang['panel_gender_m']}</option>
			<option value='female'<if="$this->ipsclass->member['pp_gender']=='female'"> selected='selected'</if>>{$this->ipsclass->lang['panel_gender_f']}</option>
			<option value='mystery'<if="$this->ipsclass->member['pp_gender']==''"> selected='selected'</if>>{$this->ipsclass->lang['panel_gender_u']}</option>
			</select>
		</td>
	</tr>  
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['website']}</td>
		<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" maxlength="1200" name="WebSite" value="{$member['website']}" /></td>
	</tr>  
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['icq']}</td>
		<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" maxlength="20" name="ICQNumber" value="{$member['icq_number']}" /></td>
	</tr>
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['aol']}</td>
		<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" maxlength="200" name="AOLName" value="{$member['aim_name']}" /></td>
	</tr>
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['yahoo']}</td>
		<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" maxlength="200" name="YahooName" value="{$member['yahoo']}" /></td>
	</tr>
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['msn']}</td>
		<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" maxlength="200" name="MSNName" value="{$member['msnname']}" /></td>
	</tr>
	<tr>
		<td width="30%" class="row1" style='padding:6px;'>{$this->ipsclass->lang['location']}<br />(<a href="javascript:CheckLength('location');">{$this->ipsclass->lang['check_length']}</a>)</td>
		<td width="70%" class="row2" style='padding:6px;'><input type="text" size="40" name="Location" value="{$member['location']}" /></td>
	</tr>
	<tr>
		<td width="30%" class="row1" style='padding:6px;' valign="top">{$this->ipsclass->lang['interests']}<br />(<a href="javascript:CheckLength('interest');">{$this->ipsclass->lang['check_length']}</a>)</td>
		<td width="70%" class="row2" style='padding:6px;'><textarea cols="60" rows="10" wrap="soft" name="Interests">{$member['interests']}</textarea></td>
	</tr>
	<if="$optional_output">
		$optional_output
	</if>
	<tr>
		<td class="formbuttonrow" align="center" colspan="2"><input type="submit" class='button' value="{$this->ipsclass->lang['submit_profile']}" /></td>
	</tr>
	</table>
</form>