<inp2:m_DefineElement name="image_block">
	<img src="<inp2:m_param name="img_path" />" <inp2:m_param name="img_size"/> border="0" /><br />
</inp2:m_DefineElement>

<inp2:m_DefineElement name="thumbnail_section" prefix="" size="" class="">
	<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
		<td class="label-cell">
			<inp2:m_phrase label="la_fld_Location"/><!--<br>
			<span class="error"><inp2:{$prefix}_Error field="ThumbPath"/><inp2:{$prefix}_Error field="ThumbUrl"/></span>&nbsp;-->
		</td>
		<td class="control-mid">&nbsp;</td>
		<script type="text/javascript">
			if (typeof(fields['<inp2:m_Param name="prefix" js_escape="1"/>']) == 'undefined') {
				fields['<inp2:m_Param name="prefix" js_escape="1"/>'] = new Object();
			}
			fields['<inp2:m_Param name="prefix" js_escape="1"/>']['ThumbPath'] = '<inp2:m_phrase label="la_section_ThumbnailImage" js_escape="1"/>'
		</script>
		<td class="control-cell">
			<table border="0">
				<tr>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
					  	<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalThumb" value="1">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalThumb"/>" id="<inp2:{$prefix}_InputName field="LocalThumb"/>_1" value="1">
					</td>
					<td>
					  	<inp2:m_phrase label="la_fld_Upload"/>:
					</td>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
					  	<input type="file" name="<inp2:{$prefix}_InputName field="ThumbPath"/>" id="<inp2:{$prefix}_InputName field="ThumbPath"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_Field field="ImageId"/>][LocalThumb]_1').checked = true">
					  	<input type="hidden" name="<inp2:{$prefix}_InputName field="ThumbPath"/>[upload]" id="<inp2:{$prefix}_InputName field="ThumbPath"/>[upload]" value="<inp2:{$prefix}_Field field="ThumbPath"/>">
					</td>
				</tr>
				<tr>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
						<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalThumb" value="0">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalThumb"/>" id="<inp2:{$prefix}_InputName field="LocalThumb"/>_0" value="0">
					</td>
					<td>
						<inp2:m_phrase label="la_fld_RemoteUrl"/>:
					</td>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
						<input type="text" name="<inp2:{$prefix}_InputName field="ThumbUrl"/>" id="<inp2:{$prefix}_InputName field="ThumbUrl"/>" value="<inp2:{$prefix}_Field field="ThumbUrl"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_Field field="ImageId"/>][LocalThumb]_0').checked = true">
				  	</td>
				</tr>
			  </table>
			  <inp2:{$prefix}_Image block="image_block" Thumbnail="1" DefaultImage="noimage.gif"/>
		</td>
		<inp2:m_RenderElement name="inp_edit_error" prefix="$prefix" field="ThumbPath"/>
	</tr>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="fullsize_section" prefix="" size="" class="">
	<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
		<td class="label-cell">
			<inp2:m_phrase label="la_fld_Location"/><!--<br>
			<span class="error"><inp2:{$prefix}_Error field="LocalPath"/><inp2:{$prefix}_Error field="Url"/></span>&nbsp;-->
		</td>
		<td class="control-mid">&nbsp;</td>
		<script type="text/javascript">
			if (typeof(fields['<inp2:m_Param name="prefix" js_escape="1"/>']) == 'undefined') {
				fields['<inp2:m_Param name="prefix" js_escape="1"/>'] = new Object();
			}
			fields['<inp2:m_Param name="prefix" js_escape="1"/>']['LocalPath'] = '<inp2:m_phrase label="la_section_FullSizeImage" js_escape="1"/>'
		</script>
		<td class="control-cell">
			<table border="0">
				<tr>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
					  	<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalImage" value="1">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalImage"/>" id="<inp2:{$prefix}_InputName field="LocalImage"/>_1" value="1">
					</td>
					<td>
					  	<inp2:m_phrase label="la_fld_Upload"/>:
					</td>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
					  	<input type="file" name="<inp2:{$prefix}_InputName field="LocalPath"/>" id="<inp2:{$prefix}_InputName field="LocalPath"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_field field="ImageId"/>][LocalImage]_1').checked = true">
					  	<input type="hidden" name="<inp2:{$prefix}_InputName field="LocalPath"/>[upload]" id="<inp2:{$prefix}_InputName field="LocalPath"/>[upload]" value="<inp2:{$prefix}_Field field="LocalPath"/>">
					</td>
				</tr>
				<tr>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
						<input type="radio" <inp2:m_if check="{$prefix}_FieldEquals" field="LocalImage" value="0">checked</inp2:m_if> name="<inp2:{$prefix}_InputName field="LocalImage"/>" id="<inp2:{$prefix}_InputName field="LocalImage"/>_0" value="0">
					</td>
					<td>
						<inp2:m_phrase label="la_fld_RemoteUrl"/>:
					</td>
					<td>
						<inp2:m_inc param="tab_index" by="1"/>
						<input type="text" name="<inp2:{$prefix}_InputName field="Url"/>" id="<inp2:{$prefix}_InputName field="Url"/>" value="<inp2:{$prefix}_Field field="Url"/>" tabindex="<inp2:m_get param="tab_index"/>" size="<inp2:m_param name="size"/>" class="<inp2:m_param name="class"/>" onclick="document.getElementById('<inp2:m_param name="prefix"/>[<inp2:{$prefix}_Field field="ImageId"/>][LocalImage]_0').checked = true">
				  	</td>
				</tr>
			  </table>
			  <inp2:{$prefix}_Image block="image_block" DefaultImage="noimage.gif"/>
		</td>
		<inp2:m_RenderElement name="inp_edit_error" prefix="$prefix" field="LocalPath"/>
	</tr>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="images_edit_js">
	function FieldID($field_name) {
		var $field_mask = '<inp2:{$prefix}_InputName field="#FIELD#"/>';
		return $field_mask.replace('#FIELD#', $field_name);
	}

	function toggle_fullsize() {
		if (document.getElementById('_cb_' + FieldID('SameImages')).checked) {
			document.getElementById(FieldID('LocalImage') + '_0').disabled = true;
			document.getElementById(FieldID('LocalImage') + '_1').disabled = true;
			document.getElementById(FieldID('LocalPath')).disabled = true;
			document.getElementById(FieldID('Url')).disabled = true;
		}
		else {
			document.getElementById(FieldID('LocalImage') + '_0').disabled = false;
			document.getElementById(FieldID('LocalImage') + '_1').disabled = false;
			document.getElementById(FieldID('LocalPath')).disabled = false;
			document.getElementById(FieldID('Url')).disabled = false;
		}
	}

	if (document.getElementById('_cb_' + FieldID('DefaultImg')).checked) {
		document.getElementById('_cb_' + FieldID('DefaultImg')).disabled = true;
		document.getElementById('_cb_' + FieldID('Enabled')).disabled = true;
	}

	function check_status() {
		if (document.getElementById('_cb_' + FieldID('DefaultImg')).checked) {
			document.getElementById('_cb_' + FieldID('Enabled')).checked = true;
			document.getElementById(FieldID('Enabled')).value = 1;
		}
	}

	function check_primary() {
		if (!document.getElementById('_cb_' + FieldID('Enabled')).checked) {
			document.getElementById('_cb_' + FieldID('DefaultImg')).checked = false;
			document.getElementById(FieldID('DefaultImg')).value = 0;
		}
	}
</inp2:m_DefineElement>

<inp2:m_DefineElement name="image_caption_td">
	<inp2:Field field="$field" grid="$grid"/><span class="priority"><inp2:m_if check="FieldEquals" field="Priority" value="0"><inp2:m_else/><sup><inp2:Field field="Priority" /></sup></inp2:m_if></span>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="image_preview_td">
	<inp2:Image block="image_block" Thumbnail="1" DefaultImage="noimage.gif" MaxWidth="120" MaxHeight="120"/>
</inp2:m_DefineElement>

<inp2:m_DefineElement name="image_url_td">
	<inp2:ImageUrl local_phrase="la_LocalImage"/>
</inp2:m_DefineElement>