#!/usr/bin/perl

$vo = $ENV{QUERY_STRING};

if ($vo eq '') {
print "Content-type: text/html\n\n";
exit;
}

#$vo = "language";
$hossz = length($vo);
open(BE, "</home/bogardi/vegyes/link.htm");
@b = <BE>;
close(BE);

open(JUMP, "</home/bogardi/public_html/gen/gjump.txt");
@gjump = <JUMP>;
close(JUMP);

@k = ();
#$x = '<html><body bgcolor=white><table width=620 border=0>';
$x = '<table width=620 border=0>';
push(@k, $x);

@head = ();
$p = 0;
for (@b)
{
if (substr($b[$p], 3, $hossz) eq $vo and substr($b[$p], 0, 3) eq "[[[")
    {
	$tit = $b[$p+1];


	$zz = 2;
	while (substr($b[$p+$zz], 0, 3) ne "[[[")
	{
	    push(@head, $b[$p+$zz]);
	    $zz++;
	}
    }
    if (substr($_, 2, $hossz) eq $vo and substr($_, 0, 1) eq "|")
    {
	$x1 = '<tr><td width=620 colspan=2>';
	$x2 = substr($b[$p-4], 2); chomp($x2);
	$x3 = substr($b[$p-3], 2); chomp($x3);
#	$x4 = '</td></tr><tr><td width=20>'."&nbsp;&nbsp;&nbsp;".'</td><td width=600>';
	$x4 = '</td></tr><tr><td width=20></td><td width=600>';
	$x5 = substr($b[$p-1], 2); chomp($x5);

	$x6 = "<font size=-1> [Language: ".substr($b[$p-2], 2)."] [Added: "; chomp($x6);
	$x7 = substr($b[$p+1], 2); chomp($x7); $x7 =~ s/(....)(..)(..)/$3\/$2\/$1/;
	$x7 =~ s/00\/00\/0000/before July 1999/;
	$x8 = ']</font></td></tr>'."\n";
	push(@k, $x1, $x2, $x3, $x4, $x5, $x6, $x7, $x8);
    }

    $p++;
}

$x = "</table>\n";
push(@k, $x);


print "Content-type: text/html\n\n";

print <<SZOVEG;
<html><head><title>Radix links: $tit</title>
<!-- Begin Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent --><script type="text/javascript">window.cookieconsent_options = {"message":"Advertisers on our site may use cookies.","dismiss":"Got it","learnMore":"","link":null,"theme":"dark-bottom"};</script><script type="text/javascript" src="http://www.radixmedia.net/js/cookieconsent.min.js"></script><!-- End Cookie Consent plugin -->
</head>
<body bgcolor=white><table width=620><tr><td>
<table width=620 border=0 cellpadding=0 cellspacing=0><tr><td width=140>
@gjump
</td><td width=480 align=right>
SZOVEG

#require "banrot_d.pl";

print <<SZOVEG;
<script type="text/javascript"><!--
google_ad_client = "pub-4382449878305133";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="4261797094";
google_color_border = "CCCCCC";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


</td></tr></table>
<h3>Radix links: $tit</h3>

@head
@k
</td></tr></table>
</body></html>
SZOVEG
