#!/usr/bin/perl

use CGI qw(:standard);
&decode_vars;

$title=$fields{'title'};
$affiliatenum=$fields{'affiliatenum'};
$titleurl=$fields{'titleurl'};
$navigation=$fields{'navigation'};

$type=$fields{'type'};
$star=$fields{'star'};
$name=$fields{'name'};
$description=$fields{'description'};

if ($navigation eq "") {
    $navigation = "navigation";
}


print "Content-type: text/html\n\n";
print <<"END";
<html>
<head>
	<title>$title</title>
</head>

<frameset cols="112,*" frameborder="0" border="0">
	<frame src="http://www.mallcom.com/superstore-cgi/hazel.cgi?rn=$affiliatenum&action=serve&item=bg01/$navigation.html" name="category" border="0" noresize="noresize">
	<frameset rows="75,*" cols="620" border="0">
		<frame src="http://$titleurl" scrolling="no" name="title" border="0" marginheight="0" marginwidth="0" noresize="noresize">
		<frame src="http://www.mallcom.com/superstore-cgi/hazel.cgi?rn=$affiliatenum&action=serve&item=bg01/cgisearch.html&starring=$star&name=$name&image3=$type&description=$description" name="products" border="0">
	</frameset>
</frameset>
<noframes><body>
<script language="JavaScript">
<!--
alert("Your Browser Does Not Support Frames.\nInstall A More Recent Version.");
</script>
</body></noframes>
</html>
END



##################################################################
sub decode_vars
 {
  $i=0;
  @pairs=split(/&/,$ENV{'QUERY_STRING'});
  foreach $item(@pairs)
   {
    ($key,$content)=split(/=/,$item,2);
    $content=~tr/+/ /;
    $content=~s/%(..)/pack("c",hex($1))/ge;
    $content=~s/\t/ /g;
    $fields{$key}=$content;
   }
}