{template header}
{template magic_navbar}

</td><td align="right" valign="top">
<!--{if $operation == ''}-->
	<div class="spaceborder" style="width: 98%">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="3" align="left">
		<div class="right">
			<a href="magic.php?action=$action&typeid=1&amp;pid=$pid">{lang magics_type_1}</a>
			&nbsp;<a href="magic.php?action=$action&typeid=2&amp;pid=$pid">{lang magics_type_2}</a>
			&nbsp;<a href="magic.php?action=$action&typeid=3&amp;pid=$pid">{lang magics_type_3}</a>
			&nbsp;<a href="magic.php?action=user&amp;pid=$pid">{lang all}</a>
		</div>{lang magics_user}
	</td></tr>
	<tr class="altbg2">
	<!--{if $magiclist}-->
		<!--{loop $magiclist $key $magic}-->
			<!--{if $key && ($key % 2 == 0)}-->
				</tr>
				<!--{if $key < $magicnum}-->
					<tr class="altbg2">
				<!--{/if}-->
			<!--{/if}-->
			<td class="altbg2" width="50%">
			<table width="100%" border="0" cellspacing="2" cellpadding="2"><tr>
			<td width="30%" rowspan="4" align="center"><img src="images/magics/$magic[pic]"></td>
			<td width="70%" valign="top"><b>$magic[name]</b></td>
			</tr><tr>
			<td width="70%">$magic[description]</td>
			</tr><tr><td>
			{lang magics_num}: $magic[num] {lang magics_user_totalnum}: $magic[weight]
			</td></tr><tr><td>
			<b><a href="magic.php?action=user&operation=use&magicid=$magic[magicid]&pid=$pid&username=$username">{lang magics_operation_use}</a></b>&nbsp;
			<!--{if $allowmagics > 1}-->
				<b><a href="magic.php?action=user&operation=give&magicid=$magic[magicid]">{lang magics_operation_present}</a></b>&nbsp;
			<!--{/if}-->
			<b><a href="magic.php?action=user&operation=drop&magicid=$magic[magicid]">{lang magics_operation_drop}</a></b>&nbsp;
			<!--{if $magicmarket && $allowmagics > 1}-->
				<b><a href="magic.php?action=user&operation=sell&magicid=$magic[magicid]">{lang magics_operation_sell}</a></b>&nbsp;
			<!--{/if}-->
			</td></tr></table>
			</td>
		<!--{/loop}-->
			$magicendrows
	<!--{else}-->
		<td class="altbg1" colspan="3">{lang magics_shop_nonexistence}</td></tr>
	<!--{/if}-->
<!--{elseif $operation == 'give' || $operation == 'use' || $operation == 'sell' || $operation == 'drop'}-->
	<form method="post" action="magic.php?action=user">
	<input type="hidden" name="formhash" value="{FORMHASH}">
	<input type="hidden" name="operation" value="$operation">
	<input type="hidden" name="magicid" value="$magicid">
	<input type="hidden" name="$operationsubmit" value="yes">
	<div class="spaceborder" style="width: 98%">
	<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%" align="center">
	<tr class="header"><td colspan="3" align="left">{lang magics_user} </td></tr>
	<tr class="altbg2"><td rowspan="5" class="altbg2" align="center" width="20%"><img src="images/magics/$magic[pic]"><br></td>
	<td class="altbg2" width="80%"><b>$magic[name]</b></td></tr>
	<tr class="altbg2"><td class="altbg2">$magic[description]</td></tr>
	<tr class="altbg2"><td class="altbg2">{lang magics_num}: $magic[num] {lang magics_user_totalnum}: $magic[weight]</td></tr>
	<tr class="altbg2"><td class="altbg2">{lang magics_permission}: <font color=red><!--{if $useperm}--> {lang magics_permission_yes} <!--{else}--> {lang magics_permission_no} <!--{/if}--></font>
	<!--{if $magic[type] == 1}-->
		<br>{lang magics_permission_forum}:
		<!--{if $forumperm}-->$forumperm<!--{else}--> {lang magics_permission_allforum} <!--{/if}-->
	<!--{/if}-->
	<!--{if $magic[type] == 2}-->
		<br>{lang magics_permission_group}:
		<!--{if $targetgroupperm}-->$targetgroupperm<!--{else}--> {lang magics_permission_allgroup} <!--{/if}-->
	<!--{/if}-->
	</td></tr>
	<!--{if $operation != 'use'}-->
		<tr class="altbg2"><td class="altbg2" width="10%">
			{lang magics_num}:<input name="magicnum" type="text" size="5" value="1">&nbsp;&nbsp;
		<!--{if $operation == 'sell'}-->
			{lang magics_price}:<input name="price" type="text" size="5">
		<!--{/if}-->
		<!--{if $operation == 'give' && $allowmagics > 1 }-->
			{lang magics_target_present}:<input name="tousername" type="text" size="5">
		<!--{/if}-->
		</td></tr>
	<!--{/if}-->
	</table></div>
	<!--{if $operation == 'use'}-->{eval showmagic();}<!--{/if}-->
	<br />
	<div class="option" style="width: 98%">
		<div class="submitbutton">
			<!--{if $operation == 'give'}-->
				<input class="button" type="submit" name="operatesubmit" value="{lang magics_operation_present}"  onclick="return confirm('{lang magics_confirm}');">
			<!--{elseif $operation == 'drop'}-->
				<input class="button" type="submit" name="operatesubmit" value="{lang magics_operation_drop}"  onclick="return confirm('{lang magics_confirm}');">
			<!--{elseif $operation == 'sell'}-->
				<input class="button" type="submit" name="operatesubmit" value="{lang magics_operation_sell}"  onclick="return confirm('{lang magics_confirm}');">
			<!--{elseif $operation == 'use'}-->
				<input class="button" type="submit" name="usesubmit" value="{lang magics_operation_use}">
			<!--{/if}-->
		</div>
	</div>
	</form>
<!--{/if}-->
</tr></table></div>
</td></tr></table>
{template footer}