{***********************************}
{******* $name must be set!! *******}
{******* $control must be set!! *******}

{if !$id}
	{assign var=id value=".:id:."}
{/if}

<div
	id="{$name}_preview"
	onclick="showColorPicker(document.forms[0]['{$control}{$id}[{$name}]'],document.forms[0]['{$control}{$id}[{$name}]'],'{$control}{$id}_{$name}_preview',event);
			 return false;"

	{if $data[$name]}
		style="background-color:{$data[$name]}; background-image:url('');"
	{/if}
	class="colorPicker"
	>&nbsp;</div>

<input
	type="text"
	name="{$control}{$id}[{$name}]"
	id="{$name}"
	size="8"
	style="text-align: right;"
	class="color"
	{if $data[$name]}
		value="{$data.color}"
	{else}
		value=""
	{/if}
/>
