<?php
function scroll($categoryID)
{
	$sql = "select mediaID, lastdate, mediaName, mediaDescrip, mediaURL from media_media order by lastdate desc, mediaID desc limit 10";
	$result = mysql_query($sql);
	
	echo "<table align=\"left\" border=0 cellspacing=0 cellpadding=0 width=100%>";
	while ($row = mysql_fetch_array($result))
	{
		$year = substr($row[1], 0, 4);
		$month = substr($row[1], 5, 2);
		$day = substr($row[1], 8, 2);
		$url = $row[4];
		$descr = $row[3];
		if (strlen($descr) > 100) $descr = substr($descr, 0, 97) . "...";
		
		
		//$date = "$day/$month/$year";
		$date = date("M jS Y", mktime(0,0,0, $month, $day, $year));
		echo "<tr><td><a href=\"javascript:openPopWin('pd.php?id=$row[0]', 550,500)\"><img border=0 width=140 src=\"press/$url\"></a></td></tr>";
		echo "<tr><td style=\"font-size: 10px\">$date</td></tr>";
		//echo "<tr><td><a href=\"javascript:openPopWin('pd.php?id=$row[0]', 550,500)\"><font color=\"#666666\" size=1><b>" . $row[2] . "</b></font></a></td></tr>";
		echo "<tr><td style=\"font-size: 10px\">$descr</td></tr>";
		echo "<tr><td>&nbsp;</td></tr>";
	}
	?>
	<tr><td><a href="press.php"><font color="#666666"><b>View All</b></font></a></td></tr>
	<?php
	echo "</table>";
}                                    
?>