{******************************
	the attributes panel
*******************************}
{assign var=control value=$objectName}
<div id="pre_control_specialObject_{$objectName}_{$id}_attributes" style="display: none;" class="dummy_specialObjectAttributesContainer">
	<div class="title">
		{******* DELETE ELEMENT ********}
		<a href="#;"
			onclick="Controls.removeByID('pre_control_specialObject_{$objectName}_{$id}');return false;"
			class="icon-delete"
			tooltip="{$_LANG.DTM.tpl.tooltip.delete}"
			></a>
		{******* CLONE ELEMENT ********}
		{***************************
			Cloning special objects is disabled for now because of the imperfect handling of attributePropreties.
			(actually it might work... but _Controls.prototype.cloneById needs to be modified to handle attributePropreties & other special cases for specialObjects..)
		****************************}

		{if $_LANG.DTM.controls.specialObjects[$objectName].title_tooltip}
			<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.controls.specialObjects[$objectName].title_tooltip}" ></a>
		{/if}

		{$_LANG.DTM.controls.specialObjects[$objectName].title}

	</div>

	<div style="clear: both;"></div>

	{********
		Display default attributes
	*********}

	<table style="width: 100%;width:310px;" class="wrappable">
		<tr>
			<td>
				{$_LANG.DTM.controls.specialObjects[$objectName].coordinates}
			</td>
			<td>
				{if $_LANG.DTM.tpl.controls.specialObjects[$objectName].coordinates_tooltip}
					<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.tpl.controls.specialObjects[$objectName].coordinates_tooltip}" ></a>
				{/if}

				{include file="controls/selector.coordinates.tpl" control=$control data=$data}
				{include file="controls/selector.fixed.tpl" control=$control thisPanel="specialObject" data=$data pre='pre'}
				{include file="controls/selector.block.tpl" control=$control forceBlocked=$attributes.forceBlock data=$data}

			</td>
		</tr>
		<tr>
			<td>
				{$_LANG.DTM.controls.specialObjects[$objectName].layer}
			</td>
			<td>
				{if $_LANG.DTM.tpl.controls.specialObjects[$objectName].layer_tooltip}
					<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.tpl.controls.specialObjects[$objectName].layer_tooltip}" ></a>
				{/if}

				{include file="controls/selector.layer.tpl" name="layer" control=$control data=$data}
			</td>
		</tr>
	</table>

	{*** default padding for special Objects. usefull when using fixed elements in the page ***}

	<fieldset style="width:295px;" class="default">
		<legend
			onclick="toggleContainer(this);"
			>{$_LANG.DTM.controls.specialObjects[$objectName].padding} <img src="{$smarty.const.SMARTY_BLANKGIF}" alt="" align="absmiddle" class="imgIcon icon-expand-10" /></legend>
		<table style="display: none; width:295px;" class="wrappable">
			<tr>
				<td>
					{$_LANG.DTM.controls.specialObjects[$objectName].padding}
				</td>
				<td>
					{if $_LANG.DTM.controls.specialObjects[$objectName].padding_tooltip}
						<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.controls.specialObjects[$objectName].padding_tooltip}" ></a>
					{/if}
					<table style="width:295px;" cellpadding="0" cellspacing="0" class="wrappable">
						<tr>
							<td>
								{$_LANG.DTM.tpl.top}
							</td>
							<td>
								<input
									type="padding_top"
									name="{$control}{$id}[padding_top]"
									id="padding_top"
									value="{$data.padding_top}"
									class="attributes_padding"
								/>
							</td>
						</tr>
						<tr>
							<td>
								{$_LANG.DTM.tpl.bottom}
							</td>
							<td>
								<input
									type="padding_bottom"
									name="{$control}{$id}[padding_bottom]"
									id="padding_bottom"
									value="{$data.padding_bottom}"
									class="attributes_padding"
								/>
							</td>
						</tr>
						<tr>
							<td>
								{$_LANG.DTM.tpl.left}
							</td>
							<td>
								<input
									type="padding_left"
									name="{$control}{$id}[padding_left]"
									id="padding_left"
									value="{$data.padding_left}"
									class="attributes_padding"
								/>
							</td>
						</tr>
						<tr>
							<td>
								{$_LANG.DTM.tpl.right}
							</td>
							<td>
								<input
									type="padding_right"
									name="{$control}{$id}[padding_right]"
									id="padding_right"
									value="{$data.padding_right}"
									class="attributes_padding"
								/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</fieldset>

	{********
		iterate through fieldsets and build them
	*********}
	{foreach from=$attributes key=fieldsetName item=fieldsetContent}
		{if $fieldsetContent|@is_array}
			{if $fieldsetContent.displayFieldset}
				<fieldset id="fieldset_{$fieldsetName}" style="width:295px;">

				{if $_LANG.DTM.controls.specialObjects[$objectName][$fieldsetName]}
					<legend
						onclick="toggleContainer(this);"
						id="fieldset_legend_{$fieldsetName}"
					>{$_LANG.DTM.controls.specialObjects[$objectName][$fieldsetName]} <img src="{$smarty.const.SMARTY_BLANKGIF}" alt="" align="absmiddle" class="imgIcon icon-expand-10" /></legend>
				{/if}
			{/if}

			{assign var=x value="`$fieldsetName`_tooltip"}
			{if $_LANG.DTM.tpl.controls.specialObjects[$objectName][$x]}
				<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.tpl.controls.specialObjects[$objectName][$x]}" ></a>
			{/if}

			{***********
				iterate through the fieldset's contents and create the required fields
			***********}
			{if $fieldsetContent.attributes}
				<table style="{if $fieldsetContent.hidden}display: none;{/if}width:295px;"  class="wrappable">
					{assign var=tbodyOpened value=false}
					{foreach from=$fieldsetContent.attributes key=fieldName item=fieldAttributes}
						{if $fieldAttributes.type=='separator' || $fieldAttributes.type=='lightSeparator' || $fieldAttributes.type=='heavySeparator'}

							{if $tbodyOpened}
								</tbody>
							{/if}

							<tbody class="dummy_specialObjectColumnAttributeContainer {if $fieldAttributes.ID|default:$fieldAttributes.text} order_{$fieldAttributes.ID}{/if}">
								{assign var=tbodyOpened value=true}
								<tr>
									<td colspan="2">
										{assign var=x value="`$fieldsetName`_tooltip"}
										{if $_LANG.DTM.tpl.controls.specialObjects[$objectName][$x]}
											<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.tpl.controls.specialObjects[$objectName][$x]}" ></a>
										{/if}

										{include file="controls/separator.`$fieldAttributes.type`.tpl" name=$fieldName control=$control attributes=$fieldAttributes LANG=$_LANG.DTM.controls.specialObjects[$objectName] id=$id  data=$data}
									</td>
								</tr>
						{else}
							<tr>
								<td class="w20p">
									{$_LANG.DTM.controls.specialObjects[$objectName][$fieldName]}
								</td>
								<td>
									{assign var=x value="`$fieldName`_tooltip"}
									{if $_LANG.DTM.controls.specialObjects[$objectName][$x]}
										<a href="#" class="icon-infoBlue help" tooltip="{$_LANG.DTM.controls.specialObjects[$objectName][$x]}" ></a>
									{/if}

									{include file="controls/selector.`$fieldAttributes.type`.tpl" name=$fieldName control=$control attributes=$fieldAttributes LANG=$_LANG.DTM.controls.specialObjects[$objectName] id=$id data=$data loadingStage=true attributeSelector="pre_control_specialObject_`$objectName`_`$id`_attributes"}
								</td>
							</tr>
						{/if}
					{/foreach}

					{if $tbodyOpened}
						</tbody>
						{assign var=tbodyOpened value=false}
					{/if}
				</table>
			{/if}

			{if $fieldsetContent.displayFieldset}
				</fieldset>
			{/if}
		{/if}
	{/foreach}
</div>