function sb(s){
var r=/\[([0-9A-F]{2})\]/g;s=s.replace(r,'%$1');
document.write(unescape(s))}

function Obj(id) { return document.getElementById(id) }  // redefines function Obj()

function showprops(id) {
    var p;
    if( (p = id.indexOf(".")) > 0 ) {
         var ID  = id.substring(0,p);
         var SUB = id.substring(p+1);
         var el  = (Obj(ID))[SUB];
         // Generalize to allow:  aaa.bbb.ccc etc
    }
    else
        el = Obj(id);
    var s = "";
    var n;
    var i=0;
    for(n in el) {
        var v = el[n]+"";
        var nv = n+"="+v;
        if(1 || !v.match(/function|[A-Z][A-Z][A-Z]/)) {
          if(1 || !n.match(/[A-Z][A-Z][A-Z]/)) {
            if(1 || nv.match(/color/i)) {
              if(v != "") {
                if((++i)%2 == 0)
                  s += "\n";
                else
                  s += ", ";
                s += n+"='"+v+"'";
              }
            }
          }
        }
    }
    s = "P R O P E R T I E S  O F  "+id+": "+s;
    return s;
}

var at = "@";
var bksl = "\\";
var bksl_dquo = "\"";
var bksl_squo = '\'';
/* phrase (1) with slash/ star* */ /* phrase (2) with slash star */
/* multiple
   line
   block
   // A double-slash line inside the block
*/
// double slash line
// double slash line with embedded /* slash star */ string
/* final slash star line */
     function curious() {
	var x= "This function is indented";
     }
function Obj(id) { return document.getElementById(id) }  // defines function Obj()
function Scripture (passage) {
    passage = "http://bible.gospelcom.net/passage?version=51&search="+passage+";";
    passage = passage.replace(/:[+ ]*/g,":");
    passage = passage.replace(/[+ ]+/g,"%20");
    win = window.open (
	    passage, "Scripture",
	    "bgcolor=#EFE7D0,scrollbars,menubar,resizable,width=800,height=600");
    WinFocus(win);
}
function Scripture2(passage,generic) {
    if (generic != 1 ) {
        passage = "http://bible.gospelcom.net/bible?" + passage;
    }
    win = window.open(passage, "Scripture",
          "bgcolor=gray,scrollbars,menubar,resizable,width=800,height=600");
    // assume win.focus works, unless broken msoft browser
    if (navigator.appName.search (/^microsoft/i) == -1) {
        win.focus();
    }
}
function YouTube(YouTubeRef) {
    PopUp('http://www.youtube.com/watch?v='+YouTubeRef ,676,565);
    return void(0);
}
function PopUp (URL,width,height) {
    if(width  == null) { width  = "500" }
    if(height == null) { height = .6*width }
    win = window.open (
	    URL, "PopUp",
	    "scrollbars,menubar,resizable," +
	    "width=" + width + ",height=" + height );
    WinFocus(win);
    return void(0);
}
function Help(content,width,height) {
    if(width  == null) { width  = "500" }
    if(height == null) { height = .6*width }
    iwin = window.open (
            "", "Help",
            "scrollbars,menubar,resizable," +
            "width=" + width + ",height=" + height );
    doc = iwin.document;
    doc.writeln('<html>\n<head>\n<title>Help</title>\n' +
//        '<SCRIPT LANGUAGE="JavaScript" SRC="/scripts.js" ></SCRIPT>\n' +
//        '<LINK REL=StyleSheet TYPE="text/css" HREF="/styles.css" >\n' +
	'<style>\n' +
	'pp, .pp { font-size:9pt; font-family: arial, sans-serif;\n' +
	'color: #002000; margin-top:6pt; margin-bottom:.0001pt; }\n' +
	'</style>\n' +
	'</head>\n<body bgcolor="#EFE7D0" peachpuff class=pp>\n' + content +
	'\n<hr><form><center>' +
	'<input type=button onclick="window.close()" value="&nbsp;ok&nbsp;">' +
	'</center></form>\n</body>\n</html>');
    doc.close();
    WinFocus(iwin);
}
function WinFocus(win) {
    // assume win.focus works, unless its a broken old msoft browser
    if ( (navigator.appName.search (/^microsoft/i) == -1) ||
         (navigator.appName == "Microsoft Internet Explorer" &&
          navigator.appVersion.indexOf("Windows", 0) != -1   &&
          navigator.appVersion.substring(0,1) >= 4) ) {
		win.focus()
    }
}
function FinePrint(pixdir) {
    // if(pixdir == null) { pixdir = "/pix" }
    var pixdir = "/pix";
    document.write(
      '<hr>\n'+
      '<a href="#_top" onclick="cc()" >'+
      '<img src="' + pixdir + '/ptr-up.gif" border=0 width=16 height=9 title="Top"></a>\n'+
      '<br><span style="font-family:arial narrow,helvetica narrow,'+
      'sans-serif;font-size:9pt;color:#889888;'+
      'margin-top:0pt;margin-bottom:.0001pt">\n'
    );
    TimeStamp();
    document.write(
      '<br>\n'+
      'Copyright &copy; 2011 Christ Church, Summit NJ.  All rights reserved'+
      '</span>\n'+
      '</td></tr></table></body></html>\n'
    );
    document.close();
}
function TimeStamp(pfx) {
    if(pfx == null) { pfx = "Page last modified: " }
    var Date = " " + document.lastModified;
    Date = Date.replace(/([A-Z][a-z]{2})[a-z]*/g,"$1");
    Date = Date.replace(/:\d\d($|[^\d:])/g,"$1");
    Date = Date.replace(/\//g," / ");
    Date = Date.replace(/ 0/g," ");
    Date = Date.replace(/ ([0-9]+:)/," &nbsp;-&nbsp; $1");
    document.write("<nobr>" + pfx + Date + "</nobr>\n");
}

var clickCount = 1;
function PreviousPage() {
    // alert("clickCount =" + clickCount); // debug
    if (clickCount > 1) history.go(-clickCount); else history.back();
    // Usage: <a href="#xxx" onClick="cc()">xxx</a> etc. ...
    //        [ <a href="JavaScript: PreviousPage()">back</a> ]
}
function cc() {
    clickCount++;
}
function RadioValue(r) {
    // r must be a radio array object, as for RadVal below
    for (i=0;i<r.length;i++){
        if (r[i].checked)
            return r[i].value;
    }
    return "";
}
function RadVal(RadioName) {
	if(!RadioName)
		return "";
	var radioArrayObj = document.getElementsByName(RadioName);
	if(!radioArrayObj)
		return "";
	var radioLength = radioArrayObj.length;
	if(radioLength == undefined)
		if(radioArrayObj.checked)
			return radioArrayObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioArrayObj[i].checked) {
			return radioArrayObj[i].value;
		}
	}
	return "";
}
function setRadioValue(radioName, newValue) {
	/* Needs testing */
	if(!radioName)
		return;
	var radioArrayObj =  document.getElementsByName(RadioName);
	if(!radioArrayObj)
		return;
	var radioLength = radioArrayObj.length;
	if(radioLength == undefined) {
		radioArrayObj.checked = (radioArrayObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioArrayObj[i].checked = false;
		if(radioArrayObj[i].value == newValue.toString()) {
			radioArrayObj[i].checked = true;
		}
	}
}
function getSelectedOption(Id) {
// Returns the value of the first selected option in a <select>..</select> list
    var sel = Obj(Id);
    var opt = sel.options[sel.selectedIndex];
    var val = opt.value || opt.text;
    return val;
}

var holdmailto, listmailto, nchosenmailto, maxallowedmailto;
function mkmailtolist(choice,mailto) {
    if(holdmailto == null) holdmailto  = mailto.href;
//  alert("mkmailtolist: holdmailto = "+holdmailto+"\nchoice.length = "+choice.length);
    listmailto  = "mailto:";
    delim = "";
    nchosenmailto = 0;
    maxallowedmailto = 50;
    for (i=0;i<choice.length;i++){
        if (choice[i].checked) {
	    nchosenmailto++;
	    var s = choice[i].value;
	    s = s.replace(/#/g,"@");
	    s = s.replace(/!/g,".");
	    if(nchosenmailto <= maxallowedmailto)
		listmailto = listmailto+delim+s;
	    delim = "; ";
	}
    }
    if(nchosenmailto == 0)
	listmailto = "mailto:(nobody checked)";
    if(nchosenmailto > maxallowedmailto)
	listmailto = "mailto:(too many checked -- max is "+maxallowedmailto+")";
    if(nchosenmailto == choice.length)
	listmailto = holdmailto;
    return listmailto;
}
function mkmailto(choice,mailto) {

//    var s = navigator.appName + ":" + navigator.appVersion;
//    alert("DEBUG mkmailto: "+s);
//    if(s.match(/Netscape.*:5\./) {
//	alert("Sorry, but this feature doesn't work yet with Firefox.\nIt needs some debugging.");
//	return false;
//    }

    if(holdmailto == null) holdmailto  = mailto.href;
//  alert("holdmailto = "+holdmailto+"\nchoice.length = "+choice.length);
    mkmailtolist(choice,mailto);
    if(nchosenmailto == 0) {
	alert("Please check one or more email addresses first.");
	return false;
    }
    if(nchosenmailto == choice.length) {
	mailto.href = holdmailto;
	return true;
    }
    if(nchosenmailto > maxallowedmailto) {
	alert("Sorry. You have checked "+nchosenmailto+" boxes, which\nexceeds "+
	      "the maximum allowed of "+maxallowedmailto)
	return false;
    }
    mailto.href = listmailto;
    return true;
}
function clearall(choice) {
    for (i=0;i<choice.length;i++){
        choice[i].checked = false;
    }
    return false;
}
function checkall(choice) {
    for (i=0;i<choice.length;i++){
        choice[i].checked = true;
    }
    return false;
}

function mto(who,where,dom,show,opt,ux) {
    if(opt  == null) opt  = "";
    if(dom  == null) dom  = "";
    if(show == null) show = "";
    if(ux   == null) ux   = "";
    if(dom.match(/^(pbz|bet|rqh|arg|tbi|hf)$/)) {
	dom   = rt(dom);
	who   = rt(who);
	where = rt(where);
	show  = rt(show);
	ux    = rt(ux);
    }
    if(dom != ""   ) dom = "."+dom;
    var em = who+"@"+where+dom;
    if(show == ""  ) show = em;
    if(opt != ""   ) opt = " "+opt;
//    ux = "(ux:"+ux+")"; // DEBUG
    var s= '<'+'a hr'+'ef="mai'+'lto'+':'+em+ux+'"'+opt+' title=" Send email to '+show+' ">'+show+'</a>';
    document.write(s);
//    alert(s);
}

var abc = "abcdefghijklm@.- nopqrstuvwxyz#:=,".split("");
var nbc = new Object();
for(var i=0; i<34; i++) nbc[abc[i]] = i;
function rt(s) {
    var y = "";
    for(var i=0; i<s.length; i++) {
        var C = s.substr(i,1);
        var c = C.toLowerCase();
        var x = abc[(nbc[c]+17)%34];
        if(c != C) x = x.toUpperCase();
        if(x != "" && x != null) y += x
        else  y += C;
    }
    return y;
}

// A line at the end

