[comment]
ui_component: random
ui_component_type: content, vertical
ui_component_group: promotion
ui_component_label: Random items

matches:
	label: Number to show
	widget: select
	options: 1,2*,3,4,5,6,7,8,9,10

pool:
	label: Number to select from
	widget: select
	options: 100,1000*,10000
	help: Controls now many items will be returned and randomized, \
always from the beginning of the database/text file

table_width:
	label: Table width
	options: 150,300,450
	widget: combo
	filter: nullselect

cols:
	label: Columns
	options: 1*,2,3,4
	widget: select

banner:
	label: Banner for top box
	widget: text
	width: 40

[/comment]

<!-- BEGIN COMPONENT [control component random] -->

<br>

<table width="[control table_width 90%]" align="center">
<tr> 
  <td class="categorybar">
    &nbsp;<b>[control banner See also]</b>
  </td>
</tr>
<tr>
  <td align="center"> 
    <br>
    [calc]
  	my $n = [control cols 2];
	$Scratch->{width_percent} = int(100 / $n) . '%';
	return;
    [/calc]
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
    [table-organize embed=1 pretty=1 cols="[control cols 2]"]
	[loop
			random="[control matches 2]"
			search="
					fi=products
					st=db
					ra=yes
					ml=[control pool 1000]
				"]
      <TD width="[scratch width_percent]" valign="top" align="center"> 
	<table border="0" cellspacing="0" cellpadding="0" width="75%">
	<tr> 
	  <td width="75%" class="contentbar1" align="center">
	    &nbsp;[loop-description]
	  </td>
	</tr>
	<tr> 
	  <td nowrap align="center">
	    <a href="[area [loop-code]]">More Info</a>
		[if-loop-data options o_modular]
			[page [loop-code]]
		[else]
			[order [loop-code]]
		[/else]
		[/if-loop-data]
	    <img align="top" src="__THEME_IMG_DIR__buynow.gif" border="0"></A>
	  </td>
	</tr>
	<tr> 
	  <td align="center">
	    Our Price: <b>[loop-price]</b>
	  </td>
	</tr>

	[if-loop-field thumb]
	<tr> 
	  <td align="center"> 
	      <a href="[area [loop-code]]">
	      <img border="0" src="thumb/[loop-field thumb]"></a>
	  </td>
	</tr>
    [/if-loop-field]

        <tr>
          <td><p>&nbsp;<br><br></p></td>
        </tr>
	</table>
      </TD>
      [/loop]
      [/table-organize]
    </table>
  </td>
</tr>
</table>

<!-- END COMPONENT [control component random] -->
