{extends file=$element.methods->getTemplatePath('general')}

{block name=input append}
	<div class="{$element.class} {if $element.style.highlight=='current'}highlightCurrent{/if}" id="{$element.id}">
		{assign var=elements value=[]}
		{foreach from=$element.possibleValues key=key item=value}
			{* TODO: class:noBorder should be removed from here after the noBorder class is removed from the engine *}
			{$jsID="{$element.id}_{$key}_"}
			<label for="{$jsID}" class="{strip}
						{if $element.style.highlight=='current' && $element.value==$key}highlight {/if}
						{if $element.style.renderMode=="inline"}float {/if}
						{if $element.style.renderMode=="aligned"}aligned {/if}
						{if $element.disabled}disabled {/if}
					{/strip}">

				<input type="radio" class="noBorder inputElement"
					name="{$element.name}"
					id="{$jsID}"
					value="{$key}"
					{if $element.value==$key} {* TODO:  and strlen($element.value)==strlen($key) *}
						checked="checked"
					{/if}

					{if $element.disabled}
						disabled="disabled"
					{/if}

					{if $element.settings.events.onChange} {* the event is "onClick" to have the correct behavior in IE also *}
						onClick="var element = $(this); {$element.settings.events.onChange|join:";"}"
					{/if}
				/>
				{if $value}
					{$value}
					</label>
				{/if}
				{if $element.style.renderMode=="block"}
					<br/>
				{/if}
			{$elements[]=$jsID}
		{/foreach}
	</div>
{/block}


<script type="text/javascript">
	{block name=script}{/block}
</script>
