var debug_seq = 0;
var global_save_rows;
// *****
function Wr(str) {
	document.write(str);
}
// *****	
function GetEventId(e) {
	e = (e) ? e : ((event) ? event : null);
return(((e.target) ? e.target : ((e.srcElement) ? e.srcElement : null)).id);
}
// *****
function GetText(idx)
{
return(GetId(idx).innerHTML);		
}
// *****
function GetId(idx) 
{
return(document.getElementById(idx));
}
// *****
function GetIdIx(id, ix) {
return(document.getElementsByName(id)(ix));
}	
// *****
function GetObjIx(obj, id, ix) {
return(obj.getElementsByName(id)(ix));
}	
// ***
// *****
function GetObj(obj, id) {
return(obj.getElementById(id));
}	
// *****
function QueryURL(sKey) {
return(QueryStr(sKey, document.location));
}
// *****
function QueryStr(sKey, str) {
	var p1, p2, k = new String(sKey), s = new String(str);
//	k = k.toUpperCase();
//	s = s.toUpperCase();
	p1 = s.indexOf(k) + k.length + 1;
	p2 = s.indexOf("&", p1);
	if (p2 == -1) 
		p2 = s.length;
return(s.substring(p1, p2));	
}
// *****
function ToggleId(id)
{
if (GetId(id).style.display == "none")
	ShowId(id);
  else
	HideId(id);	
return;
}
// *****
function IsDisplay(id)
{
if (GetId(id).style.display == "none")
	return(false)
return(true);
}
// *****
function ToggleObj(hide_id, show_id)
{
HideId(hide_id);
ShowId(show_id);
//document.getElementById(hide_id).style.display = "none";
//document.getElementById(show_id).style.display = "block";	
return;
}	
// *****
function ShowId(id)
{
GetId(id).style.display = "";
// document.getElementById(id).style.display = "";	
return;
}
// *****
function HideId(id)
{
GetId(id).style.display = "none";
//document.getElementById(id).style.display = "none";	
return;
}
// *****
function DoFooter()
{

//Wr("<table cellpadding='0' cellspacing='0' width='100%' style='font-family: Arial;font-size: 12px;padding-top: 8px;'>");
//Wr("<table border='0' cellpadding='0' cellspacing='0' width='780px' align='center' style='color: #666666;font-size: 9px;margin-left: 0px;margin-right: 20px;padding-top: 1px;padding-bottom: 0px;border-top: 0px solid #000000;margin-top: 8px;margin-bottom: 0px;'>");
Wr("<table border='0' cellpadding='0' cellspacing='0' align='center' style='color: #666666;font-size: 9px;margin-left: 0px;margin-right: 20px;padding-top: 1px;padding-bottom: 0px;border-top: 0px solid #000000;margin-top: 4px;margin-bottom: 0px;'>");
	Wr("<tr>");
		Wr("<td align='center'>");
//			if (top.root_exists == true) {
//				DoFooterLink("http://www.NewIpswichCC.org", "_top", "Home", "|");			
//				DoFooterLink("javascript:scroll(0,0)", "_self", "Top", "|");							
//				DoFooterLink("../contact.htm", "rbottom", "Contact Us", "|");											
//				DoFooterLink("http://www.GoPCC.com/WebAid.htm", "_blank", "+Web Aid+", "|");																						
//				Wr("<br>");
//			}				
//			Wr("<span style='font-family: Arial;font-size: 7pt;color: #808080;'>");
			Wr("Page Last Revised: " + document.lastModified);
			Wr("<br>");
//			Wr("</span>");											
			Wr("<a href='http://www.gopcc.com' title='Click to contact PC Consultants' target='_blank' style='color: #6565FF;'>");
				Wr("Web Site by PC Consultants");
			Wr("</a>");
		Wr("</td>")
	Wr("</tr>");
Wr("</table>"); 
return;
}
// *****
function DoFooterLink(link, target, text, sep, evt)
{
Wr("<a href='" + link + "' target='" + target + "'>" + text + "</a>");
Wr("<span style='font-size: 12pt;color: black;font-weight: normal;'>&nbsp;" + sep +"&nbsp;</span>");
return;
}
// *****
function SetText(idx, txt)
{
GetId(idx).innerHTML = txt;
return;
}
// *****
function SetObjText(obj, idx, txt)
{
GetObj(obj, idx).innerHTML = txt;
return;
}
// *****
function PrintPage()
{

global_save_rows = top.GetId("FrameSet1").rows;
if (GetObj(top.document, "shell").offsetHeight == 0) {
//	top.SetFramesMask('FrameSet1', '__?_'); 
//	top.main.focus();
//	;
	window.print();
//	top.main.window.focus();
//	top.main.window.print();
  } else {
//	top.SetFramesMask('FrameSet1', '___?'); 
	;
//	top.shell.focus();
//	top.shell.print();
}
top.GetId("FrameSet1").rows = global_save_rows;
return;
}
// *****
function db(str)
{
var ct = "", s;
// Xlert("db str="+str);
// Xlert(GetObj(top.debug.document, "View").value);

++debug_seq;
// Xlert("debug_seq="+debug_seq);
s = new String(debug_seq);
i = 5 - s.length;
for (j = 0; j < i; ++j)
	ct = ct + "0";
ct = ct + s + ": ";
GetObj(top.debug.document, "View").value = ct + str + "\n" + GetObj(top.debug.document, "View").value; 
return;
}
// **********
function GetListVal(lst) {
return(lst.options[lst.selectedIndex].value);	
}		
// *****
function PixelWidth(elem, str, classx)
{
/*
dom = document;
var obj = document.createElement(elem);
*/
var width = 0, p, s;
/*
// document.body.appendChild(obj);
switch (elem) {
	case "IMG":                 // img tag
//		Xebugger;
		obj.src = str;          // set image source to this string
//		dom.body.appendChild(obj);      // add obj to dom 
		width = obj.scrollWidth;
//		dom.body.removeChild(obj);
		width = 160;
//		xlert("5 PixelWidth elem=" + elem + "  width="+obj.width);
		break;
	default:                    // span tag, etc.
		obj = dom.createElement("td");
		dom.body.appendChild(obj);      // add obj to dom 
		obj.className = classx;
		obj.innerText = str;	// set inner text to this string
//		obj.innerHTML = "<div>" + str + "</div>"
//		width = str.length;
		break;
}
*/
return(width);					// return width in pixels
}

