#!/usr/bin/perl -w
#######($ENV{'SERVER_SOFTWARE'}=~/IIS.\d+.0$/){my $cd=$0;$cd=~s/[^\\]*$//;chdir($cd);}
require "config.cgi";
$jdwmframesize = 60;
$framesize = 140;
&auth();
#exit if !$ARGV[3];

%i = &getenv("$userdir/$jdwa/config.tab",'=');
@domainadmin = &domainadmin($user1,$domain1,'c');
$argment = '_';
$topmenu2 = "help.cgi";
if ((($i{'jdwmxenable'} && $i{'jdwmxtopmenu'} >= 2) || $topmenu >= 2) && @domainadmin){
	$argment = shift(@domainadmin);
	$topmenu2 = "domain_home.cgi";
} elsif ($allowmail && $i{'jdwmallowmail'}){
	if ($i{'jdwmxenable'}){if ($i{'jdwmxtopmenu'}){$topmenu2 = "mailbox_start.cgi";}}
	elsif ($topmenu){$topmenu2 = "mailbox_start.cgi";}
}
if (!$framesize){$framesize = $framesize0;}

$JDWM = <<"EOF";
<html>
<head>
<title>$ttitle</title>
</head>
<frameset rows='$jdwmframesize,*' border=0 frameborder=0 framespacing=0>
	<frame src='menu.cgi?$argment' marginheight=0 marginwidth=0 noresize scrolling='no' noresize>
	<frameset cols='$framesize,*' border=0 frameborder=0 framespacing=0>
		<frame src='menu1.cgi?$argment' name='menu' marginheight=2 marginwidth=2 scrolling='auto' noresize>
		<frame src='$topmenu2?$argment' name='main' marginheight=20 marginwidth=15 scrolling='auto' noresize>
	</frameset>
</frameset>
</html>
EOF

$JDWM =~ s/[\r\n]+\s*//g;

print "Content-type: text/html; charset=$charset\n";
print "CacheControl: no-cache\nPragma: no-cache\nExpires: -1\n\n";
print $JDWM;
exit;
