<?  
$query = mysql_query ("SELECT logo, category_name, id, category_name FROM jshop_categories WHERE root_category = 0 ORDER by category_name");
if (mysql_num_rows($query))
{
	$tr = 0;
	echo "<table width=\"100%\" align=center border=0 cellpadding=0 cellspacing=20><tr valign=top>";
	while ($cat = mysql_fetch_assoc ($query))
	{
		echo "<td width=\"50%\">";
		if ($cat['logo']) echo "<img alt=\"".$cat['category_name']."\" src=\"".$h."/upload_category/".$cat['logo']."\" align=left hspace=10>";
		echo "<a href=\"".$h."/cat/".$cat['id']."/\" title=\"".$cat['category_name']."\"><span class=\"bgreen nd\">".$cat['category_name']."</span></a><br /><br /><br />";
		echo "</td>"; 
		$tr++; if ($tr % 2 == 0)  echo "</tr><tr valign=top>";
	}
	echo "</tr></table>";
}
?>