var JS_CMS_101 = "C:\\dh\\web\\SJC\\nyc\\new\\cms_101.js 2009-07-18 07:24 John Hetland";
/***********************************************************************
*                                                                      *
*                         C M S _ 1 0 1 . J S                          *
*                         -------------------                          *
*                                                                      *
*      This file is a component of Content Management System 101.      *
*                 Run 'help.pl' for more information.                  *
*                                                                      *
*                    (c) 2004 - 2008 Dean Hannotte                     *
***********************************************************************/
x_log("\nJS_CMS_101 = '" + JS_CMS_101 + "'.");
// x_log_all();
// alert(JS_CMS_101);
var TOC_NUM     = 0;
var WINDOW_NUM  = 0;
var NOW         = new Date();
var YYYY        = NOW.getFullYear();
var cms_event;
var cms_table_depth = 0;
var cms_table_borders =
[
    '#000000', '#ff0000', '#00ff00', '#0000ff', '#800000'
];

/*--------------------------------------------------------------------*/
/*             Override default values declared in plx.js             */
/*--------------------------------------------------------------------*/
x_hover_style(new String("color: " + CMS_COLOR_FG
    + "; background-color: " + CMS_COLOR_BG_1
    + "; border: #888 2px solid;"));
// Use 6-character color codes for snapshot borders because
// the 3-character codes that work in CSS do NOT work in HTML!
x_snapshot_border_over("white");
x_snapshot_border_out(CMS_COLOR_BG_0);
x_snapshot_img_dir('/nyc/images');
// x_snapshot_icon("<img src='/nyc/images/popup.gif'>");
// x_link_icon("<img border=0 src='/nyc/images/visit_site.gif'>");


/*--------------------------------------------------------------------*/
/*                        cms_addr() function                         */
/*--------------------------------------------------------------------*/
function cms_addr(a_contact)
{
    cms_email('', CMS_CONTACTS[a_contact].mailbox);
}

/*--------------------------------------------------------------------*/
/*                       cms_button() function                        */
/*--------------------------------------------------------------------*/
function cms_button(a_name, a_link)
{
    var result = "<button onClick='location=\""
        + a_link + "\";'>" + a_name + "</button>";
// alert(result);
    document.write(result);
}

/*--------------------------------------------------------------------*/
/*                       cms_byline() function                        */
/*--------------------------------------------------------------------*/
function cms_byline(a_name, a_mailbox, a_domain, a_webpage)
{
    var anchor  = new Array();
    var name    = a_name;
    var mailbox = a_mailbox;
    var domain  = a_domain;
    var webpage = a_webpage;
    anchor[0] = anchor[1] = '';
    if (typeof a_webpage != 'undefined' && a_webpage != '')
    {
        anchor[0] = "<a href='http://" + webpage + "'>";
        anchor[1] = '</a>';
    }
    else if (typeof a_mailbox != 'undefined' && a_mailbox != '')
    {
        var domain = new String(a_domain);
        if (typeof a_domain == 'undefined' || a_domain == '')
        {
            if (typeof CMS_CONTACTS[mailbox] == 'object')
            {
                mailbox = CMS_CONTACTS[mailbox].mailbox;
                domain = CMS_DOMAIN;
            }
//             else
//             {
//                 alert("There is no official mailbox assigned to '" + mailbox + "'.");
//             }
        }
        anchor[0] = "<a href='mailto:" + mailbox + '@' + domain + "'>";
        anchor[1] = '</a>';
    }
    result = "<p align=right>&mdash; " + anchor[0]
        + "<b><i>" + name + "</i></b>" + anchor[1] + "</p>";
//  alert(result);
    document.write(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                    cms_contact_rows() function                     */
/*--------------------------------------------------------------------*/
function cms_contact_rows()
{
x_log("\ncms_contact_rows();");
    var cx;
    var result = new String();
    for (cx = 0; cx < CMS_CONTACT_ORDER.length; cx++)
    {
        var contact  = CMS_CONTACT_ORDER[cx];
        var mailbox  = CMS_CONTACTS[contact].mailbox;
        var title    = CMS_CONTACTS[contact].title;
        var fullname = CMS_CONTACTS[contact].fullname;

//         var message = "body=%0A%0A%0A%0A"
//             + "page: '" + page + "'"
//             + ", event: '" + event + "'"
//             + ", crest: '" + crest + "'"
//             + ", plx_javascript_version: '" + plx_javascript_version + "'"
//             + ", navigator.userAgent: '" + navigator.userAgent + "'";

// When using the <a> tag to send an email the length
// of the href= parameter is limited to 255 bytes.

        var message = new String
        (
              "%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A"
            + "%0A------------------------------------------------------------------"
            + "%0Apage: '"                   + page + "'"
            + "%0Aevent: '"                  + event + "'"
            + "%0Acrest: '"                  + crest + "'"
            + "%0Aplx_javascript_version: '" + plx_javascript_version + "'"
            + "%0Anavigator.userAgent: '"    + navigator.userAgent + "'"
//             + "%0A%0A" + plx_log
        );

//         message = encodeURIComponent(message);

        message = message.replace(/'/g, '"');
        message = message.replace(/=/g, '&eq;');
        message = message.replace(/</g, '&lt;');
        message = message.replace(/>/g, '&gt;');
        message = message.replace(/mailto:/g, 'mailto-');

        message = "body=" + message;

// alert(message);

        result += "\n<tr><td align='right'>" + title
            + ": &nbsp; </td><td>" + fullname + " ("
            + x_email("", mailbox, "", message)
            + ")</td></tr>";
    }
// alert(plx_log);
    document.write(result);
}

/*--------------------------------------------------------------------*/
/*                        cms_crest() function                        */
/*--------------------------------------------------------------------*/
// function cms_crest(a_src)
// {
// x_log("\ncms_crest(" + a_src + ");");
//     x_parse_imgsrc(a_src);
//     document.write("\n<div style='position: absolute; top: 30; left: 30;'>"
//         + "<img width=196 height=196 alt='" + plx_parse_imgsrc_caption
//         + "' src='/nyc/images/crests/" + a_src + "'>"
//         + "</div>");
// }

/*--------------------------------------------------------------------*/
/*                        cms_debug() function                        */
/*--------------------------------------------------------------------*/
function cms_debug(a_message)
{
    if  (CMS_DEBUG == '1')
    {
        alert(a_message);
        x_log("\n" + a_message);
    }
}

/*--------------------------------------------------------------------*/
/*                    cms_descrip_rows() function                     */
/*--------------------------------------------------------------------*/
function cms_descrip_rows()
{
x_log("\ncms_descrip_rows();");
    var px;
    var result = new String();
    for (px = 0; px < CMS_PUBLIC_PAGE_ORDER.length; px++)
    {
        var page        = CMS_PUBLIC_PAGE_ORDER[px];
        var short_title = CMS_PAGES[page].short_title;
        var descrip     = CMS_PAGES[page].descrip;

        result += "\n<tr valign='top'><td align='right'>"
            + "<a href='index.pl?page=" + page + "'><b>" + short_title
            + "</b></a></td><td>" + descrip + "</td></tr>";
    }
// alert(result);
    document.write(result);
}

/*--------------------------------------------------------------------*/
/*                      cms_diagnose() function                       */
/*--------------------------------------------------------------------*/
function cms_diagnose(a_context, a_event)
{
//     var tname = new String('');
//     if (typeof a_context != 'undefined')
//     {
//         var i_context = a_context;
//         var targ = new String('');
// alert("cms_event = '" + cms_event + "'.");
//         if (!cms_event)
//         {
//             cms_event = window.event;
// alert("cms_event = '" + cms_event + "'.");
//         }
// alert("cms_event.target = '" + cms_event.target + "'.");
// alert("cms_event.srcElement = '" + cms_event.srcElement + "'.");
//         if (cms_event.target)
//         {
//             targ = cms_event.target;
// alert("targ = '" + targ + "'.");
//         }
//         else if (cms_event.srcElement)
//         {
//             targ = cms_event.srcElement;
// alert("targ = '" + targ + "'.");
//         }
//         tname = targ.tagName;
// alert("tname = '" + tname + "'.");
//     }
    var result = new String();
    var i_context;
    if (typeof a_context == 'undefined') i_context = '';
    else i_context = a_context;
    if (typeof a_event == 'undefined') cms_event = '';
    else cms_event = a_event;
    result = "<pre>"
+ "\nplx_javascript_version                   : '" + plx_javascript_version + "'"
+ "\nwindow.screen.[width, height]            : " + window.screen.width + "x" + window.screen.height
+ "\nwindow.screen.[availWidth, availHeight]  : " + window.screen.availWidth + "x" + window.screen.availHeight
+ "\ndocument.body.[clientWidth, clientHeight]: " + x_window_width() + "x" + x_window_height()
+ "\n</pre>";

// + " OR CLICK HERE: <a href='"
// + "http://www." + CMS_DOMAIN + CMS_DIRECTORY + "/" + page + "'><b>"
// + "http://www." + CMS_DOMAIN + CMS_DIRECTORY + "/" + page + "</b></a>"

//     if (i_context == 'MouseDown')
//     {
//         result = x_obj('cms_event');
//     }

//     if (typeof $(cms_site_new_col) != 'undefined')
//     {
//         result += ', ' + $(cms_site_new_col).width;
//     }
//             + ', ' + window.event.srcElement.tagName;
// x_log_obj('window.event.srcElement.tagName');
// x_log_obj('window.event.srcElement');
// x_log_obj('window.event');

// x_log("\ntypeof cms_site_new_col = '" + typeof cms_site_new_col + "'.");
// x_log_obj('cms_site_new_col');

// x_log("\ntypeof $(cms_site_new_col) = '" + typeof $(cms_site_new_col) + "'.");
// x_log_obj('$(cms_site_new_col)');
x_log("\ncms_diagnose('" + i_context + "', '" + cms_event + "') ==>\n  '" + result + "'");
    $('cms_diagnostics').innerHTML = result;
}

/*--------------------------------------------------------------------*/
/*                        cms_email() function                        */
/*--------------------------------------------------------------------*/
function cms_email(a_name, a_mailbox, a_domain, a_parms)
{
    var name    = a_name;
    var mailbox = a_mailbox;
    var domain  = a_domain;
    var parms   = a_parms;
    if (typeof a_domain == 'undefined' || a_domain == '')
    {
        if (typeof CMS_CONTACTS[mailbox] == 'object')
        {
            mailbox = CMS_CONTACTS[mailbox].mailbox;
            domain = CMS_DOMAIN;
        }
//         else
//         {
//             alert("There is no official mailbox assigned to '" + mailbox + "'.");
//         }
    }
    document.write(x_email(name, mailbox, domain, parms));
}

/*--------------------------------------------------------------------*/
/*                        cms_goto() function                         */
/*--------------------------------------------------------------------*/
function cms_goto(a_selector)
{
    var TF = document.this_form;
    var LV = a_selector.options[a_selector.selectedIndex].value
    cms_debug("cms_goto('" + LV + "');");
    TF.location.value = LV;
    cms_debug("Setting document.this_form.location.value to '"
        + TF.location.value + "'.");
    window.location = '#' + TF.location.value;
    cms_debug("Setting window.location to '" + window.location + "'.");
}

/*--------------------------------------------------------------------*/
/*                   cms_menu_highlight() function                    */
/*--------------------------------------------------------------------*/
function cms_menu_highlight(a_item)
{
    var px;
    for (px = 0; px < CMS_PUBLIC_PAGE_ORDER.length; px++)
    {
        var page = CMS_PUBLIC_PAGE_ORDER[px];
        td = document.getElementById('td_menu_item_' + page);
        a  = document.getElementById('a_menu_item_'  + page);
        if (page == a_item)
        {
            td.className = 'td_menu_on';
            a.className  = 'a_menu_on';
        }
        else
        {
            td.className = 'td_menu_off';
            a.className  = 'a_menu_off';
        }
    }
}

/*--------------------------------------------------------------------*/
/*                        cms_more() function                         */
/*--------------------------------------------------------------------*/
function cms_more(a_page, a_flag)
{
    var rsvp_text = '';
    if (a_flag == '-rsvp') rsvp_text = ' and RSVP';
    document.write("\n<p>");
    if (page == 'past_events')
    {
        cms_link('Read the full event description ...', a_page);
    }
    else
    {
        cms_link('Read more' + rsvp_text + ' ...', a_page);
    }
}

/*--------------------------------------------------------------------*/
/*                        cms_name() function                         */
/*--------------------------------------------------------------------*/
function cms_name(a_contact)
{
// alert("cms_name('" + a_contact + "') returning '"
// + CMS_CONTACTS[a_contact]['fullname'] + "'.");
    document.write("<b>" + CMS_CONTACTS[a_contact]['fullname'] + "</b>");
}

/*--------------------------------------------------------------------*/
/*                    cms_name_at_addr() function                     */
/*--------------------------------------------------------------------*/
function cms_name_at_addr(a_contact)
{
    cms_name(a_contact);
    document.write(" at ");
    cms_addr(a_contact);
}

/*--------------------------------------------------------------------*/
/*                         cms_new() function                         */
/*--------------------------------------------------------------------*/
function cms_new()
{
    document.write("<img hspace=8 src='/nyc/images/new_28x11.gif'>");
}

/*--------------------------------------------------------------------*/
/*                    cms_not_sponsored() function                    */
/*--------------------------------------------------------------------*/
function cms_not_sponsored()
{
    document.write("Not a chapter-sponsored "
        + "event, but worth your consideration: ");
}

/*--------------------------------------------------------------------*/
/*                       cms_paypal() function                        */
/*--------------------------------------------------------------------*/
function cms_paypal()
{
x_log("\ncms_paypal();");
    var result = new String
    (
          "<form action='https://www.paypal.com/cgi-bin/webscr' method='post' target='_blank'>"
        + "\n<input type='hidden' name='cmd' value='_s-xclick'>"
        + "\n<input type='hidden' name='hosted_button_id' value='6698535'>"
        + "\n<input type='hidden' name='no_shipping' value='1'>"
        + "\n<input type='hidden' name='return' value='http://www."
        + CMS_DOMAIN + CMS_DIRECTORY + "'>"
        + "\n<input type='image' border='0' name='submit'"
        + "\nsrc='https://www.paypal.com/images/x-click-but04.gif'"
        + "\nalt=\"Secure donation online by credit card or PayPal\""
        + "\nstyle='vertical-align:middle'>"
        + "\n</form>"
    );
    document.write(result);
    return result;
}

/* OLD FUNCTION:
function cms_paypal()
{
x_log("\ncms_paypal();");
    var result = new String
    (
          "<form action='https://www.paypal.com/cgi-bin/webscr' method='post'>"
        + "\n<input type='hidden' name='cmd' value='_xclick'>"
        + "\n<input type='hidden' name='business' value='president@" + CMS_DOMAIN + "'>"
        + "\n<input type='hidden' name='item_name' value='SJC NY Chapter Dues'>"
        + "\n<input type='hidden' name='no_shipping' value='1'>"
        + "\n<input type='hidden' name='return' value='http://www."
        + CMS_DOMAIN + CMS_DIRECTORY + "'>"
        + "\n<input type='image' border='0' name='submit'"
        + "\nsrc='https://www.paypal.com/images/x-click-but04.gif'"
        + "\nalt=\"Make payments with PayPal -- it's fast, free and secure!\""
        + "\nstyle='vertical-align:middle'>"
        + "\n</form>"
    );
    document.write(result);
    return result;
} */




/*--------------------------------------------------------------------*/
/*                    cms_popup_window() function                     */
/*--------------------------------------------------------------------*/
function cms_popup_window(a_url, a_name, a_width_percent, a_height_percent, a_features)
{
//  alert("cms_popup_window('" + a_url + "', '" + a_name + "');");
    var number = ''; if (number == '') number = 0; number++;

    var url  = '';
    var name = 'window_' + number;
    var wpc  = 95;
    var hpc  = 70;

    if (typeof a_url            != 'undefined') url  = a_url;
    if (typeof a_name           != 'undefined') name = a_name;
    if (typeof a_width_percent  != 'undefined') wpc  = a_width_percent;
    if (typeof a_height_percent != 'undefined') hpc  = a_height_percent;

    var width  = Math.floor(screen.availWidth  * wpc / 100);
    var height = Math.floor(screen.availHeight * hpc / 100);
    var left   = Math.floor((screen.availWidth  - width ) / 2);
    var top    = Math.floor((screen.availHeight - height) / 2);

    var features = new String
    (
          "scrollbars=yes, menubar=no,"
        + "resizable=yes, toolbar=no, "
        + "left=" + left + ", top=" + top + ", "
        + "width=" + width + ", height=" + height
    );
    if (typeof a_features != 'undefined') features = a_features;

    return window.open(url, name, features);
}

/*--------------------------------------------------------------------*/
/*                     cms_pull_quote() function                      */
/*--------------------------------------------------------------------*/
function cms_pull_quote(a_align, a_quote)
{
    var result = new String
    (
          "<td bgcolor='white' align='" + a_align + "' width=175>"
        + "<img src='/nyc/images/quote_open 175x29.gif'>"
        + "<p style='margin-left: 8px; margin-right: 8px'>" + a_quote + "</p>"
        + "<img src='/nyc/images/quote_close 175x28.gif'></td>"
    );
    if (a_align == 'right') result =  "<td></td>" + result;
    else                    result += "<td></td>";
    result = "<table border=00 align='" + a_align + "'><tr>"
        + result + "</tr></table>";
//  alert(result);
    document.write(result);
}

/*--------------------------------------------------------------------*/
/*                        cms_rsvp() function                         */
/*--------------------------------------------------------------------*/
function cms_rsvp(a_page)
{
    cms_more(a_page, '-rsvp');
}

/*--------------------------------------------------------------------*/
/*                    cms_search_box() function                       */
/*--------------------------------------------------------------------*/
function cms_search_box(a_location)
{
x_log("\ncms_search_box();");
    var result = new String('');
//     var result = new String
//     (
//           "\n\n<!-- Search Google -->"
//         + "\n<center>"
//         + "\n<form method=get target=_blank "
//         + "action=http://www.google.com/u/sjcalums>"
//         + "\n<table cellspacing=0 border=0><tr valign=middle><td>"
//         + "\n<!-- <A target=_blank href=http://www.google.com/>"
//         + "\n<img src='http://www.google.com/logos/Logo_40wht.gif' border=0"
//         + "\nalt=Google></A>"
//         + "\n</td>"
//         + "\n<td> -->"
//         + "\n<input type=text name=q size=31 maxlength=255 value=''>"
//         + "\n<input type=submit name=sa value='Search'>"
//         + "\n"
//         + "\n</td></tr></table>"
//         + "\n</form>"
//         + "\n</center>"
//         + "\n<!-- Search Google -->\n"
//     );
//     document.write(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                       cms_see_map() function                       */
/*--------------------------------------------------------------------*/
function cms_see_map(a_location)
{
x_log("\ncms_see_map();");
    var href = "javascript:x_popup(\"http://maps.google.com/maps?q="
        + a_location + "&iwloc=A&hl=en\", \"cms_map_window\");";
    var result = "<a  href='" + href + "'><b>See&nbsp;map</b>&nbsp;"
        + "<img border=0 src='/nyc/images/popup_11x14.gif'></a>";
//  document.write(result);
// alert(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                   cms_solicit_comment() function                   */
/*--------------------------------------------------------------------*/
function cms_solicit_comment()
{
x_log("\ncms_solicit_comment();");
    document.write
    (
          "<script>cms_whitebox('-width:80%');</script>"
        + "\n<table><tr align='center'><td>"
        + "\n<img src='/nyc/images/post_30x40.jpg'>"
        + "\n</td><td width=1></td><td>"
        + "\n</td><td bgcolor='lightgrey'></td><td>"
        + "\n</td><td width=1></td><td>"
        + "\n<big><b>Would you like to comment on this page?</b></big>"
        + "\n<p style='line-height: 150%;'>"
        + "Send&nbsp;your&nbsp;thoughts&nbsp;to&nbsp;"
    );
//     cms_name('webmaster');
//     document.write("&nbsp;at ");
//     cms_addr('webmaster');
    cms_webmaster();
    document.write
    (
          "&nbsp;and&nbsp;we'll&nbsp;post&nbsp;them&nbsp;here."
        + "</td></tr></table>"
        + "\n<script>cms_whitebox_end();</script>"
    );
}

/*--------------------------------------------------------------------*/
/*                        cms_splay() function                        */
/*--------------------------------------------------------------------*/
function cms_splay(a_input, a_parms)
{
    var input  = new String(a_input);
    var html   = false;
    if (typeof a_parms != 'undefined')
    {
        html = a_parms.indexOf('-html') > -1;
    }
    var result = new String('');
    for (ix = 0; ix < input.length; ix++)
    {
        result += ' ' + input.substr(ix, 1);
    }
    result = result.substr(1);
    if (html) result = result.replace(/ /g, "&nbsp;");
    return result;
}

/*--------------------------------------------------------------------*/
/*                     cms_stay_tuned() function                      */
/*--------------------------------------------------------------------*/
function cms_stay_tuned(a_parms)
{
    document.write("Stay tuned for further details.");
}

/*--------------------------------------------------------------------*/
/*                    cms_suggested_fee() function                    */
/*--------------------------------------------------------------------*/
function cms_suggested_fee()
{
    var result = "$10.00 ($5.00 for the five most recent graduating classes). "
        + "Fees are not required, but we ask that you give what you can afford  to help us defray the costs of running the chapter. ";
    document.write(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                        cms_table() function                        */
/*--------------------------------------------------------------------*/
function cms_table(a_parms)
{
    cms_table_depth++;
    var html = "<table";
    if (DEBUG == '1')
    {
        html += " border=01 bordercolor=\""
            + cms_table_borders[cms_table_depth] + "\"";
    }
    if (typeof a_parms != 'undefined') html += " " + a_parms;
// If neither of the following attributes were
// specified, they'll default to the following values:
    html += " width='" + CMS_PAGE_WIDTH + "%' cellpadding=0 cellspacing=0";
    html += ">";
x_log("\n" + cms_table_depth + ": " + html);
    document.write(html);
}
function cms_table_end()

/*--------------------------------------------------------------------*/
/*                      cms_table_end() function                      */
/*--------------------------------------------------------------------*/
{
    var html = "</table>";
x_log("\n" + cms_table_depth + ": " + html);
    document.write(html);
    cms_table_depth--;
}

/*--------------------------------------------------------------------*/
/*                         cms_toc() function                         */
/*--------------------------------------------------------------------*/
function cms_toc()
{
//     cms_debug("cms_toc();");
    TOC_NUM++;
    document.write("<SELECT NAME='cms_toc_"
        + TOC_NUM + "' onChange='cms_goto(this);'>"
        + CMS_TOC
        + "\\n</SELECT>");
}

/*--------------------------------------------------------------------*/
/*                      cms_whitebox() function                       */
/*--------------------------------------------------------------------*/
function cms_whitebox(a_parms)
{
x_log("\ncms_whitebox();");
    var parms = new String(a_parms);

    var width = x_get_parm(parms, '-width:', '80%');
    var align = x_get_parm(parms, ['-left', '-right', '-center'], '-center');
    align = align.substr(1);

    cms_old_hover_style = x_hover_style
    (
        new String
        (
            "color: " + CMS_COLOR_FG
            + "; background-color: beige"
            + "; border: #888 2px solid;"
        )
    );
    cms_old_snapshot_border_out  = x_snapshot_border_out('white');
    cms_old_snapshot_border_over = x_snapshot_border_over(CMS_COLOR_BG_0);

// line-height seems to get applied twice, so that the net effect is more
// like 121%! Also, it only gets applied to the first cell in the table!
    var result = "\n<table align='center' width='" + width
        + "' cellspacing=8 bgcolor='white' "
        + "style='margin: 12px; line-height: 110%;'>"
        + "<tr><td style='text-align: " + align + ";'>";
// alert(result);
    document.write(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                    cms_whitebox_end() function                     */
/*--------------------------------------------------------------------*/
function cms_whitebox_end()
{
    var result = "\n</td></tr></table>";
    document.write(result);
    x_hover_style(cms_old_hover_style);
    x_snapshot_border_over(cms_old_snapshot_border_over);
    x_snapshot_border_out(cms_old_snapshot_border_out);
    return result;
}

/*--------------------------------------------------------------------*/
/*                      cms_widget() function                         */
/*--------------------------------------------------------------------*/
function cms_widget(a_type, a_parm1)
{
x_log("\ncms_widget('" + a_type + "', '" + a_parm1 + "');");
    var result = new String();
    if (a_type == 'clustr_maps')
    {
        result = "<a "
+ "href='http://www2.clustrmaps.com/counter/maps.php?url=http://www.sjcalums.com/nyc' "
+ "id='clustrMapsLink'><img align='right' vspace=4 hspace=12 "
+ "src='http://www2.clustrmaps.com/counter/index2.php?url=http://www.sjcalums.com/nyc' "
+ "style='border:1px solid;' alt='Locations of visitors to this page' "
+ "title='Locations of visitors to this page' id='clustrMapsImg' "
+ "onError=\"this.onError=null; "
+ "this.src='http://clustrmaps.com/images/clustrmaps-back-soon.jpg'; "
+ "document.getElementById('clustrMapsLink').href='http://clustrmaps.com'\" "
+ "/></a>";
    }
    else if (a_type == 'flickr_badge')
    {
        result = "\n<!-- Start of Flickr Badge -->"
+ "\n<style type=\"text/css\">"
+ "\n.zg_div {margin:0px 5px 5px 0px; width:117px;}"
+ "\n.zg_div_inner {border: solid 1px #000000; background-color:#ffffff;  color:#666666; text-align:center; font-family:arial, helvetica; font-size:11px;}"
+ "\n.zg_div a, .zg_div a:hover, .zg_div a:visited {color:#3993ff; background:inherit !important; text-decoration:none !important;}"
+ "\n</style>"
+ "\n<script type=\"text/javascript\">"
+ "\nzg_insert_badge = function() {"
+ "\nvar zg_bg_color = 'ffffff';"
+ "\nvar zgi_url = 'http://www.flickr.com/apps/badge/badge_iframe.gne?zg_bg_color='+zg_bg_color+'&zg_person_id=56304711%40N00';"
+ "\ndocument.write('<iframe style=\"background-color:#'+zg_bg_color+'; border-color:#'+zg_bg_color+'; border:none;\" width=\"113\" height=\"151\" frameborder=\"0\" scrolling=\"no\" src=\"'+zgi_url+'\" title=\"Flickr Badge\"><\/iframe>');"
+ "\nif (document.getElementById) document.write('<div id=\"zg_whatlink\"><a href=\"http://www.flickr.com/badge_new.gne\"    style=\"color:#3993ff;\" onclick=\"zg_toggleWhat(); return false;\">what is this?<\/a><\/div>');"
+ "\n}"
+ "\nzg_toggleWhat = function() {"
+ "\ndocument.getElementById('zg_whatdiv').style.display = (document.getElementById('zg_whatdiv').style.display != 'none') ? 'none' : 'block';"
+ "\ndocument.getElementById('zg_whatlink').style.display = (document.getElementById('zg_whatdiv').style.display != 'none') ? 'none' : 'block';"
+ "\nreturn false;"
+ "\n}"
+ "\n</script>"
+ "\n<div class=\"zg_div\"><div class=\"zg_div_inner\">"
// + "<a href=\"http://www.flickr.com\">www.<strong style=\"color:#3993ff\">flick<span style=\"color:#ff1c92\">r</span></strong>.com</a>"
+ "<a href=\"http://www.flickr.com\"><strong style=\"color:#3993ff\">S J C &mdash; <span style=\"color:#ff1c92\"> N Y C</span></strong></a>"
+ "\n<br><script type=\"text/javascript\">zg_insert_badge();</script>"
+ "\n<div id=\"zg_whatdiv\">This is a Flickr badge showing public photos from <a href=\"http://www.flickr.com/photos/56304711@N00\">sjcalums</a>. Make your own badge <a href=\"http://www.flickr.com/badge_new.gne\">here</a>.</div>"
+ "\n<script type=\"text/javascript\">if (document.getElementById) document.getElementById('zg_whatdiv').style.display = 'none';</script>"
+ "\n</div>"
+ "\n</div>"
+ "\n<!-- End of Flickr Badge -->";
        result = "<table align='" + a_parm1 + "'><tr><td>"
            + result + "</td></tr></table>";
    }
    else if (a_type == 'frappr_maps')
    {
        result = "<a href='http://www.frappr.com/sjcalums'>"
+ "<img align='left' vspace=4 hspace=12 border=0 "
+ "src='http://www.frappr.com/i/frapper_sticker.gif' "
+ "alt='Check out our Frappr!' "
+ "title='Check out our Frappr!'></a>";
    }
    else if (a_type == 'execs')
    {
        result = "<div><embed "
+ "src='http://widget-b9.slide.com/widgets/slideticker.swf' "
+ "type='application/x-shockwave-flash' "
+ "quality='high' scale='noscale' salign='l' "
+ "wmode='transparent' "
+ "flashvars='site=widget-b9.slide.com&channel=144115188077721273&cy=be&il=1' "
+ "width='650' height='125' name='flashticker' "
+ "align='middle'/><div "
+ "style='width:650px;text-align:left;'><a "
+ "href='http://www.slide.com/pivot?id=144115188077721273&cy=be&tt=0&at=0&map=1' "
+ "target='_blank'><img "
+ "src='http://widget-b9.slide.com/p1/144115188077721273/be_t000_v000_a000_f00/images/xslide1.gif' "
+ "border='0' ismap='ismap' /></a> <a "
+ "href='http://www.slide.com/pivot?id=144115188077721273&cy=be&tt=0&at=0&map=2' "
+ "target='_blank'><img "
+ "src='http://widget-b9.slide.com/p2/144115188077721273/be_t000_v000_a000_f00/images/xslide2.gif' "
+ "border='0' ismap='ismap' /></a></div></div>";
        result = "<center>" + result + "</center>";
    }
    else
    {
        result = "Unknown widget type in call to cms_widget('" + a_type + "').";
        alert(result);
    }
// alert(result);
    document.write(result);
    return result;
}

/*--------------------------------------------------------------------*/
/*                        cms_wiki() function                         */
/*--------------------------------------------------------------------*/
function cms_wiki(a_topic)
{
    var result = "[See the Wikipedia article on "
        + "<a href='http://en.wikipedia.org/wiki/" + a_topic + "'>"
        + "<b>" + a_topic + ".</b>"
        + "</a>]";
    document.write(result);
//     alert(result);
}

/*--------------------------------------------------------------------*/
/*                        cms_yyyy() function                         */
/*--------------------------------------------------------------------*/
function cms_yyyy()
{
    document.write(YYYY);
}

/**********************************************************************/
/*                                                                    */
/*                      P L X   W R A P P E R S                       */
/*                                                                    */
/**********************************************************************/

function cms_dropcap(a_letter) {document.write(x_dropcap(a_letter));}
function cms_hover_hint(a_text_html, a_hint_html, a_left, a_top) {document.write(x_hover_hint(a_text_html, a_hint_html, a_left, a_top));}
function cms_hover_link(a_text_html, a_link_html, a_hint_html) {document.write(x_hover_link(a_text_html, a_link_html, a_hint_html));}
function cms_insert_begin() {document.write(x_insert_begin());}
function cms_insert_end() {document.write(x_insert_end());}
// function cms_link(a_anchor, a_href, a_title, a_target) {document.write(x_link(a_anchor, a_href, a_title, a_target));}
function cms_raisecap(a_letter) {document.write(x_raisecap(a_letter));}
function cms_snapshot(a_src, a_resize, a_parms, a_caption, a_width, a_height) {document.write(x_snapshot(a_src, a_resize, a_parms, a_caption, a_width, a_height));}

/*--------------------------------------------------------------------*/
/*                        cms_link() function                         */
/*--------------------------------------------------------------------*/
function cms_link(a_anchor, a_href, a_title, a_target)
{

// 'href' is changed (or not) as follows:
// DON'T CHANGE: 'http:...'
// DON'T CHANGE: 'https:...'
// DON'T CHANGE: 'structurae.de' (see seminar_20070206)
// DON'T CHANGE: '$CMS_ROOT/resources/seminar_20070206.pdf' (see seminar_20070206)
// CHANGE 'member_news' to 'index.pl?page=member_news'

    var href = a_href;
    if (typeof href == 'undefined') href='home';
    if (href == '') href='home';
// A pagename href has only alphanumerics and
// underscores and is shorthand for '.../index.pl?page=href':
    var pagename = false;
    var non_pn_chars = /[^A-Za-z0-9_]/;
    var non_pn_x = href.search(non_pn_chars);
    if (non_pn_x == -1) pagename = true;
    if (pagename)
    {
        href = 'http://www.' + CMS_DOMAIN + CMS_DIRECTORY
            + CMS_VERSION + '/index.pl?page=' + href;
// alert("'" + a_href + "' -> '" + href + "'");
    }
    document.write(x_link(a_anchor, href, a_title, a_target));
}

/**********************************************************************/
/*                                                                    */
/*                 P R I V A T E   F U N C T I O N S                  */
/*                                                                    */
/**********************************************************************/

/**********************************************************************/
/*                               E N D                                */
/**********************************************************************/
