<div class="panel_section">
<div class="panel_content" style="width:98%;">
	<div><font class="red_sub_header" style="color:#4D4D4D;">
		{if $attr.id>0}
			{$lang.forms.change_attr}
		{else}
			{$lang.forms.create_attr}
		{/if}
	</font></div><br>
	<div class="help_text" style="-moz-border-radius: 10px 10px 10px 10px;">
            <div class="close_help">
                <img src="{$site_root}{$template_root}/images/close_help.png" alt="">
            </div>
            <div class="help_body">
                <span class="help_title">{$lang.help}:</span>{$lang.admin_help.forms_attr_hint}
            </div>
	</div>
<form name="attr_props" action="{$save_link}" method="POST">
{if $attr.is_const=='Y'}<input type="hidden" name="control_type" value="{$attr.control_type}">{/if}
<table cellpadding=5 cellspacing=0 width="100%">
	<tr>
		<td valign="top" width="500px"  style="padding-left: 0px;padding-right: 0px;">
			<table border=0 cellspacing=0 cellpadding=5 width="100%">
				<tr class="table_header">
					<td class="main_header_text" colspan="3">
						{$lang.forms.field_props}
					</td>
				</tr>
				<tr class="even">
					<td class="main_content_text">
						<font class="main_error_text">*</font>{$lang.forms.field_name}:
					</td>
					<td class="main_content_text" colspan="2">
						<input type="text" name="field_name" style="width:200px" value="{$attr.field_name}">
					</td>
				</tr>
				<tr class="odd">
					<td class="main_content_text" colspan="3">
						<input type="checkbox" name="mandatory" value="1" {if $attr.mandatory=='Y'}checked{/if}>&nbsp;{$lang.forms.mandatory}
					</td>
				</tr>
				<tr class="table_header">
					<td class="main_header_text" width="150px" align="center">
						{$lang.forms.control_type}
					</td>
					<td class="main_header_text" align="center">
						{$lang.forms.view_on_form}
					</td>
					<td width="10px">&nbsp;</td>
				</tr>
				<tr class="even">
					<td class="main_content_text">
						{$lang.forms.checkbox}
					</td>
					<td>
						<input type="checkbox">
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="checkbox" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='checkbox'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="odd">
					<td class="main_content_text">
						{$lang.forms.text}
					</td>
					<td>
						<input type="text" style="width:200px" value="text field">
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="text" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='text'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="even">
					<td class="main_content_text">
						{$lang.forms.select}
					</td>
					<td>
						<select style="width:200px">
							<option>Item1</option>
							<option>Item2</option>
							<option>Item3</option>
						</select>
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="select" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='select'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="odd">
					<td class="main_content_text">
						{$lang.forms.textarea}
					</td>
					<td>
						<textarea style="width:200px">Text area</textarea>
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="textarea" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='textarea'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="even">
					<td class="main_content_text">
						{$lang.forms.password}
					</td>
					<td>
						<input type="password" value="test1" style="width:200px">
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="password" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='password'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="odd">
					<td class="main_content_text">
						{$lang.forms.file}
					</td>
					<td>
						<input type="file">
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="file" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='file'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="even">
					<td class="main_content_text">
						{$lang.forms.date}
					</td>
					<td>
						<select style="width:50px">
							{section name=s start=1 loop=13}
								<option>{$smarty.section.s.index}</option>
							{/section}
						</select>
						<select style="width:50px">
							{section name=s start=1 loop=32}
								<option>{$smarty.section.s.index}</option>
							{/section}
						</select>
						<select style="width:90px">
							{section name=s start=1990 loop=2041}
								<option>{$smarty.section.s.index}</option>
							{/section}
						</select>
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="date" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='date'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="odd">
					<td class="main_content_text">
						{$lang.forms.text_range}
					</td>
					<td>
						{$lang.forms.from}&nbsp;<input type="text" style="width:70px">&nbsp;{$lang.forms.to}&nbsp;<input type="text" style="width:70px">
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="text_range" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='text_range'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
				<tr class="even">
					<td class="main_content_text">
						{$lang.forms.place}
					</td>
					<td>
						{$lang.forms.place_text}
					</td>
					<td class="main_content_text" align="center">
						<input name="control_type" value="place" type="radio" onclick="LoadAttrPropsForm(this.value, {$id_attr}, 'attr_props_div');" {if $attr.control_type=='place'}checked{/if}{if $attr.is_const=='Y'} disabled{/if}>
					</td>
				</tr>
			</table>
		</td>
		<td valign="top" style="padding-left: 0px;padding-right: 0px;">
			<div id='attr_props_div'>
				{$attr_form_content}
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" align="left" style="padding-top:15px;">
			<a class="admin_button_major" onclick="document.attr_props.submit(); return CheckValues();">{$lang.button.save}<span>&nbsp;</span></a>
			<a class="admin_button_cancel" onclick="javascript: ClearWindow('cur_section_div');">{$lang.button.close}<span>&nbsp;</span></a>&nbsp;
		</td>
	</tr>
</table>
</form>
<script language="javascript" type="text/javascript">
{if $act=='new'}
	{literal}
	
		var form=document.attr_props;
		var len=document.attr_props.elements.length;
		var c_type='';
		for(var i=0; i<len;i++){
			if (document.attr_props.elements[i].name=='control_type'){
				c_type=document.attr_props.elements[i].value;
				document.attr_props.elements[i].checked=true;
				break;
			}
		}
		LoadAttrPropsForm(c_type, null, 'attr_props_div');
	{/literal}
{/if}
</script>
<script language="javascript" type="text/javascript">
var err_field_name="{$lang.forms.err_field_name}";
var err_age_invalid="{$lang.forms.err_age_error}";
</script>
</div></div>