<?php
	$topdir = '..';
	require $topdir."/dacode.php3";

	$news = LoadClass('News');
	$session = LoadClass('Session');
	$html = LoadClass('Html');

	header("Content-Type: text/html");

	$newstempo = $news->get_news(20,0,0,1,1,0,0);

	$output = "";

	if (gettype($newstempo) == "array") {
		reset($newstempo);
		while ($cur=current($newstempo)) {
			ereg("^([0-9]{4})([0-9]{2})([0-9]{2})", $cur['timestamp'], $res);
			$output .= "&nbsp;-&nbsp;<a href=\"".
					$session->newsurls($cur['id'],0,0,$res[1],$res[2],$res[3]).
					"\" target=\"blank\">".htmlentities($cur['title'])."</a><br>\n";
			next($newstempo);
		}
	}

	$output = $html->sidebox("<a href=\"$config->basehref\">$config->name</a>", $output);
	$output = split("\n",$output);
	$real = "";

	while($t = each($output)) {
		$t[1] = str_replace("'","\\'",$t[1]);
		$real .= "document.write('$t[1]');\n";
	}

	echo $real;
?>
