//*************************************************************************************************
if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown = click;

function click(e) {
    var now = new Date();
    var year = now.getYear();
    var message = "(c) Copyright 1997 - " + year + " J.B. Wood Products.";

    if (document.all) {
        if (event.button == 2) {
            alert(message);
            return false;
        }
    }
    if (document.layers) {
        if (e.which == 3) {
            alert(message);
            return false;
        }
    }

    if (new String(window.location.href).indexOf("jbwood.com") > 0) {
        if (document.all) {
            if (event.button == 0 || event.button == 1) {
                window.location = "https://secure13.hostek.net/jbwood-com/st_categories.aspx"
            }
        }
        if (document.layers) {
            if (e.which == 0 || e.which == 1) {
                window.location = "https://secure13.hostek.net/jbwood-com/st_categories.aspx"
            }
        }
    }
}

function RedirectPage(page) {
    if (page == "fb_main.aspx") {
        location = "https://secure13.hostek.net/jbwood-com/fb_main.aspx";
    }
    else {
        var lastIndexOf = location.toString().lastIndexOf("/") + 1;
        location = location.toString().substring(0, lastIndexOf) + page;
    }
}

//*************************************************************************************************
function WindowStatusBar() {
    StatScroll();
}

//*************************************************************************************************
function StatScroll() {
    var statBarMsg = "                                                              " +
    "Sign up for our periodic specials throughout the year. " +
    "Go to our feedback page and tell us you want to join our email list. " +
    "                         ";

    window.status = statBarMsg;
    statBarMsg = statBarMsg.substring(1, statBarMsg.length) + statBarMsg.substring(0, 1)
    setTimeout("StatScroll()", 100)
}

//*************************************************************************************************
// This functions pops up a new window to allow the user to email a friend
function TellAFriend() {
    var winl = (screen.width - 550) / 6;
    var wint = (screen.height - 625) / 6;
    window.open("https://secure13.hostek.net/jbwood-com/taf_main.aspx", null, "width=550,height=625,top=" + wint + ",left=" + winl + ",toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes");
}

