// Copyright 2005 by St. Louis Community College
//      webmaster@stlcc.edu
//
//  This is free software.
//
//  Version: 2006062300
//
//  Mods:
//      2006062300 by Brian
//          Tweaked parlez*() functions.
//
//      2006050200 by Brian
//          Tweaked JS mod dates.
//
//      2006042700 by Brian
//          Added months and JavaScript-based modification date.
//
//      2005121600 by Brian
//          Added support for d_default
//
//      2005111700 by Brian
//          First published.
//

var months = new Array('January', 'February', 'March', 'April', 'May',
    'June', 'July', 'August', 'September', 'November', 'December');

var oDate = new Date(document.lastModified);

var jsFileLastModifiedYear = oDate.getFullYear();
var jsFileLastModifiedMonth = months[oDate.getMonth()];
var jsFileLastModifiedDay = oDate.getDate();

var jsFileLastModified = jsFileLastModifiedMonth +
    " " + jsFileLastModifiedDay +
    ", " + jsFileLastModifiedYear;

function say(car, cdr, text) {
    if (cdr == null) { cdr = new Array('edu', 'stlcc') }
    var a = new Array('o', 't', 'l', 'i', 'a', 'm');
    a.reverse(); car.reverse(); cdr.reverse();
    var j = car.join('') + '&' + '#6' + '4;' + cdr.join('.');
    if ((text == null) || (text == '')) { text = j }
    document.write('<a href="' + a.join('') + ':' + j + '">' + text + '</a>');
    return true;
}

var bgRoll_last_id    = "";
var bgRoll_color      = "#fff799";

function parlezWho (car, cdr) {
    if (cdr == null) { cdr = new Array('edu', 'stlcc') }
    var a = new Array('t', 'n', 'e', 'i', 'p', 'i', 'c', 'e', 'r');
    a.reverse(); car.reverse(); cdr.reverse();
    var j = car.join('') + '&' + '#6' + '4;' + cdr.join('.');
    document.write('<INPUT TYPE="HIDDEN" NAME="' + a.join('') + '" VALUE="' + j + '" />');
    return true;
}

function parlezOpen () {
    document.write('<FORM METHOD="GET" ACTION="http://www.stlcc.edu/cgi-bin/formmail.asp">'); return true;
}

function parlezClose () {
    document.write('</FORM>'); return true;
}

function bgRoll(id, in_or_out, color) {
    if (!color) { color = bgRoll_color }    //  default onMouseIn() color
    if (!id)    { id    = bgRoll_last_id }  //  use the last ID we rolled
    bgRoll_last_id = id;    //  save the last id we rolled to simplify onMouseOut()
    bgRoll_color   = color; //  save the color for onMouseIn()
    if (document.getElementById) {
        var p = document.getElementById(id);
        if (p) {
            if (in_or_out == 1) {
                if (p.bgColor != null) {
                    p.bgColor_last = p.bgColor; //  save old color
                    p.bgColor      = color;     //  roll in highlight color
                }
                else if (p.style.backgroundColor != null) {
                    p.bgColor_last          = p.style.backgroundColor; //  save old color
                    p.style.backgroundColor = color;     //  roll in highlight color
                }
            }
            else {
                if (p.bgColor != null) {
                    p.bgColor = p.bgColor_last; //  put the old color back
                }
                else if (p.style.backgroundColor != null) {
                    p.style.backgroundColor = p.bgColor_last;
                }
            }
        }
    }
    return false;
}

