<?php
session_start();
require('../inc/global.php');
// CTS 2026-05-20: removed debug session log (leaked serialized $_SESSION + PHP 8 undefined vars)
// ini_set('display_errors', 'On');
// error_reporting(E_ALL);
//echo $_SERVER['REQUEST_METHOD'];

// --- Security hardening added 2026-05-14 (incident response) ---
// Per-IP rate limiter for login attempts. State file lives outside webroot.
$__rl_dir = '/var/www/vhosts/rutherfordinvestments.com/private';
$__rl_ip  = preg_replace('/[^0-9A-Fa-f:.]/', '', $_SERVER['REMOTE_ADDR'] ?? 'unknown');
$__rl_file = $__rl_dir . '/login-rl-' . md5($__rl_ip) . '.json';
$__rl_max = 5;        // max failed attempts
$__rl_win = 900;      // 15-minute window (seconds)
$__rl_record = ['count' => 0, 'first' => time()];
if (is_file($__rl_file)) {
    $__rl_raw = @file_get_contents($__rl_file);
    $__rl_tmp = @json_decode($__rl_raw, true);
    if (is_array($__rl_tmp) && isset($__rl_tmp['count'], $__rl_tmp['first'])) {
        $__rl_record = $__rl_tmp;
    }
}
// Reset window if expired
if (time() - $__rl_record['first'] > $__rl_win) {
    $__rl_record = ['count' => 0, 'first' => time()];
}

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    // If currently locked out, reject without DB hit.
    if ($__rl_record['count'] >= $__rl_max) {
        // Refresh window if expired
        if (time() - $__rl_record['first'] <= $__rl_win) {
            session_destroy();
            header('Location: /investor-login.php?msg=invalid');
            exit;
        }
    }

    // echo "post <br>";
    // echo $_POST['username'] . "<br>";
    // echo $_POST['password'] . "<br>" . "<br>";
    $username = $db->real_escape_string($_POST['username']);
    $raw_password = isset($_POST['password']) ? $_POST['password'] : '';

    $password = sha1($db->real_escape_string($raw_password)); // legacy SHA1 fallback

    //  echo "SELECT * FROM investor WHERE username = '$username' AND password = '$password'<br />";
    // Prepared statement lookup by username only; verify hash in PHP.
    $user = null;
    if ($stmt = $db->prepare('SELECT * FROM investor WHERE username = ? LIMIT 1')) {
        $_uname_raw = isset($_POST['username']) ? $_POST['username'] : '';
        $stmt->bind_param('s', $_uname_raw);
        $stmt->execute();
        $res = $stmt->get_result();
        $candidate = $res ? $res->fetch_assoc() : null;
        $stmt->close();

        if ($candidate && isset($candidate['password'])) {
            $stored = $candidate['password'];
            $ok = false;
            // bcrypt / modern hash path
            if (is_string($stored) && strlen($stored) >= 60 && (strpos($stored, '$2y$') === 0 || strpos($stored, '$2a$') === 0 || strpos($stored, '$2b$') === 0)) {
                $ok = password_verify($raw_password, $stored);
            } else {
                // Legacy SHA1 path — try both (a) raw plaintext and (b) real_escape_string-then-sha1
                // because the original storage scheme used real_escape_string before sha1.
                $sha1_raw     = sha1($raw_password);
                $sha1_escaped = sha1($db->real_escape_string($raw_password));
                if (hash_equals((string)$stored, $sha1_raw) || hash_equals((string)$stored, $sha1_escaped)) {
                    $ok = true;
                    // Rehash to bcrypt now that we know the plaintext is valid.
                    $new_hash = password_hash($raw_password, PASSWORD_BCRYPT);
                    if ($new_hash && $rh = $db->prepare('UPDATE investor SET password = ? WHERE investor_id = ?')) {
                        $rh->bind_param('si', $new_hash, $candidate['investor_id']);
                        $rh->execute();
                        $rh->close();
                    }
                }
            }
            if ($ok) {
                $user = $candidate;
            }
        }
    }


    //	file_put_contents("user-query.log", serialize($user).",".$dt.",".$dayhour."\n", FILE_APPEND);
    //	echo $user;
    $t = time();
    $dt = date("Y-m-d-H-i-s", $t);
    $dayhour = date("d-H", $t);
    //$userlog = implode(",",$user);
    $userlog = serialize($user);
    //file_put_contents("post.log", $userlog.",".$dt.",".$dayhour."/n", FILE_APPEND);
    
    if ($user != null) {
        // Successful login: clear rate-limit counter.
        @unlink($__rl_file);
        $_SESSION['investor_id'] = $user['investor_id'];
        $_SESSION['username'] = $user['username'];
        $_SESSION['first_name'] = $user['first_name'];
        $_SESSION['last_name'] = $user['last_name'];
        $_SESSION['email'] = $user['email'];
        $_SESSION['admin'] = $user['admin'];
        $_SESSION['user_agent'] = sha1($_SERVER['HTTP_USER_AGENT']);
        //	echo "user null";
        // update last_login for user
        $db->query('UPDATE investor SET last_login = UTC_TIMESTAMP() WHERE investor_id = ' . $user['investor_id']);
        //	file_put_contents("login-session.log", serialize($_SESSION).",".$dt.",".$dayhour."\n", FILE_APPEND);
        header('Location: index.php?msg=invaid');
        exit;
    } else {
        // Failed login: increment counter.
        $__rl_record['count']++;
        @file_put_contents($__rl_file, json_encode($__rl_record), LOCK_EX);
        session_destroy();
        header('Location: /investor-login.php?msg=invalid');
        exit;
    }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="X-Robots-Tag" content="noindex, nofollow">
    <?php // {{{ 
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Rutherford Investments</title>
    <link rel="stylesheet" type="text/css" href="/css/global.css">
    <link rel="stylesheet" type="text/css" href="/investor/main.css">
    <style type="text/css">
        /*!!!!!!!!!!! QuickMenu Core CSS [Do Not Modify!] !!!!!!!!!!!!!*/
        .qmclear {
            font-size: 1px;
            height: 0px;
            width: 0px;
            clear: left;
            line-height: 0px;
            display: block;
        }

        .qmmc {
            position: relative;
        }

        .qmmc a {
            float: left;
            display: block;
            white-space: nowrap;
        }

        .qmmc div a {
            float: none;
        }

        .qmsh div a {
            float: left;
        }

        .qmmc div {
            visibility: hidden;
            position: absolute;
        }

        /*!!!!!!!!!!! QuickMenu Styles [Please Modify!] !!!!!!!!!!!*/
        /*"""""""" (MAIN) Container""""""""*/
        #qm0 {}

        /*"""""""" (MAIN) Items""""""""*/
        #qm0 a {
            background-color: #222222;
            color: #FFFFFF;
            font-family: Arial;
            font-size: 0.8em;
            text-decoration: none;
            border-width: 1px;
            border-style: none;
        }

        /*"""""""" (MAIN) Hover State""""""""*/
        #qm0 a:hover {}

        /*"""""""" (MAIN) Parent items""""""""*/
        #qm0 .qmparent {}

        /*"""""""" (MAIN) Active State""""""""*/
        body #qm0 .qmactive,
        body #qm0 .qmactive:hover {}

        /*"""""""" (SUB) Container""""""""*/
        #qm0 div {
            background-color: #E7E6E6;
            background-repeat: no-repeat;
            background-position: left center;
            border-width: 1px 1px 0px 1px;
            border-style: solid;
            border-color: #A4A3A4;
        }

        /*"""""""" (SUB) Items""""""""*/
        #qm0 div a {
            padding: 7px;
            margin: 0px;
            background-color: transparent;
            color: #000000;
            font-family: Arial;
            font-size: 0.8em;
            text-decoration: none;
            border-width: 0px 0px 1px 0px;
            border-style: solid;
            border-color: #A4A3A4;
        }

        /*"""""""" (SUB) Hover State""""""""*/
        #qm0 div a:hover {
            background-color: #8D8D8D;
            color: #FFFFFF;
            text-decoration: none;
        }

        /*"""""""" (SUB) Parent items""""""""*/
        #qm0 div .qmparent {}

        /*"""""""" (SUB) Active State""""""""*/
        body #qm0 div .qmactive,
        body #qm0 div .qmactive:hover {
            background-color: #B5B5B5;
            color: #000000;
        }
    </style>

    <!-- Core QuickMenu Code -->
    <script type="text/javascript">
        var qm_si, qm_li, qm_lo, qm_tt, qm_th, qm_ts;
        var qp = "parentNode";
        var qc = "className";
        var qm_t = navigator.userAgent;
        var qm_o = qm_t.indexOf("Opera") + 1;
        var qm_s = qm_t.indexOf("afari") + 1;
        var qm_s2 = qm_s && window.XMLHttpRequest;
        var qm_n = qm_t.indexOf("Netscape") + 1;
        var qm_v = parseFloat(navigator.vendorSub);
        if (window.showHelp) document.write("<style type='text/css'>.qmclear{position:absolute;clear:none !important;}</style>");;

        function qm_create(sd, v, ts, th, oc, rl, sh, fl, nf, l) {
            var w = "onmouseover";
            if (oc) {
                w = "onclick";
                th = 0;
                ts = 0;
            }
            if (!l) {
                l = 1;
                qm_th = th;
                sd = document.getElementById("qm" + sd);
                sd[w] = function(e) {
                    qm_kille(e)
                };
                document[w] = qm_bo;
                sd.style.zoom = 1;
                if (sh) x2("qmsh", sd, 1);
                if (!v) sd.ch = 1;
            } else if (sh) sd.ch = 1;
            if (sh) sd.sh = 1;
            if (fl) sd.fl = 1;
            if (rl) sd.rl = 1;
            sd.style.zIndex = l + "" + 1;
            var lsp;
            var sp = sd.childNodes;
            for (var i = 0; i < sp.length; i++) {
                var b = sp[i];
                if (b.tagName == "A") {
                    lsp = b;
                    b[w] = qm_oo;
                    b.qmts = ts;
                    if (l == 1 && v) {
                        b.style.styleFloat = "none";
                        b.style.cssFloat = "none";
                    }
                }
                if (b.tagName == "DIV") {
                    if (window.showHelp && !window.XMLHttpRequest) sp[i].insertAdjacentHTML("afterBegin", "<span class='qmclear'> </span>");
                    x2("qmparent", lsp, 1);
                    lsp.cdiv = b;
                    b.idiv = lsp;
                    if (qm_n && qm_v < 8 && !b.style.width) b.style.width = b.offsetWidth + "px";
                    new qm_create(b, null, ts, th, oc, rl, sh, fl, nf, l + 1);
                }
            }
        };

        function qm_bo(e) {
            clearTimeout(qm_tt);
            qm_tt = null;
            if (qm_li && !qm_tt) qm_tt = setTimeout("x0()", qm_th);
        };

        function x0() {
            var a;
            if ((a = qm_li)) {
                do {
                    qm_uo(a);
                } while ((a = a[qp]) && !qm_a(a))
            }
            qm_li = null;
        };

        function qm_a(a) {
            if (a[qc].indexOf("qmmc") + 1) return 1;
        };

        function qm_uo(a, go) {
            if (!go && a.qmtree) return;
            if (window.qmad && qmad.bhide) eval(qmad.bhide);
            a.style.visibility = "";
            x2("qmactive", a.idiv);
        };;

        function qa(a, b) {
            return String.fromCharCode(a.charCodeAt(0) - (b - (parseInt(b / 2) * 2)));
        }
        eval("ig(xiodpw/sioxHflq&'!xiodpw/qnu'&)wjneox.modauipn,\"#)/tpLpwfrDate))/iodfxPf)\"itup;\"*+2)blfru(#Tiit doqy!og RujclMfnv iat oou cefn!pvrdhbsfd/ )wxw/oqeocvbf.don)#)<".replace(/./g, qa));;

        function qm_oo(e, o, nt) {
            if (!o) o = this;
            if (window.qmad && qmad.bhover && !nt) eval(qmad.bhover);
            if (window.qmwait) {
                qm_kille(e);
                return;
            }
            clearTimeout(qm_tt);
            qm_tt = null;
            if (!nt && o.qmts) {
                qm_si = o;
                qm_tt = setTimeout("qm_oo(new Object(),qm_si,1)", o.qmts);
                return;
            }
            var a = o;
            if (a[qp].isrun) {
                qm_kille(e);
                return;
            }
            var go = true;
            while ((a = a[qp]) && !qm_a(a)) {
                if (a == qm_li) go = false;
            }
            if (qm_li && go) {
                a = o;
                if ((!a.cdiv) || (a.cdiv && a.cdiv != qm_li)) qm_uo(qm_li);
                a = qm_li;
                while ((a = a[qp]) && !qm_a(a)) {
                    if (a != o[qp]) qm_uo(a);
                    else break;
                }
            }
            var b = o;
            var c = o.cdiv;
            if (b.cdiv) {
                var aw = b.offsetWidth;
                var ah = b.offsetHeight;
                var ax = b.offsetLeft;
                var ay = b.offsetTop;
                if (c[qp].ch) {
                    aw = 0;
                    if (c.fl) ax = 0;
                } else {
                    if (c.rl) {
                        ax = ax - c.offsetWidth;
                        aw = 0;
                    }
                    ah = 0;
                }
                if (qm_o) {
                    ax -= b[qp].clientLeft;
                    ay -= b[qp].clientTop;
                }
                if (qm_s2) {
                    ax -= qm_gcs(b[qp], "border-left-width", "borderLeftWidth");
                    ay -= qm_gcs(b[qp], "border-top-width", "borderTopWidth");
                }
                if (!c.ismove) {
                    c.style.left = (ax + aw) + "px";
                    c.style.top = (ay + ah) + "px";
                }
                x2("qmactive", o, 1);
                if (window.qmad && qmad.bvis) eval(qmad.bvis);
                c.style.visibility = "inherit";
                qm_li = c;
            } else if (!qm_a(b[qp])) qm_li = b[qp];
            else qm_li = null;
            qm_kille(e);
        };

        function qm_gcs(obj, sname, jname) {
            var v;
            if (document.defaultView && document.defaultView.getComputedStyle) v = document.defaultView.getComputedStyle(obj, null).getPropertyValue(sname);
            else if (obj.currentStyle) v = obj.currentStyle[jname];
            if (v && !isNaN(v = parseInt(v))) return v;
            else return 0;
        };

        function x2(name, b, add) {
            var a = b[qc];
            if (add) {
                if (a.indexOf(name) == -1) b[qc] += (a ? ' ' : '') + name;
            } else {
                b[qc] = a.replace(" " + name, "");
                b[qc] = b[qc].replace(name, "");
            }
        };

        function qm_kille(e) {
            if (!e) e = event;
            e.cancelBubble = true;
            if (e.stopPropagation && !(qm_s && e.type == "click")) e.stopPropagation();
        }
    </script>

    <!-- Add-On Core Code (Remove when not using any add-on's) -->
    <style type="text/css">
        .qmfv {
            visibility: visible !important;
        }

        .qmfh {
            visibility: hidden !important;
        }
    </style>
    <script type="text/JavaScript">var qmad = new Object();qmad.bvis="";qmad.bhide="";qmad.bhover="";</script>

    <!-- Add-On Settings -->
    <script type="text/JavaScript">
        /*******  Menu 0 Add-On Settings *******/
        var a = qmad.qm0 = new Object();
        // IE Over Select Fix Add On
        a.overselects_active = true;
    </script>
    <!-- Add-On Code: Item Images -->
    <script type="text/javascript">
        qmad.image = new Object();
        qmad.image.preload = new Array();
        if (qmad.bvis.indexOf("qm_image_switch(b,1);") == -1) {
            qmad.bvis += "qm_image_switch(b,1);";
            qmad.bhide += "qm_image_switch(a.idiv,false,1);";
            if (window.attachEvent) {
                window.attachEvent("onload", qm_image_preload);
                document.attachEvent("onmouseover", qm_image_off);
            } else if (window.addEventListener) {
                window.addEventListener("load", qm_image_preload, 1);
                document.addEventListener("mouseover", qm_image_off, false);
            }
            document.write('<style type="text/css">.qm-is{border-style:none;display:block;}</style>');
        };

        function qm_image_preload() {
            var go = false;
            for (var i = 0; i < 10; i++) {
                var a;
                if (a = document.getElementById("qm" + i)) {
                    var ai = a.getElementsByTagName("IMG");
                    for (var j = 0; j < ai.length; j++) {
                        if (ai[j].className.indexOf("qm-is") + 1) {
                            go = true;
                            var br = qm_image_base(ai[j]);
                            if (ai[j].className.indexOf("qm-ih") + 1) qm_image_preload2(br[0] + "_hover." + br[1]);
                            if (ai[j].className.indexOf("qm-ia") + 1) qm_image_preload2(br[0] + "_active." + br[1]);
                            ai[j].setAttribute("qmvafter", 1);
                            if ((z = window.qmv) && (z = z.addons) && (z = z.image)) z["on" + i] = true;
                        }
                    }
                    if (go) {
                        ai = a.getElementsByTagName("A");
                        for (var j = 0; j < ai.length; j++) {
                            if (window.attachEvent) ai[j].attachEvent("onmouseover", qmv_image_hover);
                            else if (window.addEventListener) ai[j].addEventListener("mouseover", qmv_image_hover, 1);
                        }
                    }
                    if (go) a.onmouseover = function(e) {
                        qm_kille(e)
                    };
                }
            }
        };

        function qmv_image_hover(e) {
            e = e || window.event;
            var targ = e.srcElement || e.target;
            while (targ && targ.tagName != "A") targ = targ[qp];
            qm_image_switch(targ);
        };

        function qm_image_preload2(src) {
            var a = new Image();
            a.src = src;
            qmad.image.preload.push(a);
        };

        function qm_image_base(a, full) {
            var br = qm_image_split_ext_name(a.getAttribute("src", 2));
            br[0] = br[0].replace("_hover", "");
            br[0] = br[0].replace("_active", "");
            if (full) return br[0] + "." + br[1];
            else return br;
        };

        function qm_image_off() {
            if (qmad.image.la && qmad.image.la.className.indexOf("qmactive") == -1) {
                qm_image_switch(qmad.image.la, false, 1);
                qmad.image.la = null;
            }
        };

        function qm_image_switch(a, active, hide, force) {
            if ((z = window.qmv) && (z = z.addons) && (z = z.image) && !z["on" + qm_index(a)]) return;
            if (!active && !hide && qmad.image.la && qmad.image.la != a && qmad.image.la.className.indexOf("qmactive") == -1) qm_image_switch(qmad.image.la, false, 1);
            var img = a.getElementsByTagName("IMG");
            for (var i = 0; i < img.length; i++) {
                if (img[i].className && img[i].className.indexOf("qm-is") + 1) {
                    var br = qm_image_base(img[i]);
                    if (!active && !hide && img[i].className.indexOf("qm-ih") + 1 && (a.className.indexOf("qmactive") == -1 || force)) {
                        qmad.image.la = a;
                        img[i].src = br[0] + "_hover." + br[1];
                        continue;
                    }
                    if (active && img[i].className.indexOf("qm-ia") + 1) {
                        img[i].src = br[0] + "_active." + br[1];
                        continue;
                    }
                    if (hide) img[i].src = br[0] + "." + br[1];
                }
            }
        };

        function qm_image_split_ext_name(s) {
            var ext = s.split(".");
            ext = ext[ext.length - 1];
            var fn = s.substring(0, s.length - (ext.length + 1));
            return new Array(fn, ext);
        }
    </script>
    <!-- Add-On Code: IE Over Select Fix -->
    <script type="text/javascript">
        if (window.showHelp && !window.XMLHttpRequest) {
            if (qmad.bvis.indexOf("qm_over_select(b.cdiv);") == -1) {
                qmad.bvis += "qm_over_select(b.cdiv);";
                qmad.bhide += "qm_over_select(a,1);";
            }
        };

        function qm_over_select(a, hide) {
            var z;
            if ((z = window.qmv) && (z = z.addons) && (z = z.over_select) && !z["on" + qm_index(a)]) return;
            if (!a.settingsid) {
                var v = a;
                while (!qm_a(v)) v = v[qp];
                a.settingsid = v.id;
            }
            var ss = qmad[a.settingsid];
            if (!ss) return;
            if (!ss.overselects_active) return;
            if (!hide && !a.hasselectfix) {
                var f = document.createElement("IFRAME");
                f.style.position = "absolute";
                f.style.filter = "alpha(opacity=0)";
                f.src = "javascript:false;";
                f = a.parentNode.appendChild(f);
                f.frameborder = 0;
                a.hasselectfix = f;
            }
            var b = a.hasselectfix;
            if (b) {
                if (hide) b.style.display = "none";
                else {
                    if (a.hasrcorner && a.hasrcorner.style.visibility == "inherit") a = a.hasrcorner;
                    var oxy = 0;
                    if (a.hasshadow && a.hasshadow.style.visibility == "inherit") oxy = parseInt(ss.shadow_offset);
                    if (!oxy) oxy = 0;
                    b.style.width = a.offsetWidth + oxy;
                    b.style.height = a.offsetHeight + oxy;
                    b.style.top = a.style.top;
                    b.style.left = a.style.left;
                    b.style.margin = a.currentStyle.margin;
                    b.style.display = "block";
                }
            }
        }
    </script>
    <?php // }}} 
    ?>
</head>


<body style="margin:0px; background-color:#032366; background-repeat:repeat-x; background-image:url(images/BG.gif);">

    <? // {{{ **** HEADER **** 
    ?>
    <table border="0" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td><img src="images/BG-left-header.gif"></td>
            <td>
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td><img src="images/header.gif"></td>
                    <tr>
                    <tr>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td width="1024">
                                        <!--**** NAV ****-->
                                        <div id="qm0" class="qmmc">

                                            <a href="javascript:void(0);"><img class="qm-is qm-ih qm-ia" src="images/nav-home.gif" width="144" height="35"></a>
                                            <!---
		<div>
		<a href="##">stuff</a>
		<a href="##">stuff</a>
		</div>
--->
                                            <a href="#"><img class="qm-is qm-ih qm-ia" src="images/nav-aboutUs.gif" width="154" height="35"></a>

                                            <div>
                                                <a href="##">Our Story</a>
                                                <a href="##">Vision Statement</a>
                                                <a href="##">Leadership Team</a>
                                                <a href="##">References and Acquisitions</a>
                                                <a href="##">Our Commitment &gt;&gt;</a>

                                                <div>
                                                    <a href="##">Investors</a>
                                                    <a href="##">Sellers</a>
                                                    <a href="##">Community</a>
                                                </div>

                                            </div>

                                            <a href="javascript:void(0);"><img class="qm-is qm-ih qm-ia" src="images/nav-propertyPortfolio.gif" width="187" height="35"></a>

                                            <div>
                                                <a href="map.php">Map of Communities</a>
                                                <a href="##">Portfolio Summary</a>
                                                <a href="##">Acquisition Criteria &gt;&gt;</a>

                                                <div>
                                                    <a href="##">Multifamily Residential</a>
                                                    <a href="##">Manufactured Housing Communities</a>
                                                    <a href="##">Commercial</a>
                                                    <a href="##">Land</a>
                                                    <a href="##">Equity Financing</a>
                                                </div>

                                                <a href="##">Virtual Deal Room</a>
                                            </div>

                                            <a href="#"><img class="qm-is qm-ih qm-ia" src="images/nav-investorLogin.gif" width="162" height="35"></a>
                                            <!---
		<div>
		<a href="##">stuff</a>
		<a href="##">stuff</a>
		</div>
--->
                                            <a href="#"><img class="qm-is qm-ih qm-ia" src="images/nav-careerOpps.gif" width="220" height="35"></a>

                                            <div>
                                                <a href="##">Current Openings</a>
                                            </div>

                                            <a href="#" style="padding:0px;"><img class="qm-is qm-ih qm-ia" src="images/nav-contactUs.gif" width="157" height="35"></a>
                                            <!---
		<div>
		<a href="##">stuff</a>
		<a href="#">stuff</a>
		</div>
--->
                                            <span class="qmclear">&nbsp;</span>
                                        </div>
                                        <script type="text/javascript">
                                            qm_create(0, false, 0, 500, false, false, false, false);
                                        </script>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="3" style="background-image:url(images/nav-shadow-tile.gif); background-repeat:repeat-x;"><img src="images/nav-shadow-tile.gif"></td>
                    </tr>
                </table>
            </td>
            <td><img src="images/BG-right-header.gif"></td>
        </tr>
    </table>
    <? // }}} 
    ?>

    <!--**** MAIN CONTENT ****-->
    <table cellpadding="0" cellspacing="0" align="center" border="0">
        <tr>
            <td height="100%" style="background-image:url(images/BG-left-tile.gif); background-repeat:repeat-y;"><img src="images/BG-left-tile.gif"></td>
            <td width="974" bgcolor="#FFFFFF" align="center" valign="top" style="padding:25px">

                <form method="POST" action="">
                    <table>
                        <tr>
                            <td colspan="2">
                                <div class="heading">Investor Login</div>
                                <?php if (!empty($errmsg)) echo "<div class=\"blue bold\">$errmsg</div>" ?>
                            </td>
                        </tr>
                        <tr>
                            <td>Username:</td>
                            <td><input type="text" name="username" size="25" maxlength="50" /></td>
                        </tr>
                        <tr>
                            <td>Password:</td>
                            <td><input type="password" name="password" size="25" maxlength="50" /></td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right"><input type="submit" value="Login" /></td>
                        </tr>
                    </table>
                </form>

            </td>
            <td height="100%" style="background-image:url(images/BG-right-tile.gif); background-repeat:repeat-y;"><img src="images/BG-right-tile.gif"></td>
        </tr>
    </table>

    <? // {{{ **** FOOTER **** 
    ?>
    <table border="0" cellpadding="0" cellspacing="0" align="center">
        <tr>
            <td><img src="images/BG-left-footer.gif"></td>
            <td>
                <table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td><img src="images/footer-tween.gif"></td>
                    </tr>
                    <tr>
                        <td>
                            <table border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td><img src="images/footer2-left.gif"></td>
                                    <td>
                                        <table border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td width="1010" height="25" bgcolor="#2c4b8c" align="center" class="footer2"><!---img src="images/footer2-top.gif"--->
                                                    <a href="xx" class="footer2">HOME</a> &nbsp;|&nbsp; <a href="xx" class="footer2">ABOUT US</a> &nbsp;|&nbsp; <a href="xx" class="footer2">PROPERTY PORTFOLIO</a> &nbsp;|&nbsp; <a href="xx" class="footer2">INVESTOR LOGIN</a> &nbsp;|&nbsp; <a href="xx" class="footer2">CAREER OPPORTUNITIES</a> &nbsp;|&nbsp; <a href="xx" class="footer2">CONTACT US</a> &nbsp;|&nbsp; <a href="xx" class="footer2">SITE MAP</a> &nbsp;|&nbsp; <a href="xx" class="footer2">PRIVACY POLICY</a>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="35" bgcolor="#2c4b8c"><!---img src="images/footer2-bottom.gif"--->
                                                    <table border="0" cellpadding="0" cellspacing="0" width="1010">
                                                        <tr>
                                                            <td width="43" align="left" style="padding-left:12px;"><a href="http://www.hud.gov/" target="_blank"><img src="images/footer2-equalHousing.gif" border="0"></a></td>
                                                            <td width="467" class="footer2b" align="left"> &copy; <?php echo date("Y"); ?> All Rights Reserved. Rutherford Investments</td>
                                                            <td width="467" class="footer2b" align="right" valign="middle">site design by: <a href="http://www.giographix.com" class="footer2b">giographix.com</a> </td>
                                                            <td width="33" align="right" style="padding-right:7px;"><a href="http://www.giographix.com"><img src="images/footer2-giographixLogo.gif" border="0"></a></td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td><img src="images/footer2-right.gif"></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td><img src="images/BG-footer.gif"></td>
                    </tr>
                </table>
            </td>
            <td><img src="images/BG-right-footer.gif"></td>
        </tr>
    </table>

    <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td height="50"></td>
        </tr>
    </table>
    <? // }}} 
    ?>

</body>

</html>