#!/usr/bin/perl
# 
#  index.pl - the main Oroborus website
# 
#  Copyright (C) 2003 Stefan Pfetzing and Martin Helas
# 
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
# 
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
# 
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
# 

# Add the modules dir to the Include path.
BEGIN {
	$_=$0;
	s/\/[^\/]*$//g;
	push @INC,$_."/modules";
	$_=undef;
}

# Use strict so we make less mistakes.
use strict;
# For development use Pretty formating, later disable that.
use CGI qw/:standard/;
# Load our Menu Module.
use Oroborus::Menu;
# Load our Main Module.
use Oroborus::Main;
# Load our Footer Module.
use Oroborus::Footer;

# Define some global variables.
our ($q, $menu, $main, $footer);

# create a new CGI object
$q = new CGI();

# create a new Menu object
$menu = new Oroborus::Menu($q);

# create a new Main object
$main = new Oroborus::Main($q);

# create a new Footer object
$footer = new Oroborus::Footer($q);

# set the node correctly
$q->param("node", "Main") if (!$q->param("node"));

print $q->header(-charset => "iso-8859-15");
print $q->start_html(	-title => "The Oroborus Project",
			-author => "Stefan Pfezing <dreamind AT dreamind DOT de>",
			-base => "true",
			-meta => { 'keywords' => 'oroborus ikeyd keylaunch deskmenu windowmanager window manager dreamind mhelas',
				'copyright' => 'Copyright (C) 2003 Martin Helas and Stefan Pfetzing',
				'Content-Type' => 'text/html; charset=iso-8859-15'},
			-style => { 'src' => 'styles.css' },
			-dtd => CGI::XHTML_DTD,
			-encoding => "iso-8859-15",
			-script => { -language => "JavaScript",
				-src => "main.js"},
			-onLoad => 'initialize()');
print $q->div({-align=>"center"},
	$q->table({ 
		-width=>"780",
		-border=>"0",
		-cellpadding=>"1",
		-cellspacing=>"0",
		-class=>"NodeFrame"},
		$q->Tr(
			$q->td(
				$q->table({
					-width=>"100%",
					-border=>"0",
					-cellpadding=>"1",
					-cellspacing=>"0",
					-class=>"Node"},
					$q->Tr(
						$q->td({-width=>"100"},
							$q->div({-align=>"center"},
								$q->a({-href=>"index.pl"},
									$q->img({-src=>"images/snake-logo-small.png",
										-width=>"66",
										-height=>"70",
										-border=>"0",
										-alt=>"Oroborus logo"})
									)
								)
							),
						$q->td(
							$q->h1("Oroborus"),
							$q->h4("A minimalistic window manager")),
						$q->td({-width=>"100"},'&nbsp;')
						),
					$menu->toString(),
					$main->toString(),
					$footer->toString()
					)
				)
			)
		)
	);
print $q->end_html();
# return a true value
1

