<?php

if ($statistictracking == 1 AND $page != "Admin - User Tracking")
{
    $referrer = $HTTP_REFERER;
    $strip = $REMOTE_ADDR;
    $browser = $HTTP_USER_AGENT;
    if (isset($gfcookie[1]))
    {
        $username = $gfcookie[1];
    }
    else
    {
        $username = "Not Logged In";
    }

    $query = "INSERT INTO $statstable (strName, strRefer, strIp, strBrowser, strPage, strTime, strDate, intEpochTime, strPageLink) values( '$username', '$referrer', '$strip', '$browser', '$page', '$ftime', '$date', '$epoch', '$pagelink')";
    mysql_query( $query, $link ) or die ( "Error in Stats Tracking! : ".mysql_error() );
}

print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<hmtl>
<head>
<meta name=\"AUTHOR\" content=\"Matt Squirrell\">
<meta name=\"COPYRIGHT\" content=\"(c)2003 HSMX Web Design\">
<meta name=\"CONTACT\" content=\"grimforum@hsmx.com\">
<title>$title</title>
<META name=\"description\" content=\"$metadescription\">
<META name=\"keywords\" content=\"GrimForum, HSMX, Web Design, $metakeywords\">";
if ($keyboardnavigation == 1 AND $admin !=1 AND $admin !=2 AND $keynav != 0)
{
    print "<SCRIPT LANGUAGE=\"JavaScript\">

    <!-- Begin
    var key = new Array();  // Define key launcher pages here
    key['f'] = \"forums.php\";
    key['b'] = \"buddymenu.php\";
    key['a'] = \"active_topics.php\";
    key['i'] = \"inbox.php\";
    key['m'] = \"members.php\";

    function getKey(keyStroke) {
    isNetscape=(document.layers);
    eventChooser = (isNetscape) ? keyStroke.which : event.keyCode;
    which = String.fromCharCode(eventChooser).toLowerCase();
    for (var i in key) if (which == i) window.location = key[i];
    }
    document.onkeypress = getKey;
    //  End -->
    </script>";
}

if ($postit == 1 AND isset($gfcookie[1]))
{
    ?>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400');");
    }
    // End -->
    </script>
    <?
}

print "</head>";

?>