 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<?php
//------------------------------------------------------------------------------------------------------

$r = $rowxxx[R];
if ($rowxxx[R] == '') $r = 2;

if ($r == 1)  $w = '100%';
if ($r == 2)  $w = '50%';
if ($r == 3)  $w = '33%';
if ($r == 4)  $w = '25%';
if ($r == 5)  $w = '20%';

$SQL = "SELECT * from PAGES WHERE CAPTIONSHOW = '' ORDER BY ID DESC LIMIT 10";
$counter = '0';
$result = @mysql_query( $SQL ); while( $row = @mysql_fetch_array( $result ) ) {
$pieces = explode("-", $row[CATEGORY]);
$row[CATEGORY] = $pieces[1];
$MyProductTitleHome=EdURL($row[TITLE]);

if ($counter == $r) $counter = 0;
//-----------------------------------------------------------------------------
?>

<?PHP 
$link = "?page=pages&id=$row[ID]";
$tmpheader = $row[HEADER];
$row[HEADER] = strtolower($row[HEADER]);
$row[HEADER] = EdURL($row[HEADER]);
if ($rowxxx[MR] == Enabled) {
	if ($row[HEADER] != '')
		$link = "$row[HEADER].html";
}
$row[HEADER] = $tmpheader;
?>

<td width="<?php echo $w; ?>" valign="top"> 
<table border="0" cellspacing="0" cellpadding="0" width="100%" align="CENTER">
<tr> 
<td><img src="images/ltl.png"></td>
<td background="images/lt.png" height="6"></td>
<td><img src="images/ltr.png"></td>
</tr>
<tr> 
<td background="images/sf-l.jpg"></td>
<td class="td2" width="100%" bgcolor="#FFFFFF" valign="top"> 
<?PHP 
$pieces = explode("&", "$row[URL]");
$row[URL] = $pieces[0];
$pieces = explode("&", "$row[URL]");
$row[URL] = $pieces[0];
$pieces = explode("&", "$row[URL]");
$row[URL] = $pieces[0];
$pieces = explode("v=", "$row[URL]");
$video = "$pieces[1]";
?>
<a href="<?php echo $link; ?>"><img src="http://img.youtube.com/vi/<?php echo $video; ?>/0.jpg" border="0" width="100%" /></a></td>
<td background="images/lr.png"></td>
</tr>
<tr> 
<td><img src="images/lbl.png"></td>
<td background="images/lb.png" height="6"></td>
<td><img src="images/lbr.png"></td>
</tr>
</table>

<?PHP if ($rowxxx[SHOWTITLE] == 1) { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="td4">
<div align="center"><span class="link6"><a href="<?php echo $link; ?>"> 
<?php echo $row[HEADER]; ?>
</a></span> </div>
</td>
</tr>
</table>
<?PHP } ?>

<?PHP if ($rowxxx[SHOWCAPTION] == 1) { ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="td4">
<?php $row[CAPTION] = preg_replace("/\n/","\n<BR>",$row[CAPTION]); ?>
<?php echo $row[CAPTION]; ?>

</td>
</tr>
</table>
<?PHP } ?>

</td>
<?Php
$set = $r;

$r = $r - 1;

 if ($counter < $r) { ?>
<td><img src="images/transparent.gif" width="15" height="10"></td>
<?PHP } ?>

<?Php if ($counter == $r) { ?>
<tr>
<td height="15"><img src="images/transparent.gif" width="15" height="15"></td>
<td><img src="images/transparent.gif" width="15" height="15"></td>
<tr></tr>
<?PHP } $counter = $counter + 1; $r = $set; ?>

<?PhP } ?>
</table>

