/*====================================================================*
 *   
 *   signed DivisionHeader (signed margin, const char * style);
 *   
 *   page.h
 *   
 *   This software and documentation is the property of Atheros 
 *   Corporation, Ocala, Florida. It is provided 'as is' without 
 *   expressed or implied warranty of any kind to anyone for any 
 *   reason. Atheros assumes no responsibility or liability for 
 *   errors or omissions in the software or documentation and 
 *   reserves the right to make changes without notification. 
 *   
 *   Atheros customers may modify and distribute the software 
 *   without obligation to Atheros. Since use of this software 
 *   is optional, users shall bear sole responsibility and 
 *   liability for any consequences of it's use. 
 *   
 *.  Atheros Powerline Toolkit for HomePlug AV;
 *:  Published 2006-2009 by Intellon Corp. ALL RIGHTS RESERVED;
 *;  For demonstration; Not for production use;
 *
 *   Contributor(s):
 *      Charles Maier <charles.maier@atheros.com>
 *
 *--------------------------------------------------------------------*/

#ifndef DIVISIONHEADER_SOURCE
#define DIVISIONHEADER_SOURCE

#include <stdio.h>

#include "../tools/markup.h"
#include "../tools/format.h"
#include "../cgi/page.h"

signed DivisionHeader (signed margin, const char * style) 

{
	output (margin, "content-type: %s\n", ISO_CONTENT);
	output (margin, "<?xml version='%s' encoding='%s'?>", XML_VERSION, XML_CHARSET);
	output (margin, "<!doctype html public '%s' '%s'>", W3C_STD, W3C_DTD);
	output (margin++, "<html xmlns='%s' lang='%s'>", XML_NAMESPACE, XML_LANGUAGE);
	output (margin++, "<head>");
	output (margin++, "<title>");
	output (margin, "%s", PAGE_NAME);
	output (margin--, "</title>");
	output (margin, "<meta http-equiv='content-type' content='%s'/>", HTML_CONTENT);
	output (margin, "<meta name='generator' content='%s'/>", HTML_PROGRAM);
	output (margin, "<meta name='author' content='%s'/>", HTML_AUTHOR);
	output (margin, "<link href='%s' rel='stylesheet' type='text/css'/>", PAGE_STYLESHEET);
	output (margin--, "</head>");
	output (margin++, "<body>");
	output (margin++, "<form action='%s' method='POST' enctype='multipart/form-data'>", PAGE_PATH);
	output (margin++, "<div class='%s'>", style);
	output (margin, "<img class='%s' src='%s' alt='%s'/>", style, PAGE_LOGO_PATH, PAGE_LOGO_TEXT);
	output (margin--, "</div>");
	return (margin);
}

#endif