// Inline definitions of stuff from HTMLPages

// These save users having to update HTMLPages every time something changes

// Doing it as functions instead of static text allows edit and continue debugging

#define BTNCOLOUR "red"

char * WebMailMsgtxt()
{
	char Msg[] =

		"<!-- Version 5 11/11/2019 -->"
		"<!DOCTYPE html> "
		"<html> "
		"<head> "
		"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/>" 
		"<style type=\"text/css\">"
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"pre {margin-left: 4px;margin-right: 4px;white-space: pre-wrap}" 
		"#main{width:700px;position:absolute;left:0px;border:2px solid;background-color: #ffffff;}"
		"</style>\r\n"
		"<script>"
		"var Main;"
		"var fromleft;"
		"var txt;\r\n"

		"function initialize(mainoffset)"
		"{"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];"
		"	x=w.innerWidth;"
		"	y=w.innerHeight;" 
		"	Main = document.getElementById(\"main\");"
		"	txt =  document.getElementById(\"txt\");"
		"	w = x;	"
		"	if (w > 920) {w = 920;}"
		"	fromleft = (x / 2) - (x - 150)/2;"
		"	if (fromleft < 0) {fromleft = 0;}"
		"	Main.style.left = fromleft + \"px\";"
		"	Main.style.width = x - 150 + \"px\";"
		"	Main.style.height = y - mainoffset + \"px\";"
		"	txt.style.left = fromleft + \"px\";"
		"	txt.style.width = x - 150 + \"px\";"
		"	txt.style.height = y - mainoffset + \"px\";"	
		"}\r\n"

		"function Reply(Num, Key)"
		"{"
		"var param = \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,titlebar=yes,toobar=yes\";"
		"window.open(\"/WebMail/Reply/\" + Num + \"?\" + Key,\"_self\",param);"
		"}\r\n"

		"</script>\r\n"
		"<title>WebMail</title> "
		"</head>\r\n"
		"<body background=/background.jpg onload=initialize(125) onresize=initialize(125)>"
		"<h3 align=center> %s Webmail Interface - User %s - Message %d</h3>"
		"<table align=center border=1 cellpadding=2 bgcolor=white><tr>"
		"<td><a href=\"#\" onclick=\"Reply('%d' ,'%s'); return false;\">Reply</a></td>"
		"<td><a href=/WebMail/WMDel/%d?%s>Kill Message</a></td>"
		"%s"
		"<td><a href=/WebMail/WMNext?%s>Next</a></td>"
		"<td><a href=/WebMail/WMPrev?%s>Previous</a></td>"
		"<td><a href=/WebMail/WMSame?%s>Back to List</a></td>"
		"</tr></table>"
		"<br>"
		"<div align=center id=\"main\">"
		"<%s id=\"txt\" style=\"overflow:auto;\" align=left>%s</%s>"
		"</div>";

	return _strdup(Msg);
}

char * FwdPagetxt()
{
	char Msg[] =

		"<!-- Version 4 11/11/2019 -->"
		"<!DOCTYPE html>"
		"<style type=\"text/css\"> "
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"#outer"
		"{"
		"width:900px;"
		"height:620px;"
		"position:absolute;"
		"border:0px solid;"
		"font-family: monospace;"
		"}"
		"#main"
		"{"
		"width:600px;"
		"position:absolute;"
		"height:610px;"
		"left:295px;"
		"border:2px solid;"
		"}"
		"#left"
		"{"
		"position: absolute;"
		"width:290px;"
		"height:550px;"
		"border:0px solid;"
		"overflow: auto;"
		"}"
		"#common"
		"{"
		"position: absolute;"
		"width:180px;"
		"height:540px;"
		"border:2px solid;"
		"overflow: auto;"
		"}"
		"#sidebar"
		"{"
		"position: absolute;"
		"width:95px;"
		"left:190px;"
		"height:540px;"
		"border:2px solid;"
		"overflow: auto;"
		"}"
		"</style>"
		"<title>Edit Forwarding</title>"

		"<script type=\"text/javascript\"> "

		"var Details;"
		"var Sidebar;"
		"var fromleft;"
		"var Outer;"
		"var Key = \"%s\"\r\n"

		"function initialize()"
		"{"
		"resize();" 
		"	Details = document.getElementById(\"main\"); "
		"	Details.innerHTML = \"waiting for data...\"; "
		"	GetData(\"\");"
		"}\r\n"

		"function resize()"
		"{"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];"
		"	x=w.innerWidth||e.clientWidth||g.clientWidth;	y=w.innerHeight||e.clientHeight||g.clientHeight;"
		"	fromleft = (x / 2) - 450;"
		"	if (fromleft < 0) {fromleft = 0;}"
		"	Outer = document.getElementById(\"outer\");" 
		"	Outer.style.left = fromleft + \"px\";"
		"}\r\n"

		"function save(form)"
		"{"
		"	var msg;"
		"	var fn = \"FWDSave?\" + Key;"

		"	msg = "
		"	form.TO.value + \"|\" +"
		"	form.AT.value + \"|\" +"
		"	form.Times.value + \"|\" +"
		"	form.FWD.value + \"|\" +"
		"	form.HRB.value + \"|\" +"
		"	form.HRP.value + \"|\" +"
		"	form.BBSHA.value + \"|\" +"
		"	form.EnF.checked + \"|\" +"
		"	form.Interval.value + \"|\" +"
		"	form.EnR.checked + \"|\" + "
		"	form.RInterval.value + \"|\" +"
		"	form.NoWait.checked + \"|\" +"
		"	form.Blocked.checked + \"|\"  +"
		"	form.FBBBlock.value + \"|\"  +"
		"	form.Personal.checked + \"|\" +"
		"	form.Bin.checked + \"|\" +"
		"	form.B1.checked + \"|\" +"
		"	form.B2.checked + \"|\" +"
		"	form.CTRLZ.checked + \"|\" +"
		"	form.ConTimeOut.value + \"|\";"
		"	post(fn, msg);"
		"}\r\n"

		"function startf(form)"
		"{"
		"var fn = \"FWDSave?\" + Key;"
		"	post(fn, \"StartForward\", \"\");"
		"}\r\n"

		"function copyf(form)"
		"{"
		"	var msg;"
		"	var fn = \"FWDSave?\" + Key;"

		"	msg = \"CopyForward|\" + form.CopyCall.value;"

		"	post(fn, msg);"
		"}\r\n"

		"function post(url, data)"
		"{"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{if (request.readyState == 4){Details.innerHTML = request.responseText;}}\r\n"
		"	request.open(\"POST\", url, true);request.send(data);\r\n"
		"}\r\n"

		"function GetDetails(call)"
		"{"
		"	var fn = \"FwdDetails?\" + Key;"
		"	post(fn, call);"
		"}\r\n"
		"function GetData()"
		"{"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}"

		"	request.onreadystatechange = function()"
		"	{"
		"		if (request.readyState == 4)"
		"		{"
		"			var text = request.responseText;"
		"			var lines = text.split(\"|\");"
		"			var i = 0;"

		"	 	    var infoArea = document.getElementById(\"sidebar\");" 
		"		    var strInfo = '<table>';"

		"			while(i < lines.length - 1)\r\n"
		"			{"
		"				var clink = '<a href=javascript:GetDetails(\"' + lines[i] + '\")>' + lines[i] + '</a>';\r\n"	
		"				var tableRow = '<tr><td>' + clink + '</td></tr>';\r\n"
		"				strInfo += tableRow;\r\n"
		"				i=i+1;"
		"			}"
		"			infoArea.innerHTML = strInfo + \"</table>\";"
		"			GetDetails(lines[0]);\r\n"
		"		}\r\n"
		"	}\r\n"
		"	request.open(\"POST\",\"FwdList.txt?%s\",true);\r\n"										   
		"	request.send();\r\n"
		"}\r\n"

		"  </script>\r\n"
		"</head><body onload=initialize() onresize=resize() style=\"background-image: url(/background.jpg);\">"
		"<h3 align=center>BPQ32 BBS %s</h3>"

		"<table align=center bgcolor=white border=1 cellpadding=2>"

		"  <tbody>"
		"    <tr>"
		"      <td><a href=\"/Mail/Status?%s\">Status</a></td>"
		"      <td><a href=\"/Mail/Conf?%s\">Configuration</a></td>"
		"      <td><a href=\"/Mail/Users?%s\">Users</a></td>"
		"      <td><a href=\"/Mail/Msgs?%s\">Messages</a></td>"
		"      <td><a href=\"/Mail/FWD?%s\">Forwarding</a></td>"
		"      <td><a href=\"/Mail/Wel?%s\">Welcome Msgs &amp; Prompts</a></td>"
		"      <td><a href=\"/Mail/HK?%s\">Housekeeping</a></td>"
		"      <td><a href=\"/Mail/WP?%s\">WP Update</a></td>"
		"<td><a href=/Webmail>WebMail</a></td>"
		"      <td><a href=\"/\">Node Menu</a></td>"
		"    </tr>"
		"  </tbody>"
		"</table>"

		"<br />"

		"<div id=\"outer\">"
		"<div id=\"left\">"
		"<div id=\"common\">"
		"<form style=\"font-family: monospace; text-align: center;\" method=post action=/Mail/FwdCommon?%s>"
		"Max size to Send <input value=%d size=3 name=MaxTX><br>"
		"<br>"
		"Max Size to Receive <input value=%d size=3 name=MaxRX><br>"
		"<br>"
		"Max age for Bulls <input value=%d size=3 name=MaxAge><br>"
		"<br>"
		"Warn if no route<br>"
		"&nbsp;for P or T <input %sname=WarnNoRoute type=checkbox /><br />"
		"  <br />"
		"Use Local Time&nbsp;<input %sname=LocalTime type=checkbox /><br />"
		"  <br />"
		"Send P Msgs to more than one BBS&nbsp;<input %sname=SendPtoMultiple type=checkbox /><br />"
		"  <br />"
		"Use 4 Char Continent Codes&nbsp;<input %sname=FourCharCont type=checkbox /><br />"
		"  <br />"
		"Aliases<br />"
		"  <br />"
		"  <textarea rows=8 cols=12 name=Aliases>%s</textarea><br><br>"
		"<input name=Submit value=Update type=submit class='btn'> </form>"
		"</div>"
		"<div id=\"sidebar\"> </div>"
		"</div>"
		"<div id=\"main\"> </div>"
		"</div>"
		"</body></html>";

	return _strdup(Msg);
}

char * FwdDetailtxt()
{
	char Msg[] =

		"<!-- Version 3 11/11/2019 -->\r\n"
		"<h3 align=\"center\">Forwarding Config for %s - %d Messages Queued</h3><form style=\"font-family: monospace; text-align: center\" method=post action=/Mail/FWD?%s>\r\n"
		"&nbsp;&nbsp;TO &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n"
		"&nbsp;TIMES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; Connect Script<br>\r\n"
		"<textarea wrap=hard rows=8 cols=10 name=TO>%s</textarea> \r\n"
		"<textarea wrap=hard rows=8 cols=10 name=AT>%s</textarea> \r\n"
		"<textarea wrap=hard rows=8 cols=10 name=Times>%s</textarea> \r\n"
		"<textarea wrap=hard rows=8 cols=20 name=FWD>%s</textarea><br>\r\n"
		"Hierarchical Routes (Flood Bulls) HR (Personals and Directed Bulls)\r\n"
		"<textarea wrap=hard rows=8 cols=30 name=HRB>%s</textarea> \r\n"
		"<textarea wrap=hard rows=8 cols=30 name=HRP>%s</textarea>\r\n"
		"<br><br>\r\n"
		"BBS HA <input value=\"%s\" size=50 name=BBSHA> <br>\r\n"
		"Enable Forwarding&nbsp;<input %sname=EnF type=checkbox> Interval <input value=%d size=3 name=Interval>(Secs)<br>\r\n"
		"Request Reverse&nbsp;&nbsp;&nbsp;<input %sname=EnR type=checkbox> Interval <input value=%d size=3 name=RInterval>(Secs)<br>\r\n"
		"Send new messages without waiting for poll timer<input %sname=NoWait type=checkbox><br>\r\n"
		"FBB Blocked <input %sname=Blocked type=checkbox>Max Block <input value=%d size=3 name=FBBBlock> \r\n"
		"Send Personal Mail Only <input %sname=Personal type=checkbox><br>\r\n"
		"Allow Binary <input %sname=Bin type=checkbox> Use B1 Protocol <input %sname=B1 type=checkbox>&nbsp; Use B2 Protocol<input %sname=B2 type=checkbox><br>\r\n"
		"Send ctrl/Z instead of /ex in text mode forwarding <input %sname=CTRLZ type=checkbox><br>\r\n"
		"Incoming Connect Timeout <input value=%d size=3 name=ConTimeOut>(Secs)<br>\r\n"
		"<br>\r\n"
		"<input onclick=copyf(this.form) value=\"Copy from BBS\" type=button class='btn'>\r\n"
		"<input value=\"\" size=3 name=CopyCall> \r\n"
		"<input onclick=save(this.form) value=Update type=button class='btn'>\r\n"
		"<input onclick=startf(this.form) value=\"Start Forwarding\" type=button class='btn'>\r\n"
		"</form>\r\n";


	return _strdup(Msg);
}

char * webscriptjs()
{
	char Msg[] =
		"<!-- Version 2 17/10/2018 -->\r\n"
		"var Main\r\n"
		"var fromleft;\r\n"
		"\r\n"
		"function initialize(mainoffset)\r\n"
		"{\r\n"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"	x=w.innerWidth; //||e.clientWidth||g.clientWidth;\r\n"
		"	y=w.innerHeight; //||e.clientHeight||g.clientHeight; \r\n"
		"	Main = document.getElementById(\"main\");\r\n"
		"	w = x;	\r\n"
		"	if (w > 920) {w = 920;}\r\n"
		" 	fromleft = (x / 2) - (x - 150)/2;\r\n"
		"	if (fromleft < 0) {fromleft = 0;}\r\n"
		"	Main.style.left = fromleft + \"px\";\r\n"
		"	Main.style.width = x - 150 + \"px\";\r\n"
		"	Main.style.height = y - mainoffset + \"px\";\r\n"
		"}\r\n"
		"function newmsg(Key)\r\n"
		"{\r\n"
		"var param = \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,titlebar=yes,toobar=yes\";\r\n"
		"window.open(\"/WebMail/NewMsg?\" + Key,\"_self\",param);\r\n"
		"}\r\n"
		"function Reply(Num, Key)\r\n"
		"{\r\n"
		"var param = \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,titlebar=yes,toobar=yes\";\r\n"
		"window.open(\"/WebMail/Reply/\" + Num + \"?\" + Key,\"_self\",param);\r\n"
		"}\r\n";

	return _strdup(Msg);
}





char * WebMailPagetxt()
{
	char Msg[] =
		"<!-- Version 6 8/11/2018 -->\r\n"
		"<!DOCTYPE html> \r\n"
		"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"> \r\n"
		"<head> \r\n"
		"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/> \r\n"
		"<meta http-equiv=refresh content=300>"
		"<style type=\"text/css\">\r\n"
		"pre {margin-left: 4px;white-space: pre} \r\n"
		"#main{width:700px;position:absolute;left:0px;border:2px solid;background-color: #ffffff;}\r\n"
		"</style>\r\n"
		"<script src=\"/WebMail/webscript.js\"></script>\r\n"
		"<title>WebMail</title> \r\n"
		"\r\n"
		"</head>\r\n"
		"<body background=/background.jpg onload=\"initialize(120)\" onresize=\"initialize(120)\">\r\n"
		"<h3 align=center> %s Webmail Interface - User %s - Message List</h3>\r\n"
		"<table align=center border=1 cellpadding=2 bgcolor=white><tr>\r\n"
		"\r\n"
		"<td><a href=/WebMail/WMB?%s>Bulls</a></td>\r\n"
		"<td><a href=/WebMail/WMP?%s>Personal</a></td>\r\n"
		"<td><a href=/WebMail/WMT?%s>NTS</a></td>\r\n"
		"<td><a href=/WebMail/WMALL?%s>All Types</a></td>\r\n"
		"<td><a href=/WebMail/WMMine?%s>Mine</a></td>\r\n"
		"<td><a href=/WebMail/WMfromMe?%s>My Sent</a></td>\r\n"
		"<td><a href=/WebMail/WMtoMe?%s>My Rxed</a></td>\r\n"
		"<td><a href=/WebMail/WMAuto?%s>Auto Refresh</a></td>\r\n"
		"<td><a href=\"#\" onclick=\"newmsg('%s'); return false;\">Send Message</a></td>\r\n"
		"<td><a href=/WebMail/WMLogout?%s>Logout</a></td>\r\n"
		"<td><a href=/Mail/Header>Mail Mgmt</a></td>\r\n"
		"<td><a href=/>Node Menu</a></td></tr></table>\r\n"
		"<br>\r\n"
		"<div align=left id=\"main\" style=\"overflow:scroll;\">\r\n"
		"<pre align=left>%s</pre>\r\n"
		"</div> \r\n"
		"\r\n"
		"\r\n";

	return _strdup(Msg);
}


char * MainConfigtxt()
{
	char Msg[] =
		"<!-- Version 7 2/1/2017 -->\r\n"
		"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\r\n"
		"<html><head><title>Main Configuration</title>\r\n"
		"\r\n"
		"<style type=\"text/css\">"
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"table, th, td {border: 1px solid black;border-collapse: collapse;}"
		"</style>"
		"<script type=\"text/javascript\"> \r\n"
		" \r\n"
		"var Main\r\n"
		"var fromleft;\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{	\r\n"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"	x=w.innerWidth||e.clientWidth||g.clientWidth;\r\n"
		"	fromleft = (x / 2) - 370;\r\n"
		"	if (fromleft < 0) {fromleft = 0;}\r\n"
		"	Main = document.getElementById(\"main\"); \r\n"
		"	Main.style.left = fromleft + \"px\";\r\n"
		"}\r\n"
		"</script>\r\n"
		"</head><body style=\"background-image: url(/background.jpg);\" onload=\"initialize()\" onresize=\"initialize()\">\r\n"
		"<h3 align=\"center\">BPQ32 BBS %s</h3>\r\n"
		"\r\n"
		"<table align=\"center\" bgcolor=\"white\" border=\"1\" cellpadding=\"2\">\r\n"
		"<tr>\r\n"
		"      <td><a href=\"/Mail/Status?%s\">Status</a></td>\r\n"
		"      <td><a href=\"/Mail/Conf?%s\">Configuration</a></td>\r\n"
		"      <td><a href=\"/Mail/Users?%s\">Users</a></td>\r\n"
		"      <td><a href=\"/Mail/Msgs?%s\">Messages</a></td>\r\n"
		"      <td><a href=\"/Mail/FWD?%s\">Forwarding</a></td>\r\n"
		"      <td><a href=\"/Mail/Wel?%s\">Welcome Msgs &amp; Prompts</a></td>\r\n"
		"      <td><a href=\"/Mail/HK?%s\">Housekeeping</a></td>\r\n"
		"      <td><a href=\"/Mail/WP?%s\">WP Update</a></td>\r\n"
		"<td><a href=/Webmail>WebMail</a></td>"
		"      <td><a href=\"/\">Node Menu</a></td>\r\n"
		"</tr></table>\r\n"
		"<br>\r\n"
		"<div style=\"text-align: center;\"><font size=\"+1\"><span style=\"font-family: monospace; font-weight: bold;\">Main Configuration</span></font></div>\r\n"
		"\r\n"
		"<div id=\"main\" style=\"border: 2px solid ; overflow: auto; position: relative; top: 10px; height: 1180px; width: 740px; left: 86px;\">\r\n"
		"<form border=\"1\" style=\"font-family: monospace;\" method=\"post\" action=\"/Mail/Config?%s\">\r\n"
		"  <h3>&nbsp;BBS Params</h3>\r\n"
		"&nbsp;BBS Call&nbsp;&nbsp;<input value=\"%s\" name=\"BBSCall\">&nbsp;SYSOP\r\n"
		"Call <input value=\"%s\" name=\"SYSOPCall\"><br>\r\n"
		"&nbsp;H Route&nbsp;&nbsp; <input value=\"%s\" name=\"HRoute\">\r\n"
		"  <input %sname=\"BBSToSYSOP\" type=\"checkbox\"> Redirect msgs to BBS Call to SYSOP Call<br>\r\n"
		"  <br>\r\n"
		"&nbsp;BBS APPL No <input value=\"%d\" size=\"3\" name=\"ApplNum\">&nbsp;&nbsp;Streams\r\n"
		"  <input value=\"%d\" size=\"3\" name=\"Streams\"><br>\r\n"
		"  <br>\r\n"
		"  <input %sname=\"SysToSYSOP\" type=\"checkbox\"> Send System Msgs to\r\n"
		"SYSOP Call<br>\r\n"
		"  <input %sname=\"RefuseBulls\" type=\"checkbox\"> Refuse Bulls<br>\r\n"
		"  <input %sname=\"EnUI\" type=\"checkbox\"> Enable FBB UI System<br>\r\n"
		"&nbsp;&nbsp;&nbsp; Send Mail For Beacons every&nbsp; <input value=\"%d\" size=\"3\" name=\"UIInterval\"> Minutes <input name=\"ConfigUI\" value=\"Config UI Ports and Digis\" type=submit class='btn'><br>\r\n"
		"  <input %sname=\"DontHold\" type=\"checkbox\"> Don't Hold Messages From New Users<br>\r\n"
		"  <input %sname=\"DefaultNoWinlink\" type=\"checkbox\"> Set Don't add WINLINK.ORG flag on new users<br>\r\n"
		"  <input %sname=\"DontNeedName\" type=\"checkbox\"> Don't Request Name<br>\r\n"
		"  <input %sname=\"DontNeedHomeBBS\" type=\"checkbox\"> Don't Request Home BBS<br>\r\n"
		"  <input %sname=\"DontCheckFromCall\" type=\"checkbox\"> Dont Check From Call<br>\r\n"
		"  <input %sname=\"UserCantKillT\" type=\"checkbox\"> Allow users to kill T messages<br>\r\n"
		"  <input %sname=\"FWDtoMe\" type=\"checkbox\"> Forward Messages to BBS Call<br>\r\n"
		"  <input %sname=\"OnlyKnown\" type=\"checkbox\"> Don't allow unknown users<br>\r\n"
		"  <input %sname=\"Events\" type=\"checkbox\"> Enable Event Reporting<br><br>\r\n"

		"&nbsp;POP3 Port&nbsp;&nbsp; <input value=\"%d\" size=\"3\" name=\"POP3Port\">\r\n"
		"SMTP Port <input value=\"%d\" size=\"3\" name=\"SMTPPort\"> NTPPort <input value=\"%d\" size=\"3\" name=\"NNTPPort\">&nbsp;<input %sname=\"EnRemote\" type=\"checkbox\"> Enable Remote Access<br>\r\n"
		"&nbsp;AMPR Address <input value=\"%s\" name=\"AMPRDomain\"> <input %sname=\"SendAMPR\" type=\"checkbox\"> Send AMPR Mail to AMPR host\r\n"
		"\r\n"
		" <h3>&nbsp;ISP Params</h3>\r\n"
		"  <input %sname=\"EnISP\" type=\"checkbox\"> Enable ISP\r\n"
		"Interface<br>\r\n"
		"&nbsp;My Domain&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;<input value=\"%s\" name=\"ISPDomain\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>\r\n"
		"&nbsp;SMTP Server &nbsp; &nbsp; &nbsp;&nbsp; <input value=\"%s\" name=\"SMTPServer\"> Port &nbsp; &nbsp; <input value=\"%d\" size=\"3\" name=\"ISPSMTPPort\"> SMTP Domain &nbsp;<input value=\"%s\" name=\"ISPEHLOName\"><br>\r\n"
		"&nbsp;POP3 Server &nbsp; &nbsp;&nbsp; &nbsp; <input value=\"%s\" name=\"POP3Server\"> Port &nbsp; &nbsp; <input value=\"%d\" size=\"3\" name=\"ISPPOP3Port\"><br>\r\n"
		"&nbsp;ISP Account Name &nbsp; <input value=\"%s\" name=\"ISPAccount\">\r\n"
		"Password <input value=\"%s\" name=\"ISPPassword\"> <br>\r\n"
		"&nbsp;POP3 Poll Interval <input value=\"%d\" size=\"3\" name=\"PollInterval\">&nbsp;\r\n"
		"<input %sname=\"ISPAuth\" type=\"checkbox\"> SMTP Server Requires Authentication\r\n"
		"<h3>&nbsp;WP Params</h3>\r\n"
		" <input %sname=\"EnWP\" type=\"checkbox\"> Send WPUpdates&nbsp;&nbsp;&nbsp; \r\n"
		" <input %sname=\"RejWFBulls\" type=\"checkbox\"> Reject WP Bulls&nbsp;&nbsp;&nbsp; &nbsp;\r\n"
		" Type B<input %s name=\"Type\" value=\"TypeB\" type=\"radio\">Type P<input %s name=\"Type\" value=\"TypeP\" type=\"radio\"><br><br>\r\n"
		"&nbsp;WP Destinations<br>&nbsp;<textarea cols=\"30\" rows=\"4\" name=\"WPTO\">%s</textarea><br>\r\n"
		"<h3>&nbsp;Message Filters</h3>\r\n"
		"&nbsp;Reject From&nbsp; Reject\r\n"
		"To&nbsp;&nbsp;&nbsp; Reject At&nbsp;&nbsp; Reject BID &nbspHold "
		"From&nbsp;&nbsp;&nbsp; Hold\r\n"
		"To&nbsp;&nbsp; &nbsp; Hold At &nbsp; &nbsp;Hold BID<br>&nbsp;\r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"Rfrom\">%s</textarea> \r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"Rto\">%s</textarea> \r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"Rat\">%s</textarea> \r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"RBID\">%s</textarea> \r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"Hfrom\">%s</textarea>\r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"Hto\">%s</textarea> \r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"Hat\">%s</textarea>\r\n"
		"<textarea cols=\"8\" rows=\"5\" name=\"HBID\">%s</textarea>\r\n"
		"<p></p>"
		"&nbsp;FBB reject.sys type filters (all fields must match, wildcards allowed)<br>"
		"&nbsp;'A' action accepts message if all fields match without checking following lines\r\n"
		"<p></p>"
		"<div style='position: absolute; left: 20px;height: 120px; overflow:auto;'>%s</div>"
		"<div style='position: absolute; top: 1120px;left: 300px; overflow:auto;'>"
		"<input class='btn' name=\"Save\" value=\"Save\" type=submit class='btn'> <input class='btn' name=\"Cancel\" value=\"Cancel\" type=submit class='btn'>"
		"</div>"
		"</form>\r\n"
		"</div>\r\n";

	return _strdup(Msg);
}




char * MsgPagetxt()
{
	char Msg[] =
		"<!-- Version 2 7/5/2016 -->\r\n"
		"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> \r\n"
		"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"> \r\n"
		"<head> \r\n"
		"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/> \r\n"
		"<style type=\"text/css\">"
		"\r\n"
		"#outer\r\n"
		"{\r\n"
		"width:662px;\r\n"
		"height:%dpx;\r\n"
		"position:absolute;\r\n"
		"top:100px;\r\n"
		"font-family: monospace;\r\n"
		"}\r\n"
		"#main\r\n"
		"{\r\n"
		"width:550px;\r\n"
		"height:%dpx;\r\n"
		"position:absolute;\r\n"
		"left:112px;\r\n"
		"border:2px solid;\r\n"
		"}\r\n"
		"#sidebar\r\n"
		"{\r\n"
		"position: absolute;\r\n"
		"width: 110px;\r\n"
		"top:105px;\r\n"
		"height: %dpx;\r\n"
		"border:2px solid;\r\n"
		"overflow: auto;\r\n"
		"}\r\n"
		"#sel\r\n"
		"{\r\n"
		"position: absolute;\r\n"
		"width: 110px;\r\n"
//		"height: 103px;\r\n"
		"border:2px solid;\r\n"
		"font-family: monospace;\r\n"
		"}\r\n"

		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"</style>\r\n"
		"\r\n"
		"<title>Edit Messages</title> \r\n"
		"<script type=\"text/javascript\"> \r\n"
		" \r\n"
		"var Details\r\n"
		"var Sel\r\n"
		"var Sidebar\r\n"
		"var fromleft;\r\n"
		"var Outer;\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{	\r\n"
		"resize();"
		"	Details = document.getElementById(\"main\"); \r\n"
		"	Details.innerHTML = \"waiting for data...\"; \r\n"
		"//	Details.style.left = fromleft + 150 + \"px\";\r\n"
		"	GetData(\"\");\r\n"
		"}\r\n"
		"function resize()\r\n"
		"{	\r\n"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"	x=w.innerWidth||e.clientWidth||g.clientWidth;	y=w.innerHeight||e.clientHeight||g.clientHeight;\r\n"
		"	fromleft = (x / 2) - 331;\r\n"
		"	if (fromleft < 0) {fromleft = 0;}\r\n"
		"	Outer = document.getElementById(\"outer\"); \r\n"
		"	Outer.style.left = fromleft + \"px\";\r\n"
		"	Sel = document.getElementById(\"sel\"); \r\n"
		"	var SelHeight = Sel.offsetHeight;\r\n"
		"	Sidebar = document.getElementById(\"sidebar\"); \r\n"
		"	Sidebar.style.top = SelHeight + \"px\";\r\n"
		"//	Details.style.left = fromleft + 150 + \"px\";\r\n"
		"}\r\n"

		"function ck(cell)\r\n"
		"{\r\n"
		"	var fn = \"MsgFwdUpdate?%s\";\r\n"
		"	post(fn, cell);\r\n"
		"}\r\n"
		"\r\n"
		"function save(form)\r\n"
		"{\r\n"
		"	var msg\r\n"
		"	msg = form.From.value + \"|\" + form.To.value+ \"|\" + form.BID.value+ \"|\" + form.EFROM.value + \"|\" + form.VIA.value+ \"|\" + form.Title.value+ \"|\" + form.Type.value + \"|\" + form.Status.value +\"|\"\r\n"
		"	var fn = \"MsgSave?%s\";\r\n"
		"	post(fn, msg);\r\n"
		"}\r\n"
		"\r\n"
		"function doit(param)\r\n"
		"{\r\n"
		"	var fn = \"MsgAction?%s\";\r\n"
		"	post(fn, param);\r\n"
		"}\r\n"
		"\r\n"
		"function dofilter(form)\r\n"
		"{\r\n"
		"	var val = form.FFrom.value + \"|\" + form.FTo.value + \"|\" + form.FVia.value+ \"|\" + form.FBid.value+ \"|\" \r\n"
		"	GetData(val);\r\n"
		"}\r\n"
		"\r\n"
		"function editmsg(url)\r\n"
		"{\r\n"
		"var param = \"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,titlebar=no,toobar=no,width=800,height=600\";\r\n"
		"window.open(url,\"_blank\", param);\r\n"
		"}\r\n"
		"\r\n"
		"\r\n"
		"function post(url, data)\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{if (request.readyState == 4){Details.innerHTML = request.responseText;}}\r\n"
		"	request.open(\"POST\", url, true);request.send(data);\r\n"
		"}\r\n"
		"function GetDetails(call)\r\n"
		"{\r\n"
		"	var fn = \"MsgDetails?%s\";\r\n"
		"	post(fn, call);\r\n"
		"}\r\n"
		"function GetData(filter)\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		" \r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{\r\n"
		"		if (request.readyState == 4)\r\n"
		"		{\r\n"
		"			var text = request.responseText;\r\n"
		"			var lines = text.split(\"|\");\r\n"
		"			var i = 0;\r\n"
		"			\r\n"
		"	 	    var infoArea = document.getElementById(\"sidebar\"); \r\n"
		"		    var strInfo = '<table>';\r\n"
		" 						\r\n"
		"			while(i < lines.length - 1)\r\n"
		"			{	\r\n"
		"				var clink = '<a href=javascript:GetDetails(\"' + lines[i] + '\")>' + lines[i] + '</a>';	\r\n"
		"				var tableRow = '<tr><td>' + clink + '</td></tr>';	 \r\n"
		"				strInfo += tableRow;			\r\n"
		"				i=i+1;\r\n"
		"			}\r\n"
		"			infoArea.innerHTML = strInfo + \"</table>\";\r\n"
		"			GetDetails(lines[0]);\r\n"
		"		}\r\n"
		"	}\r\n"
		"	request.open(\"POST\",\"MsgInfo.txt?%s\",true);										   \r\n"
		"	request.send(filter);\r\n"
		"}\r\n"
		" \r\n"
		"</script>\r\n"
		"</head>\r\n"
		"<body background=/background.jpg onload=\"initialize()\" onresize=\"resize()\">\r\n"
		"<h3 align=center>BPQ32 BBS %s</h3>\r\n"
		"<table align=\"center\" bgcolor=\"white\" border=\"1\" cellpadding=\"2\">\r\n"
		"  <tbody>\r\n"
		"    <tr>\r\n"
		"      <td><a href=\"/Mail/Status?%s\">Status</a></td>\r\n"
		"      <td><a href=\"/Mail/Conf?%s\">Configuration</a></td>\r\n"
		"      <td><a href=\"/Mail/Users?%s\">Users</a></td>\r\n"
		"      <td><a href=\"/Mail/Msgs?%s\">Messages</a></td>\r\n"
		"      <td><a href=\"/Mail/FWD?%s\">Forwarding</a></td>\r\n"
		"      <td><a href=\"/Mail/Wel?%s\">Welcome Msgs &amp; Prompts</a></td>\r\n"
		"      <td><a href=\"/Mail/HK?%s\">Housekeeping</a></td>\r\n"
		"      <td><a href=\"/Mail/WP?%s\">WP Update</a></td>\r\n"
		"<td><a href=/Webmail>WebMail</a></td>"
		"      <td><a href=\"/\">Node Menu</a></td>\r\n"
		"    </tr>\r\n"
		"  </tbody>\r\n"
		"</table>\r\n"
		"\r\n"
		"<div id=\"outer\">\r\n"
		" <div align=center style=\"font-family: monospace;\" id=\"sidebar\"></div>\r\n"
		" <div align=center style=\"font-family: monospace;\" id=\"main\"></div> \r\n"
		" <div style=\"font-family: monospace;\" id=\"sel\">\r\n"
		" <form style=\"font-family: monospace;\"><div style=\"text-align: center;\"><span\r\n"
		"style=\"font-family: monospace; font-weight: bold;\">Filter</span></div>\r\n"
		"From <input style=\"font-family: monospace;\" size=\"7\" name=\"FFrom\" value=\"\" onkeyup=dofilter(this.form)><br>\r\n"
		"To&nbsp;&nbsp; <input  style=\"font-family: monospace;\" size=\"7\" name=\"FTo\" value=\"\" onkeyup=dofilter(this.form)<br>\r\n"
		"Via&nbsp; <input  style=\"font-family: monospace;\" size=\"7\" name=\"FVia\" value=\"\" onkeyup=dofilter(this.form)><br>\r\n"
		"BID&nbsp; <input  style=\"font-family: monospace;\" size=\"7\" name=\"FBid\" value=\"\" onkeyup=dofilter(this.form)>\r\n"
		"</form>\r\n"
		"</div>\r\n"
		"</div> \r\n"
		"</span>\r\n"
		"\r\n";

	return _strdup(Msg);
}



char * UserDetailtxt()
{
	char Msg[] =
		"<!-- Version 4 10/10/2015 -->\r\n"
		"<form style=\"font-family: monospace;\" method=\"post\" action=\"/Mail/UserSave?%s\">\r\n"
		"<h3 align=center>Update User %s</h3>\r\n"
		" <div style=\"position:absolute; left:10px;\"> <table style=\"text-align: left; height: 156px;\" cellpadding=\"2\" cellspacing=\"0\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <td style=\"vertical-align: middle; width: 20px;\"><input %sname=\"BBS\" type=\"checkbox\"></td>\r\n"
		"        <td style=\"width: 250px;\">BBS</td>\r\n"
		"        <td style=\"width: 20px;\"><input %s name=\"PermitEmail\" type=\"checkbox\"></td>\r\n"
		"        <td style=\"width: 250px;\">Permit Email</td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td style=\"vertical-align: middle; width: 20px;\"><input %sname=\"PMS\" type=\"checkbox\"></td>\r\n"
		"        <td>PMS</td>\r\n"
		"        <td style=\"width: 20px;\"><input %sname=\"RMSExUser\" type=\"checkbox\"></td>\r\n"
		"        <td>RMS Express User</td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td style=\"vertical-align: middle; width: 20px;\"><input %sname=\"SYSOP\" type=\"checkbox\"></td>\r\n"
		"        <td>SYSOP</td>\r\n"
		"        <td style=\"width: 20px;\"><input %s name=\"PollRMS\" type=\"checkbox\"></td>\r\n"
		"        <td>Poll RMS</td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td style=\"vertical-align: middle; width: 20px;\"><input %sname=\"Expert\" type=\"checkbox\"></td>\r\n"
		"        <td>Expert</td>\r\n"
		"        <td colspan=\"2\" rowspan=\"1\">&nbsp;&nbsp;&nbsp;For SSID's&nbsp;\r\n"
		"<input style=\"width: 15px;\" name=\"SSID1\" value=\"%s\">\r\n"
		"<input style=\"width: 15px;\" name=\"SSID2\" value=\"%s\">\r\n"
		"<input style=\"width: 15px;\" name=\"SSID3\" value=\"%s\">\r\n"
		"<input style=\"width: 15px;\" name=\"SSID4\" value=\"%s\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td style=\"vertical-align: top; width: 19px;\"><input %sname=\"Excluded\" type=\"checkbox\"></td>\r\n"
		"        <td>Excluded</td>\r\n"
		"        <td style=\"width: 20px;\"><input %sname=\"Hold\" type=\"checkbox\"></td>\r\n"
		"        <td>Hold Messages</td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td style=\"vertical-align: top; width: 19px;\"><input %sname=\"SYSOPLM\" type=\"checkbox\"></td>\r\n"
		"        <td>Include SYSOP msgs in LM </td>\r\n"
		"        <td style=\"width: 20px;\"><input %sname=\"NOWINLINK\" type=\"checkbox\"></td>\r\n"
		"        <td>Don't add @winlink.org</td>\r\n"
		"        </td>\r\n"
		"        <td><br>\r\n"
		"        </td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"       <td style=\"width: 20px;\"><input %sname=\"ALLOWBULLS\" type=\"checkbox\"></td>\r\n"
		"       <td>Allow Sending Bulls</td>\r\n"
		"        </td>\r\n"
		"		<td style=\"width: 20px;\"><input %sname=\"NTSMPS\" type=\"checkbox\"></td>\r\n"
		"       <td>NTS MPS</td>\r\n"
		"     </tr>\r\n"
		"		<td style=\"width: 20px;\"><input %sname=\"RMSREDIR\" type=\"checkbox\"></td>\r\n"
		"       <td>Redirect to RMS</td>\r\n"
		"     </tr>\r\n"
		"     <tr><td><input %sname=APRSMFOR type=checkbox></td>"
		"       <td>Send APRS Mail For to SSID"
		"       <input style=\"width: 15px;\" name=APRSSSID value=%s></td>"
		"     </tr>\r\n"
		"\r\n"
		"	  </tbody>"
		"  </table>"
		"  <br>\r\n"
		"  <br>\r\n"
		"  <table style=\"text-align: left;\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <td>Connects In<br>\r\n"
		"        </td>\r\n"
		"        <td style=\"width: 60px;\">%d<br>\r\n"
		"        </td>\r\n"
		"        <td>Msgs in<br>\r\n"
		"        </td>\r\n"
		"        <td style=\"width: 50px;\">%d<br>\r\n"
		"        </td>\r\n"
		"        <td>Rejects In<br>\r\n"
		"        </td>\r\n"
		"        <td style=\"width: 50px;\">%d<br>\r\n"
		"        </td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Connects Out<br>\r\n"
		"        </td>\r\n"
		"        <td>%d<br>\r\n"
		"        </td>\r\n"
		"        <td>Msgs Out<br>\r\n"
		"        </td>\r\n"
		"        <td>%d<br>\r\n"
		"        </td>\r\n"
		"        <td>Rejects Out<br>\r\n"
		"        </td>\r\n"
		"        <td>%d<br>\r\n"
		"        </td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Bytes In <br>\r\n"
		"        </td>\r\n"
		"        <td>%d<br>\r\n"
		"        </td>\r\n"
		"        <td>Last Connect</td>\r\n"
		"        <td colspan=\"3\" rowspan=\"1\">%s</td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Bytes Out<br>\r\n"
		"        </td>\r\n"
		"        <td>%d</td>\r\n"
		"        <td><br>\r\n"
		"        </td>\r\n"
		"        <td><br>\r\n"
		"        </td>\r\n"
		"        <td style=\"text-align: center;\">Last Listed<br>\r\n"
		"        </td>\r\n"
		"        <td><input style=\"width: 40px;\" name=\"LastListed\" value=\"%d\"><br>\r\n"
		"        </td>\r\n"
		"      </tr>\r\n"
		"    </tbody>\r\n"
		"  </table>\r\n"
		"  <br>\r\n"
		"  <br>\r\n"
		"Name &nbsp;&nbsp;&nbsp; <input style=\"width:200px;\" name=\"Name\" value=\"%s\"><br>\r\n"
		"Password <input style=\"width:120px;\" name=\"Password\" value=\"%s\">&nbsp;\r\n"
		"CMS Pass <input name=\"CMSPass\" value=\"%s\">&nbsp;\r\n"
		"<br>\r\n"
		"QTH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input style=\"width:260px;\" name=\"QTH\" value=\"%s\"> ZIP <input style=\"width:80px;\" name=\"ZIP\" value=\"%s\"><br>\r\n"
		"Home BBS <input style=\"width:360px;\" name=\"HomeBBS\" value=\"%s\"><br>\r\n"
		"  <br>\r\n"
		"  <div align=\"center\"><input class='btn' onclick=save(this.form) value=Update type=button class='btn'>\r\n"
		"  <input class='btn' onclick=del(this.form) value=Delete type=button class='btn'>\r\n"
		"  <input class='btn' onclick=add(this.form) value=Add type=button class='btn'>\r\n"
		"   <input style=\"width:60px; text-transform:uppercase;\" name=\"NewCall\">\r\n"
		"  </div>\r\n"
		"  </div>\r\n"
		"</form>\r\n"
		"\r\n";

	return _strdup(Msg);
}


char * UserPagetxt()
{
	char Msg[] =
		"<!-- Version 4 10/10/2015 -->\r\n"
		"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> \r\n"
		"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"> \r\n"
		"<style type=\"text/css\">"
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"</style>"
		"<head> \r\n"
		"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\"/> \r\n"
		"<style type=\"text/css\"> \r\n"
		"\r\n"
		"#outer{width:610px;height:530px;position:absolute;}\r\n"
		"#main{width:515px;position:absolute;height:530px;left:95px;border:2px solid;}\r\n"
		"#sidebar{position: absolute;width:90px;height:530px;border:2px solid;overflow: auto;}\r\n"
		"\r\n"
		"</style>\r\n"
		"\r\n"
		"<title>Edit Users</title> \r\n"
		"<script type=\"text/javascript\"> \r\n"
		" \r\n"
		"var Details\r\n"
		"var Sidebar\r\n"
		"var fromleft;\r\n"
		"var Outer;\r\n"
		"var Key = \"%s\"\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{\r\n"
		"resize();"
		"	Details = document.getElementById(\"main\"); \r\n"
		"	Details.innerHTML = \"waiting for data...\"; \r\n"
		"	GetData(\"\");\r\n"
		"}\r\n"
		"\r\n"
		"function resize()\r\n"
		"{\r\n"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"	x=w.innerWidth||e.clientWidth||g.clientWidth;	y=w.innerHeight||e.clientHeight||g.clientHeight;\r\n"
		"	fromleft = (x / 2) - 300;\r\n"
		"	if (fromleft < 0) {fromleft = 0;}\r\n"
		"	Outer = document.getElementById(\"outer\"); \r\n"
		"	Outer.style.left = fromleft + \"px\";\r\n"
		"}\r\n"
		"\r\n"
		"function save(form)\r\n"
		"{\r\n"
		"	var msg\r\n"
		"	var fn = \"UserSave?\" + Key;\r\n"
		"	\r\n"
		"	msg = \r\n"
		"	form.BBS.checked + \"|\" +\r\n"
		"	form.PermitEmail.checked + \"|\" + \r\n"
		"	form.PMS.checked + \"|\" +\r\n"
		"	form.RMSExUser.checked + \"|\" +\r\n"
		"	form.SYSOP.checked + \"|\" +\r\n"
		"	form.PollRMS.checked + \"|\" +\r\n"
		"	form.Expert.checked + \"|\" +\r\n"
		"	form.SSID1.value + \"|\" +\r\n"
		"	form.SSID2.value + \"|\" +\r\n"
		"	form.SSID3.value + \"|\" +\r\n"
		"	form.SSID4.value + \"|\" +\r\n"
		"	form.Excluded.checked + \"|\" +\r\n"
		"	form.Hold.checked + \"|\" +\r\n"
		"	form.SYSOPLM.checked + \"|\" +\r\n"
		"	form.NOWINLINK.checked + \"|\" +\r\n"
		"	form.ALLOWBULLS.checked + \"|\" +\r\n"
		"	form.NTSMPS.checked + \"|\" +\r\n"
		"	form.RMSREDIR.checked + \"|\" +\r\n"
		"	form.APRSMFOR.checked + \"|\" +\r\n"
		"	form.APRSSSID.value + \"|\" +\r\n"
		"	form.LastListed.value + \"|\" +\r\n"
		"	form.Name.value + \"|\" +\r\n"
		"	form.Password.value + \"|\"  +\r\n"
		"	form.CMSPass.value + \"|\"  +\r\n"
		"	form.QTH.value + \"|\" + \r\n"
		"	form.ZIP.value + \"|\" + \r\n"
		"	form.HomeBBS.value + \"|\"\r\n"
		"	post(fn, msg);\r\n"
		"}\r\n"
		"\r\n"
		"function del(form)\r\n"
		"{\r\n"
		"	var fn = \"UserSave?\" + Key;\r\n"
		"	xpost(fn, \"Delete\", \"\");\r\n"
		"}\r\n"
		"\r\n"
		"function add(form)\r\n"
		"{\r\n"
		"	var fn = \"UserSave?\" + Key;\r\n"
		"	xpost(fn, \"Add=\" + form.NewCall.value, form.NewCall.value);\r\n"
		"}\r\n"
		"\r\n"
		"function post(url, data)\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{if (request.readyState == 4){Details.innerHTML = request.responseText;}}\r\n"
		"	request.open(\"POST\", url, true);request.send(data);\r\n"
		"}\r\n"
		"\r\n"
		"function xpost(url, data, call)\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{if (request.readyState == 4){\r\n"
		"	{\r\n"
		"			var text = request.responseText;\r\n"
		"			var lines = text.split(\"|\");\r\n"
		"			var i = 0;\r\n"
		"			\r\n"
		"	 	    var infoArea = document.getElementById(\"sidebar\"); \r\n"
		"		    var strInfo = '<table>';\r\n"
		" 						\r\n"
		"			while(i < lines.length - 1)\r\n"
		"			{	\r\n"
		"				var clink = '<a href=javascript:GetDetails(\"' + lines[i] + '\")>' + lines[i] + '</a>';	\r\n"
		"				var tableRow = '<tr><td>' + clink + '</td></tr>';\r\n"
		"				strInfo += tableRow;			\r\n"
		"				i=i+1;\r\n"
		"			}\r\n"
		"			infoArea.innerHTML = strInfo + \"</table>\";\r\n"
		"			\r\n"
		"			if (call == \"\")\r\n"
		"			{\r\n"
		"				GetDetails(lines[0]);\r\n"
		"			}\r\n"
		"			else\r\n"
		"			{\r\n"
		"				GetDetails(call);\r\n"
		"			}\r\n"
		"	}\r\n"
		"	\r\n"
		"	\r\n"
		"	}}\r\n"
		"	request.open(\"POST\", url, true);request.send(data);\r\n"
		"}\r\n"
		"\r\n"
		"\r\n"
		"function GetDetails(call)\r\n"
		"{\r\n"
		"	var fn = \"UserDetails?\" + Key;\r\n"
		"	post(fn, call);\r\n"
		"}\r\n"
		"function GetData()\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		" \r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{\r\n"
		"		if (request.readyState == 4)\r\n"
		"		{\r\n"
		"			var text = request.responseText;\r\n"
		"			var lines = text.split(\"|\");\r\n"
		"			var i = 0;\r\n"
		"			\r\n"
		"	 	    var infoArea = document.getElementById(\"sidebar\"); \r\n"
		"		    var strInfo = '<table>';\r\n"
		" 						\r\n"
		"			while(i < lines.length - 1)\r\n"
		"			{	\r\n"
		"				var clink = '<a href=javascript:GetDetails(\"' + lines[i] + '\")>' + lines[i] + '</a>';	\r\n"
		"				var tableRow = '<tr><td>' + clink + '</td></tr>';	 \r\n"
		"				strInfo += tableRow;			\r\n"
		"				i=i+1;\r\n"
		"			}\r\n"
		"			infoArea.innerHTML = strInfo + \"</table>\";\r\n"
		"			GetDetails(lines[0]);\r\n"
		"		}\r\n"
		"	}\r\n"
		"	request.open(\"POST\",\"UserList.txt?%s\",true);										   \r\n"
		"	request.send();\r\n"
		"}\r\n"
		" \r\n"
		"</script>\r\n"
		"</head>\r\n"
		"<body background=/background.jpg onload=\"initialize()\" onresize=\"resize()\">\r\n"
		"<h3 align=center>BPQ32 BBS %s</h3>\r\n"
		"<table align=center border=1 cellpadding=2 bgcolor=white><tr>\r\n"
		"<td><a href=/Mail/Status?%s>Status</a></td>\r\n"
		"<td><a href=/Mail/Conf?%s>Configuration</a></td>\r\n"
		"<td><a href=/Mail/Users?%s>Users</a></td>\r\n"
		"<td><a href=/Mail/Msgs?%s>Messages</a></td>\r\n"
		"<td><a href=/Mail/FWD?%s>Forwarding</a></td>\r\n"
		"<td><a href=/Mail/Wel?%s>Welcome Msgs & Prompts</a></td>\r\n"
		"<td><a href=/Mail/HK?%s>Housekeeping</a></td>\r\n"
		"<td><a href=/Mail/WP?%s>WP Update</a></td>\r\n"
		"<td><a href=/Webmail>WebMail</a></td>"
		"<td><a href=/>Node Menu</a></td></tr></table>\r\n"
		"<br>\r\n"
		"<div id=\"outer\">\r\n"
		" <div id=\"sidebar\"></div>\r\n"
		" <div id=\"main\"></div> \r\n"
		"</div> \r\n"
		"\r\n"
		"\r\n";

	return _strdup(Msg);
}



char * Housekeepingtxt()
{
	char Msg[] =
		"<!-- Version 2 2/1/2016 -->\r\n"
		"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n"
		"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"><head>\r\n"
		"  \r\n"
		"<meta content=\"text/html; charset=ISO-8859-1\" http-equiv=\"content-type\" />\r\n"
		"<title>Housekeeping</title>\r\n"
		"<style type=\"text/css\">"
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"</style>"
		"<script type=\"text/javascript\"> \r\n"
		" \r\n"
		"var Main\r\n"
		"var fromleft;\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{	\r\n"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"	x=w.innerWidth||e.clientWidth||g.clientWidth;\r\n"
		"	fromleft = (x / 2) - 440;\r\n"
		"	if (fromleft < 0) {fromleft = 0;}\r\n"
		"	Main = document.getElementById(\"main\"); \r\n"
		"	Main.style.left = fromleft + \"px\";\r\n"
		"\r\n"
		"//	Main.style.width = (x - fromleft) + \"px\";\r\n"
		"}\r\n"
		"</script>\r\n"
		"</head>\r\n"
		"<body background=/background.jpg onload=\"initialize()\" onresize=\"initialize()\">\r\n"
		"<h3 align=center>BPQ32 BBS %s</h3>\r\n"
		"<span align=center><table align=center border=1 cellpadding=2 bgcolor=white><tr>\r\n"
		"<td><a href=/Mail/Status?%s>Status</a></td>\r\n"
		"<td><a href=/Mail/Conf?%s>Configuration</a></td>\r\n"
		"<td><a href=/Mail/Users?%s>Users</a></td>\r\n"
		"<td><a href=/Mail/Msgs?%s>Messages</a></td>\r\n"
		"<td><a href=/Mail/FWD?%s>Forwarding</a></td>\r\n"
		"<td><a href=/Mail/Wel?%s>Welcome Msgs & Prompts</a></td>\r\n"
		"<td><a href=/Mail/HK?%s>Housekeeping</a></td>\r\n"
		"<td><a href=/Mail/WP?%s>WP Update</a></td>\r\n"
		"<td><a href=/Webmail>WebMail</a></td>"
		"<td><a href=/>Node Menu</a></td></tr></table>\r\n"
		"<br>\r\n"
		"<div style=\"text-align: center;\"><font size=\"+1\"><span style=\"font-family: monospace; font-weight: bold;\">Housekeeping</span></font></div>\r\n"
		"\r\n"
		"<form style=\"font-family: monospace; \" method=\"post\" action=\"/Mail/HK?%s\" name=\"HK\">\r\n"
		"  <div id=\"main\" style=\"position: relative; top:10px; height:550px; width:940px; overflow: auto\">\r\n"
		"  <div style=\"border: 2px solid ; width: 270px; height: 510px; \"><div style=\"text-align: center;\"><font size=\"+1\"><span style=\"font-family: monospace; font-weight: bold;\">Parameters</span></font></div><br>\r\n"
		"<br>\r\n"
		"  <table style=\"text-align: left; width: 264px; height: 116px;\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <td>Maintenance Time (UTC)</td>\r\n"
		"        <td><input size=\"3\" name=\"MTTime\" value=\"%04d\" /></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Maintenance Interval (Hrs)</td>\r\n"
		"        <td><input size=\"3\" name=\"MTInt\" value=\"%d\" /></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Max Message Number </td>\r\n"
		"        <td><input size=\"3\" name=\"MAXMSG\" value=\"%d\" /></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>BID Lifetime (Days)</td>\r\n"
		"        <td><input size=\"3\" name=\"BIDLife\" value=\"%d\"> </td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Log File Lifetime (days)</td>\r\n"
		"        <td><input size=\"3\" name=\"LogLife\" value=\"%d\"></td>\r\n"
		"      </tr><tr>\r\n"
		"        <td>Delete Inactive Users (days)</td>\r\n"
		"        <td><input size=\"3\" name=\"UserLife\" value=\"%d\"></td>\r\n"
		"      </tr>\r\n"
		"    </tbody>\r\n"
		"  </table>\r\n"
		"  <br />\r\n"
		"Delete Messages and logs<br>\r\n"
		"to recycle bin <input %sname=\"Deltobin\" value=\"Deltobin\" type=\"checkbox\"><br>\r\n"
		"  <br />\r\n"
		"Send Non-delivery Notifications<br>\r\n"
		"for P and T messages <input %sname=\"SendND\" value=\"SendND\" type=\"checkbox\" /><br>\r\n"
		"  <br />\r\n"
		"Suppress Mailing of<br>\r\n"
		"Housekeeping Result <input %sname=\"NoMail\" value=\"Yes\" type=\"checkbox\"><br><br>\r\n"
		"Generate Traffic Report<input %sname=\"GenTraffic\" value=\"Yes\" type=\"checkbox\"><br><br>\r\n"
		"<div style=\"text-align: center;\"><input class='btn'  name=RunNow value=\"Run Housekeeping\" type=submit class='btn'></div>\r\n"
		"  </div>\r\n"
		"  <div style=\"border: 2px solid ; overflow: auto; position: absolute; left: 285px; width: 585px; height: 511px; top: 0px;\"><div style=\"text-align: center;\"><font size=\"+1\"><span\r\n"
		"style=\"font-family: monospace; font-weight: bold;\">Lifetimes (Days)</span></font><br>\r\n"
		"</div>\r\n"
		"\r\n"
		"  <div style=\"border: 2px solid ; overflow: auto; position: absolute; top: 20px; left: 10px; width: 180px; height: 150px;\"><div style=\"text-align: center;\"><span\r\n"
		"style=\"font-family: monospace; font-weight: bold;\">Personals</span>\r\n"
		"</div>\r\n"
		"  <table style=\"text-align: left; width: 177px;\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <td>Read</td>\r\n"
		"        <td><input size=\"2\" name=\"PR\" value=\"%.2f\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Unread </td>\r\n"
		"        <td><input size=\"2\" name=\"PUR\" value=\"%.2f\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Forwarded </td>\r\n"
		"        <td><input size=\"2\" name=\"PF\" value=\"%.2f\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Unforwarded </td>\r\n"
		"        <td><input size=\"2\" name=\"PUF\" value=\"%.2f\"></td>\r\n"
		"      </tr>\r\n"
		"    </tbody>\r\n"
		"  </table>\r\n"
		"  </div>\r\n"
		"  <div style=\"border: 2px solid ; overflow: auto; position: absolute; top: 20px; left: 200px; width: 180px; height: 150px;\"><div style=\"text-align: center;\"><span\r\n"
		"style=\"font-family: monospace; font-weight: bold;\">Bulletins</span>\r\n"
		"</div>\r\n"
		"  <table style=\"text-align: left; width: 177px;\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <td>Forwarded</td>\r\n"
		"        <td><input size=\"2\" name=\"BF\" value=\"%d\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Unforwarded</td>\r\n"
		"        <td><input size=\"2\" name=\"BUF\" value=\"%d\"></td>\r\n"
		"      </tr>\r\n"
		"    </tbody>\r\n"
		"  </table>\r\n"
		"  </div>\r\n"
		"  \r\n"
		"    <div style=\"border: 2px solid ; overflow: auto; position: absolute; top: 20px; left: 390px; width: 180px; height: 150px;\"><div style=\"text-align: center;\"><span\r\n"
		"style=\"font-family: monospace; font-weight: bold;\">NTS</span>\r\n"
		"</div>\r\n"
		"  <table style=\"text-align: left; width: 177px;\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <td>Delivered</td>\r\n"
		"        <td><input size=\"2\" name=\"NTSD\" value=\"%d\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Forwarded</td>\r\n"
		"        <td><input size=\"2\" name=\"NTSF\" value=\"%d\"></td>\r\n"
		"      </tr>\r\n"
		"      <tr>\r\n"
		"        <td>Unforwarded</td>\r\n"
		"        <td><input size=\"2\" name=\"NTSU\" value=\"%d\"></td>\r\n"
		"      </tr>\r\n"
		"    </tbody>\r\n"
		"  </table>\r\n"
		"  </div>\r\n"
		"\r\n"
		"  \r\n"
		"  \r\n"
		"  \r\n"
		"  <div style=\"border: 0px solid ; overflow: auto; position: absolute; top: 180px; left: 10px; width: 550px; height: 310px;\">The following boxes allow you to specify different\r\n"
		"values for different Bulletin origins and destinations. Normally these apply to Sent Messages. To apply to unsent, check box below.<br><br>\r\n"
		"Specify Call, Lifetime....eg ALL, 10<br><br>\r\n"
		"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n"
		"From&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n"
		"&nbsp;&nbsp;&nbsp;\r\n"
		"To&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\r\n"
		"At<br />\r\n"
		"  <textarea cols=\"12\" rows=\"8\" name=\"From\">%s</textarea> <textarea cols=\"12\" rows=\"8\" name=\"To\">%s</textarea> <textarea cols=\"12\" rows=\"8\" name=\"At\">%s</textarea> <br />\r\n"
		"  <br />\r\n"
		"&nbsp;Apply Overrides to unsent Bulls <input name=\"OvUnsent\" %svalue=\"OvUnsent\" type=\"checkbox\"><br>\r\n"
		"  </div>\r\n"
		"  </div>\r\n"
		"  <div style=\"position: absolute;left: 370px;top: 520px;\"><input class='btn' name=Save value=Save type=submit class='btn'> <input name=Cancel value=Cancel type=submit class='btn'></div>\r\n"
		"\r\n"
		"  </div>\r\n"
		"</form>\r\n"
		"<br>\r\n";

	return _strdup(Msg);
}

char * WPtxt()
{
	char Msg[] =
		"<!-- Version 1 13/3/2014 -->\r\n"
		"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n"
		"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"><head>\r\n"
		"<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\r\n"
		"<style type=\"text/css\"> \r\n"
		"\r\n"
		"#main {width:500px;height:480px;position:absolute;left:105px;font-family: monospace;border:2px solid;}\r\n"
		"#sidebar{position: absolute;left: 0px;width: 97px;height: 480px;font-family: monospace;border:2px solid;overflow: auto;}\r\n"
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"</style>\r\n"
		"\r\n"
		"<title>Edit WP</title>\r\n"
		"\r\n"
		"<script type=\"text/javascript\"> \r\n"
		" \r\n"
		"var Details\r\n"
		"var Sidebar\r\n"
		"var fromleft;\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{	\r\n"
		"	var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"	x=w.innerWidth||e.clientWidth||g.clientWidth;	y=w.innerHeight||e.clientHeight||g.clientHeight;\r\n"
		"	fromleft = (x / 2) - 300;\r\n"
		"	Sidebar = document.getElementById(\"sidebar\"); \r\n"
		"	Sidebar.style.left = fromleft + \"px\";\r\n"
		"	Details = document.getElementById(\"main\"); \r\n"
		"	Details.innerHTML = \"waiting for data...\"; \r\n"
		"	Details.style.left = fromleft + 105 + \"px\";\r\n"
		"	GetData();\r\n"
		"}\r\n"
		"\r\n"
		"function save(form)\r\n"
		"{\r\n"
		"	var msg\r\n"
		"	msg = form.Name.value + \"|\" + form.Home1.value+ \"|\" + form.Home2.value+ \"|\" + form.QTH1.value+ \"|\" + form.QTH2.value+ \"|\" + form.ZIP1.value + \"|\" + form.ZIP2.value +\"|\"\r\n"
		"	var fn = \"WPSave?%s\";\r\n"
		"	post(fn, msg);\r\n"
		"}\r\n"
		"\r\n"
		"function del(form)\r\n"
		"{\r\n"
		"	var msg\r\n"
		"	msg = form.Name.value + \"|\" + form.Home1.value+ \"|\" + form.Home2.value+ \"|\" + form.QTH1.value+ \"|\" + form.QTH2.value+ \"|\" + form.ZIP1.value + \"|\" + form.ZIP2.value +\"|\"\r\n"
		"	var fn = \"WPSave?%s\";\r\n"
		"	post(fn, \"Delete\");\r\n"
		"}\r\n"
		"\r\n"
		"function post(url, data)\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{if (request.readyState == 4){Details.innerHTML = request.responseText;}}\r\n"
		"	request.open(\"POST\", url, true);request.send(data);\r\n"
		"}\r\n"
		"function GetDetails(call)\r\n"
		"{\r\n"
		"	var fn = \"WPDetails?%s\";\r\n"
		"	post(fn, call);\r\n"
		"}\r\n"
		"function GetData()\r\n"
		"{\r\n"
		"	if (window.XMLHttpRequest){request=new XMLHttpRequest();}else{request=new ActiveXObject(\"Microsoft.XMLHTTP\");}\r\n"
		" \r\n"
		"	request.onreadystatechange = function()\r\n"
		"	{\r\n"
		"		if (request.readyState == 4)\r\n"
		"		{\r\n"
		"			var text = request.responseText;\r\n"
		"			var lines = text.split(\"|\");\r\n"
		"			var i = 0;\r\n"
		"			\r\n"
		"	 	    var infoArea = document.getElementById(\"sidebar\"); \r\n"
		"		    var strInfo = '<table>';\r\n"
		" 						\r\n"
		"			while(i < lines.length - 1)\r\n"
		"			{	\r\n"
		"				var clink = '<a href=javascript:GetDetails(\"' + lines[i] + '\")>' + lines[i] + '</a>';	\r\n"
		"				var tableRow = '<tr><td>' + clink + '</td></tr>';	 \r\n"
		"				strInfo += tableRow;			\r\n"
		"				i=i+1;\r\n"
		"			}\r\n"
		"			infoArea.innerHTML = strInfo + \"</table>\";\r\n"
		"			GetDetails(lines[0]);\r\n"
		"		}\r\n"
		"	}\r\n"
		"	request.open(\"GET\",\"WPInfo.txt?%s\",true);										   \r\n"
		"	request.send();\r\n"
		"}\r\n"
		" \r\n"
		"</script>\r\n"
		"</head><body background=/background.jpg onload=\"initialize()\">\r\n"
		"<h3 align=\"center\">BPQ32 BBS %s</h3>\r\n"
		"\r\n"
		"<span align=\"center\">\r\n"
		"<table align=\"center\" bgcolor=\"white\" border=\"1\" cellpadding=\"2\">\r\n"
		"  <tbody>\r\n"
		"    <tr>\r\n"
		"      <td><a href=\"/Mail/Status?%s\">Status</a></td>\r\n"
		"      <td><a href=\"/Mail/Conf?%s\">Configuration</a></td>\r\n"
		"      <td><a href=\"/Mail/Users?%s\">Users</a></td>\r\n"
		"      <td><a href=\"/Mail/Msgs?%s\">Messages</a></td>\r\n"
		"      <td><a href=\"/Mail/FWD?%s\">Forwarding</a></td>\r\n"
		"      <td><a href=\"/Mail/Wel?%s\">Welcome Msgs &amp; Prompts</a></td>\r\n"
		"	<td><a href=\"/Mail/HK?%s\">Housekeeping</a></td>\r\n"
		"	<td><a href=\"/Mail/WP?%s\">WP Update</a></td>\r\n"
		"<td><a href=/Webmail>WebMail</a></td>"
		"      <td><a href=\"/\">Node Menu</a></td>\r\n"
		"    </tr>\r\n"
		"  </tbody>\r\n"
		"</table>\r\n"
		"<br>\r\n"
		"<div style=\"text-align: center;\"><font size=\"+1\"><span style=\"font-family: monospace; font-weight: bold;\">White Pages</span></font></div>\r\n"
		"<br>\r\n"
		"<div style=\"font-family: monospace;\" id=\"sidebar\" align=\"center\"> </div>\r\n"
		"<div style=\"font-family: monospace;\" id=\"main\" align=\"center\"> </div>\r\n"
		"</span>\r\n"
		"</body></html>\r\n";

	return _strdup(Msg);
}


char * ChatConfigtxt()
{
	char Msg[] =
		"<!-- Version 2 1/3/2016 -->\r\n"
		"<html>\r\n"
		"<style type=\"text/css\"> "
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"</style>"
		"<head>\r\n"
		"<title>Chat Configuration</title>\r\n"
		"<script type=\"text/javascript\"> var Main\r\n"
		"var fromleft;\r\n"
		"var Pos;\r\n"
		"var Poptext;\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{ var\r\n"
		"w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		"x=w.innerWidth||e.clientWidth||g.clientWidth; fromleft = (x / 2) - 310;\r\n"
		"if (fromleft < 0) {fromleft = 0;}\r\n"
		"Main = document.getElementById(\"main\");\r\n"
		"Main.style.left = fromleft + \"px\";\r\n"
		"Pos = document.getElementById(\"pos\");\r\n"
		"Poptext = document.getElementById(\"poptext\");\r\n"
		"\r\n"
		"\r\n"
		"}\r\n"
		"function CheckLen()\r\n"
		"{\r\n"
		"var len = Pos.value.length + Poptext.value.length;\r\n"
		"if (len > 245)\r\n"
		"	{alert(\"Combinded length of Location and Popup Text must not exceed 245. Now \" + len);}\r\n"
		"}\r\n"
		" </script>\r\n"
		"<title></title>\r\n"
		"<title>ChatP</title>\r\n"
		"</head>\r\n"
		"<body style=\"background-image: url(/background.jpg);\"\r\n"
		"onload=\"initialize()\" onresize=\"initialize()\">\r\n"
		"<h3 align=\"center\">BPQ32 Chat Node %s</h3>\r\n"
		"<table align=\"center\" bgcolor=\"white\" border=\"1\" cellpadding=\"2\">\r\n"
		"<tr>\r\n"
		"<td><a href=\"/Chat/ChatStatus?%s\">Status</a></td>\r\n"
		"<td><a href=\"/Chat/ChatConf?%s\">Configuration</a></td>\r\n"
		"<td><a href=\"/\">Node Menu</a></td>\r\n"
		"</tr>\r\n"
		"</table>\r\n"
		"<br>\r\n"
		"<div style=\"text-align: center;\"><font size=\"+1\"><span\r\n"
		"style=\"font-family: monospace; font-weight: bold;\">Chat Configuration</span></font></div>\r\n"
		"<div id=\"main\"\r\n"
		"style=\"align: center; border: 2px solid ; overflow: auto; text-align: center; position: relative; top: 10px; height: 650px; width: 700px; left: 96.5px;\">\r\n"
		"<form border=\"1\" style=\"font-family: monospace;\" method=\"post\"\r\n"
		"action=\"/Chat/ChatConfig?%s\">\r\n"
		"<h3>&nbsp;Chat Server  Params<span style=\"font-family: monospace;\"></span></h3>\r\n"
		"<span style=\"font-family: monospace;\"></span>Chat APPL No&nbsp;&nbsp;\r\n"
		"<input value=\"%d\" size=\"3\" name=\"ApplNum\"><br>\r\n"
		"<span style=\"font-family: monospace;\"></span>Streams &nbsp; &nbsp;\r\n"
		"&nbsp;&nbsp; <input value=\"%d\" size=\"3\" name=\"Streams\"><br>\r\n"
		"&nbsp; <br>\r\n"
		"<input %sname=\"Events\" type=\"checkbox\"> Enable Event Reporting<br><br>\r\n"

		"<div style=\"text-align: left; width: 680px; margin: auto;\">The Nodes to link to box defines which other Chat Nodes should be connected to, or from which "
		"connections may be accepted. The format is ALIAS:CALL, eg BPQCHT:G8BPQ-4. If the node is not directly "
		"connectable (ie is not in your NODES table) you can add a connect script. This consists of a series of commands "
		"separared by |, eg NOTCHT:G8BPQ-4|C 3 GM8BPQ-9|CHAT"

		"<br><br>The Callsign of the Chat Node is not defined here - it is obtained from the bpq32.cfg APPLICATION line corresponding to the Chat Appl Number.<br>\r\n"
		"<br></div>\n"
		"Nodes to link to<br>"
		"&nbsp;<textarea cols=\"70\" rows=\"5\" name=\"nodes\">%s</textarea><br>\r\n"
		"<span style=\"font-family: monospace;\"></span>Node to Node Link PACLEN \r\n"
		"&nbsp;&nbsp; <input value=\"%d\" size=\"3\" name=\"Paclen\"><br><br>\r\n"
		"&nbsp;Map Position <input onchange=CheckLen() maxlength=\"80\" value=\"%s\" size=\"20\" name=\"Posn\" id=pos> <br>\r\n"
		"<br>\r\n"
		"&nbsp;Popup Type &nbsp;&nbsp; Hover <input %s name=\"PopType\" value=\"Hover\"\r\n"
		"type=\"radio\">\r\n"
		"Click <input %s name=\"PopType\" value=\"Click\" type=\"radio\"><br>\r\n"
		"<br>\r\n"
		"Map Popup Text<br>\r\n"
		"&nbsp;<input onchange=CheckLen() maxlength=\"250\" value=\"%s\" size=\"90\" name=\"MapText\" id=poptext>\r\n"
		"<br><br>Welcome Message<br>\r\n"
		"<textarea cols=\"80\" rows=\"5\" name=\"welcome\">%s</textarea><br>\r\n"
		"<br>\r\n"
		"\r\n"
		"<div style=\"position: absolute; left: 150px; top: 620px;\">\r\n"
		"<input name=\"Save\" value=\"Save\" type=submit class='btn'> \r\n"
		"<input name=\"UpdateMap\" value=\"Update Map\" type=submit class='btn'> \r\n"
		"<input name=\"Restart\" value=\"Restart Links\" type=submit class='btn'> \r\n"
		"<input name=\"Cancel\" value=\"Cancel\"\r\n"
		"type=submit class='btn'></div>\r\n"
		"</form>\r\n"
		"</div>\r\n";

	return _strdup(Msg);
}


char * ChatStatustxt()
{
	char Msg[] =
		"<!-- Version 1 13/3/2014 -->\r\n"
		"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n"
		"<style type=\"text/css\">"
		"input.btn:active {background:black;color:white;} "
		"submit.btn:active {background:black;color:white;} "
		"</style>"
		"<html><head>\r\n"
		"<style type=\"text/css\"> \r\n"
		"#outer {width:720px;height:700px;position:absolute;border:0px solid;font-family: monospace;}\r\n"
		"#streams {width:360px;position:absolute;height:300px;left:2px;border:2px solid;overflow: auto}\r\n"
		"#users {position: absolute;top:307px;left:2px;width:710px;height:350px;border:2px solid;overflow: auto;}\r\n"
		"#links {position: absolute;left:370px;width:341px;height:300px;border:2px solid;overflow: auto;}\r\n"
		"</style>\r\n"
		"<title>%s's Chat Server</title>\r\n"
		"  \r\n"
		"<script type=\"text/javascript\">\r\n"
		"\r\n"
		"var Outer;\r\n"
		"var Selected;\r\n"
		"var Inpval;\r\n"
		"var SelectedStream = 0;\r\n"
		"\r\n"
		"function initialize()\r\n"
		"{\r\n"
		" var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0];\r\n"
		" x=w.innerWidth||e.clientWidth||g.clientWidth;\r\n"
		" y=w.innerHeight||e.clientHeight||g.clientHeight;\r\n"
		" fromleft = (x / 2) - 360;\r\n"
		"\r\n"
		" if (fromleft < 0) {fromleft = 0;}\r\n"
		" Outer = document.getElementById(\"outer\");\r\n"
		" Outer.style.left = fromleft + \"px\";\r\n"
		" Inpval = document.getElementById(\"inpval\");\r\n"
		"}\r\n"
		" \r\n"
		"function SelectRow(newRow)\r\n"
		"{\r\n"
		" var cell=document.getElementById(\"cell_\" + newRow);\r\n"
		" var Last = Selected;\r\n"
		" Selected = cell;\r\n"
		" SelectedStream = newRow\r\n"
		" cell.style.background=\"#AAF\";\r\n"
		" if (Last)\r\n"
		"  {Last.style.background=\"#FFF\"};\r\n"
		" if (cell == Last)\r\n"
		" {\r\n"
		"  SelectedStream = 0;\r\n"
		" }\r\n"
		"  Inpval.value = SelectedStream;\r\n"
		"}\r\n"
		"\r\n"
		"function condRefresh()\r\n"
		"{\r\n"
		"	if (SelectedStream == 0)\r\n"
		"		{location.reload(true);}\r\n"
		"}\r\n"
		"\r\n"
		"window.setInterval(condRefresh, 10000);\r\n"
		"\r\n"
		"</script>\r\n"
		"</head><body onload=\"initialize()\" onresize=\"initialize()\" style=\"background-image: url(/background.jpg);\">\r\n"
		"<h3 align=\"center\">BPQ32 Chat Server %s</h3>\r\n"
		"\r\n"
		"<table align=\"center\" bgcolor=\"white\" border=\"1\" cellpadding=\"2\">\r\n"
		"\r\n"
		"  <tbody>\r\n"
		"    <tr>\r\n"
		"      <td><a href=\"/Chat/ChatStatus?%s\">Status</a></td>\r\n"
		"      <td><a href=\"/Chat/ChatConf?%s\">Configuration</a></td>\r\n"
		"      <td><a href=\"/\">Node Menu</a></td>\r\n"
		"    </tr>\r\n"
		"  </tbody>\r\n"
		"</table>\r\n"
		"\r\n"
		"<br>\r\n"
		"\r\n"
		"<div style=\"left: 160px;\" id=\"outer\">\r\n"
		"<div id=\"streams\">\r\n"
		"<form style=\"font-family: monospace; text-align: center;\" method=\"post\" action=\"/Chat/ChatDisSession?%s\">\r\n"
		"  <table style=\"font-family: monospace; background-color: white; text-align: left; margin-left: auto; margin-right: auto;\" tabindex=\"1\" border=\"1\" cellpadding=\"2\">\r\n"
		"    <tbody>\r\n"
		"      <tr>\r\n"
		"        <th style=\"width: 120px;\">User</th>\r\n"
		"        <th style=\"width: 75px;\">Callsign</th>\r\n"
		"        <th>Stream</th>\r\n"
		"        <th style=\"width: 80px;\">Topic</th>\r\n"
		"        <th>Queue</th>\r\n"
		"      </tr>\r\n"
		"%s\r\n"
		"    </tbody>\r\n"
		"  </table>\r\n"
		" <input type=\"hidden\" name=Stream value=99 id=inpval>\r\n"
		"<input align = center value=Disconnect type=submit class='btn'> \r\n"
		"<br>\r\n"
		"  </form>\r\n"
		"</div>\r\n"
		"<div id=\"users\">\r\n"
		"<table style=\"font-family: monospace; background-color: white; text-align: left; margin-left: auto; margin-right: auto;\" tabindex=\"1\" border=\"1\" cellpadding=\"2\">\r\n"
		"  <tbody>\r\n"
		"    <tr>\r\n"
		"      <th style=\"width: 75px;\">Callsign</th>\r\n"
		"      <th style=\"width: 75px;\">Node</th>\r\n"
		"      <th style=\"width: 80px;\">Name</th>\r\n"
		"      <th style=\"width: 80px;\">Topic</th>\r\n"
		"      <th>Idle</th>\r\n"
		"      <th style=\"width: 320px;\">QTH</th>\r\n"
		"    </tr>\r\n"
		"%s\r\n"
		"  </tbody>\r\n"
		"</table>\r\n"
		"</div>\r\n"
		"<div id=\"links\">\r\n"
		"<table style=\"font-family: monospace; background-color: white; text-align: left; tabindex=\"1\" border=\"1\" cellpadding=\"2\">\r\n"
		"  <tbody>\r\n"
		"    <tr>\r\n"
		"      <th style=\"width: 80px;\">Callsign</th>\r\n"
		"      <th style=\"width: 110px;\">State</th>\r\n"
		"      <th style=\"width: 75px;\">Nodes</th>\r\n"
		"      <th>Users</th>\r\n"
		"    </tr>\r\n"
		"%s\r\n"
		"  </tbody>\r\n"
		"</table>\r\n"
		"</div>\r\n"
		"</div>\r\n";

	return _strdup(Msg);
}
