diff --git a/common.inc.php b/common.inc.php
index 508eee86..100d5234 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -1,23 +1,99 @@
require("config.inc.php");
+mysql_connect($DBHOST,$DBUSER,$DBPASS);
+mysql_select_db($DBNAME);
+
+
+function i18n($str)
+{
+ if(!$str)
+ return "";
+
+ if($_SESSION['lang'])
+ {
+ if($_SESSION['lang']=="en")
+ return $str;
+ else
+ {
+ $q=mysql_query("SELECT * FROM languages WHERE lang='".$_SESSION['lang']."' AND str='".mysql_escape_string($str)."'");
+ if($r=@mysql_fetch_object($q))
+ {
+ if($r->val)
+ return $r->val;
+ else
+ {
+ return "($str)";
+ }
+
+ }
+ else
+ {
+ mysql_query("INSERT INTO languages (lang,str) VALUES ('".$_SESSION['lang']."','".mysql_escape_string($str)."')");
+ echo mysql_error();
+ return "($str)";
+ }
+ }
+ }
+ else
+ {
+ //no language set, assume english
+ return $str;
+ }
+}
+
function send_header($title="")
{
+ global $FAIRYEAR;
+ $q=mysql_query("SELECT * FROM config WHERE year='$FAIRYEAR'");
+ while($r=mysql_fetch_object($q))
+ {
+ $config[$r->var]=$r->val;
+ }
+
?>
-
+
=$title?>
+
-Science Fair In A Box
-
+
+
+
+
+
+
}
function send_footer()
{
?>
+
+
+
diff --git a/config.inc.php b/config.inc.php
index 7ef8b8d5..0cd6843a 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -1,5 +1,9 @@
-$SFIABDIRECTORY="sfiab/";
-
+$SFIABDIRECTORY= "sfiab/";
+$FAIRYEAR= 2005;
+$DBHOST= "localhost";
+$DBNAME= "sfiab";
+$DBUSER= "sfiab";
+$DBPASS= "sfiab";
?>
diff --git a/sfiab.css b/sfiab.css
new file mode 100644
index 00000000..e89e7995
--- /dev/null
+++ b/sfiab.css
@@ -0,0 +1,87 @@
+body
+{
+ font-family: Verdana, Arial;
+ margin: 0;
+ padding: 0;
+ background: #E0E0FF;
+}
+
+#header {
+ height: 50px;
+ text-align: center;
+ background: #E0E0FF;
+ padding: 10px;
+}
+
+#footer {
+ text-align: center;
+ background-color : #5C6F90;
+ font-size: 10px;
+
+}
+
+#left {
+ position: absolute;
+ top: 80px;
+ left: 10px;
+ width: 175px;
+ background: #EEEEFF;
+ border: 2px solid silver;
+ padding: 5px;
+}
+
+
+#main {
+ background: #EEEEFF;
+ margin-left: 210px;
+ margin-top: 10px;
+ margin-right: 10px;
+ padding: 5px;
+ border: 2px solid silver;
+ min-height: 400px;
+
+}
+
+h1,h2,h3 {
+ margin-top: 0;
+}
+
+ul.mainnav {
+ list-style : none;
+ margin : 0;
+ padding : 0;
+ background-color : #d6d6d6;
+}
+
+ul.mainnav li {
+ display : block;
+ border-top : 1px solid #a5b5c6;
+}
+
+ul.mainnav li a {
+ display : block;
+ margin : 0;
+ padding : 6px 6%;
+ background-color : #5C6F90;
+ font : bold 0.8em/1.5 arial, sans-serif;
+ color : #fff;
+ text-decoration : none;
+ width : 88%;
+}
+
+ul.mainnav li a:hover {
+ background-color : #63616b;
+ color : #eee;
+}
+
+.aligncenter {
+ width: 100%;
+ text-align: center;
+}
+
+a {
+ text-decoration: none;
+ font-weight: bold;
+ font-size: 10px;
+ color: #5C6F90;
+}