Index: /branches/htmlform/cgi-bin/main.cgi
===================================================================
--- /branches/htmlform/cgi-bin/main.cgi	(revision 450)
+++ /branches/htmlform/cgi-bin/main.cgi	(revision 451)
@@ -55,8 +55,8 @@
 $ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates';
 
-# Headerize!  Make sure we replace the $$EXTRA0$$ bit as needed.
-printHeader('', ($IPDBacl{$authuser} =~ /a/ ?
-	'<td align=right><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a>' : ''
-	));
+my $header = HTML::Template->new(filename => "header.tmpl");
+$header->param(version => $IPDB::VERSION);
+$header->param(addperm => $IPDBacl{$authuser} =~ /a/);
+print "Content-type: text/html\n\n", $header->output;
 
 # Set up the CGI object...
Index: /branches/htmlform/cgi-bin/search.cgi
===================================================================
--- /branches/htmlform/cgi-bin/search.cgi	(revision 450)
+++ /branches/htmlform/cgi-bin/search.cgi	(revision 451)
@@ -74,8 +74,8 @@
 }
 
-# Headerize!  Make sure we replace the $$EXTRA0$$ bit as needed.
-printHeader('', ($IPDBacl{$authuser} =~ /a/ ?
-	'<td align=right><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a></td>' : ''
-	));
+my $header = HTML::Template->new(filename => "header.tmpl");
+$header->param(version => $IPDB::VERSION);
+$header->param(addperm => $IPDBacl{$authuser} =~ /a/);
+print "Content-type: text/html\n\n", $header->output;
 
 if ($webvar{stype} eq 'q') {
Index: /branches/htmlform/ipdb.css
===================================================================
--- /branches/htmlform/ipdb.css	(revision 450)
+++ /branches/htmlform/ipdb.css	(revision 451)
@@ -1,3 +1,55 @@
+/* Default/global defs for specific tags */
+fieldset {
+        border: none;
+        padding: 0px;
+        margin: 0px;
+}
+
 /* Specific divs */
+#bodyheader {
+	margin-left: 4px;
+	position: relative;
+}
+#homelink {
+	font-size: 13px;
+	font-weight: bold;
+	position: absolute;
+	right: 10px;
+	bottom: 2px;
+	text-align: right;
+}
+#subheader {
+	background-color: #D0E0E0;
+	font-size: 90%;
+	padding: 3px;
+	border-top: thin solid #000000;
+	/* apparently this is required to keep "contained" position: absolute divs from escaping.  O_o */
+	position: relative;
+}
+#csearch {
+	float: right;
+	padding: 3px;
+}
+#newlink {
+	position: absolute;
+	right: 10px;
+	top: 6px;
+	text-align: right;
+}
+#main {
+        padding: 10px;
+        border-top: thin solid #000000;
+/*        text-align: center;*/
+        padding-top: 20px;
+        position: relative;
+}
+#utils {
+	font-size: 13px;
+	font-weight: bold;
+	position: absolute;
+	right: 10px;
+	top: 2px;
+	text-align: right;
+}
 #adminlink {
 	position: absolute;
@@ -27,4 +79,9 @@
 a:hover         { color:#dd00dd; }      /* mouse over link */
 a:active        { color:#cc0000; }      /* selected link */
+
+table.centre {
+	margin-left: auto;
+	margin-right: auto;
+}
 
 /* Defs for bulk-data rows */
@@ -81,4 +138,5 @@
 }
 
+/* Generic classes */
 .indent {
 	margin-left: 5%;
Index: /branches/htmlform/templates/footer.tmpl
===================================================================
--- /branches/htmlform/templates/footer.tmpl	(revision 450)
+++ /branches/htmlform/templates/footer.tmpl	(revision 451)
@@ -1,10 +1,10 @@
 <br>
 <!-- Done with the main div opened in the header template -->
-<TMPL_IF NAME=adminlink><div id=adminlink><a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div></TMPL_IF>
+<TMPL_IF NAME=adminlink><div id="adminlink"><a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div></TMPL_IF>
 </div>
 
-<div id=footer>
-<div id=contact>DeepNet <a href="http://projects.deepnet.cx/trac/ipdb" target="_blank">IP Database</a> |
- Copyright 2004-2010 <a href="mailto:kdeugau@deepnet.cx">Kris Deugau</a><br />
+<div id="footer">
+<div id="contact">DeepNet <a href="http://projects.deepnet.cx/trac/ipdb">IP Database</a> |
+ Copyright 2004-2010 <a href="mailto:kdeugau@deepnet.cx">Kris Deugau</a><br>
 Written for standards-based browsers (eg <a href="http://www.mozilla.org">Mozilla</a>)
 </div>
Index: /branches/htmlform/templates/header.tmpl
===================================================================
--- /branches/htmlform/templates/header.tmpl	(revision 451)
+++ /branches/htmlform/templates/header.tmpl	(revision 451)
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<!-- DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" -->
+
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>[IP Database v<TMPL_VAR NAME=version>]</title>
+	<link rel="stylesheet" type="text/css" href="/ip/ipdb.css">
+	<link rel="stylesheet" type="text/css" href="/ip/local.css">
+	<script src="/ip/templates/widgets.js" type="text/javascript"></script>
+    </head>
+
+<body>
+
+<div id="bodyheader">
+<div id="hlogo">
+<a href="/ip/index.shtml"><img src="/ip/images/logo.png" style="border:0;" alt="[ Logo ]"></a>
+</div>
+<div id="homelink">
+<a href="/ip/index.shtml">[IP Database v<TMPL_VAR NAME=version> Home]</a>
+</div>
+</div>
+
+<div id="subheader">
+<div id="qsearch">
+<form method="post" action="/ip/cgi-bin/search.cgi">
+<fieldset><legend></legend>
+Quick Search:
+<input type="text" name="input" size="20" maxlength="50" class="regular">
+<input type="hidden" name="page" value="1">
+<input type="hidden" name="stype" value="q">
+<input type="submit" value="Go!" class="heading">
+<input type="button" value=" Help? " onclick="openHelp()" class="regular">
+&nbsp; &nbsp;<a href="/ip/cgi-bin/search.cgi">Complex Search</a>
+</fieldset>
+</form>
+</div>
+<TMPL_IF NAME=addperm>
+<div id="newlink"><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a></div>
+</TMPL_IF>
+</div>
+
+<div id="main">
+<div id="utils">
+<a href="/ip/cgi-bin/main.cgi?action=nodesearch">Find by connection point</a>
+</div>
Index: /branches/htmlform/templates/index.tmpl
===================================================================
--- /branches/htmlform/templates/index.tmpl	(revision 450)
+++ /branches/htmlform/templates/index.tmpl	(revision 451)
@@ -1,12 +1,15 @@
 <br>
-<center><table width="98%" cellspacing="0" class="center"><tr class=heading>
+<div class="center">
+<table class="centre" width="98%" cellspacing="0">
+<tr class="heading">
 <td>Master netblock</td>
 <td>Routed netblocks</td>
 <td>Allocated netblocks</td>
-<td>Free netblocks</td><td>Largest free block</td>
+<td>Free netblocks</td>
+<td>Largest free block</td>
 </tr>
 <TMPL_LOOP NAME=masterlist>
 <tr class="<TMPL_VAR name=rowclass>">
-<td><a href="/ip/cgi-bin/main.cgi?action=showmaster&block=<TMPL_VAR NAME=master>"><TMPL_VAR NAME=master></a></td>
+<td><a href="/ip/cgi-bin/main.cgi?action=showmaster&amp;block=<TMPL_VAR NAME=master>"><TMPL_VAR NAME=master></a></td>
 <td><TMPL_VAR NAME=routed></td>
 <td><TMPL_VAR NAME=allocated></td>
@@ -21,4 +24,4 @@
 <br><br>
 Note:  Free blocks noted here include both routed and unrouted blocks.
-</center>
+</div>
 
Index: /branches/htmlform/templates/widgets.js
===================================================================
--- /branches/htmlform/templates/widgets.js	(revision 451)
+++ /branches/htmlform/templates/widgets.js	(revision 451)
@@ -0,0 +1,12 @@
+function openHelp() {
+	window.open("/ip/help.html", "help_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=700,height=400")
+}
+function openTables() {
+	window.open("/ip/tables.html", "subnet_tables", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=250")	
+}
+function helpAllocTypes() {
+	window.open("/ip/alloctypes.html", "alloc_window", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=750,height=550")
+}
+function popNotes(page) {
+	window.open(page, "IPDB_notes", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=300");
+}
