diff --git a/web/root/index.ssjs b/web/root/index.ssjs
index 1f3d1c120ffd8d7404db7717d414d90f6ef08b7e..0511b50ce3d511ff41e203d6a2567174a841f79b 100644
--- a/web/root/index.ssjs
+++ b/web/root/index.ssjs
@@ -1,4 +1,4 @@
-/* $Id$ */
+/* $Id: */
 
 load("../web/lib/template.ssjs");
 
@@ -8,11 +8,14 @@ http_reply.header.pragma='no-cache';
 http_reply.header.expires='0';
 http_reply.header['cache-control']='must-revalidate';
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
-load("../web/lib/leftnav_html.ssjs");
+if(do_header)
+    write_template("header.inc");
+if(do_topnav)        
+    load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)        
+    load("../web/lib/leftnav_html.ssjs");
 
-/* Main Page Stats */
+/* Main Page Stats - might move to global_defs.ssjs */
 
     total=time()-system.uptime;
     days   = Math.floor(total/(24*60*60));
@@ -44,31 +47,6 @@ load("../web/lib/leftnav_html.ssjs");
     var port = host.indexOf(':');
     if(port>=0)
         host=host.slice(0,port);
-    
-    if(telnet_port=="23")
-      telnet_port="";
-    else 
-      telnet_port = ":" + telnet_port;
-    if(rlogin_port=="513")
-      rlogin_port="";
-    else 
-      rlogin_port = ":" + rlogin_port;
-    if(ftp_port=="21")
-      ftp_port="";
-    else 
-      ftp_port = ":" + ftp_port;
-    if(irc_port=="6667")
-      irc_port="";
-    else 
-      irc_port = ":" + irc_port;
-    if(nntp_port=="119")
-      nntp_port="";
-    else
-      nntp_port = ":" + nntp_port;
-    if(gopher_port=="70")
-      gopher_port='';
-    else 
-      gopher_port = ":" + gopher_port;        
         
 	template.additional_services ='[' + ("java telnet".link("telnet/")) + '] ';
     template.additional_services+='[' + ("telnet".link("telnet://"+host +telnet_port)) + '] ';
@@ -78,8 +56,11 @@ load("../web/lib/leftnav_html.ssjs");
     template.additional_services+='[' + ("news".link("news://"+host +nntp_port)) + '] ';
     template.additional_services+='[' + ("gopher".link("gopher://"+host +gopher_port)) + '] ';
 
+if(do_rightnav)
+        write_template("rightnav.inc");
 write_template("main.inc");
-write_template("footer.inc");
+if(do_footer)    
+    write_template("footer.inc");
 
 function addcommas(num)
 {
diff --git a/web/root/members/editprofile.ssjs b/web/root/members/editprofile.ssjs
index 6f3d32f5014f4ad0ef7b297a9eb5a946c700f9b5..3da09f3e29767d886604a84e96bad906fe5fae34 100644
--- a/web/root/members/editprofile.ssjs
+++ b/web/root/members/editprofile.ssjs
@@ -76,40 +76,44 @@ template.profile = new Array;
 	template.profile.push({html: '<h1>Edit Profile</h1>' });
 	template.profile.push({html: '<p>Personal Information</p>' });
 	template.profile.push({html: '<form action="/members/updateprofile.ssjs?edituser=' + user.number + '" method="post">' });
-	template.profile.push({html: '<table class="userstats" cellpadding="0" cellspacing="2">' });
+	template.profile.push({html: '<table class="userstats2" cellpadding="2" cellspacing="1">' });
 	if(system.newuser_questions & UQ_REALNAME)
 		template.profile.push({html: '<tr><td class="userstats" align="right">Real Name: </td><td class="userstats" align="left"><input type="text" name="name" size="25" maxlength="25" value="' + usr.name +  '" ' + disabled + ' /></td></tr>' });
 	if(system.newuser_questions & UQ_ALIASES)
-		template.profile.push({html: '<tr><td class="userstats" align="right">Alias: </td><td class="userstats" align="left"><input type="text" name="alias" size="25" maxlength="25" value="' + usr.alias + '" ' + disabled + ' /></td></tr>' });
+		template.profile.push({html: '<tr><td class="userstatsright" align="right">Alias: </td><td class="userstats" align="left"><input type="text" name="alias" size="25" maxlength="25" value="' + usr.alias + '" ' + disabled + ' /></td></tr>' });
 	if(system.newuser_questions & UQ_HANDLE)
-		template.profile.push({html: '<tr><td class="userstats" align="right">Chat Handle: </td><td class="userstats" align="left"><input type="text" name="handle" size="8" maxlength="8" value="' + usr.handle + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">E-Mail Address: </td><td class="userstats" align="left"><input type="text" name="email" size="50" maxlength="60" value="' + usr.netmail + '" /></td></tr>' });
+		template.profile.push({html: '<tr><td class="userstatsright" align="right">Chat Handle: </td><td class="userstats" align="left"><input type="text" name="handle" size="8" maxlength="8" value="' + usr.handle + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">E-Mail Address: </td><td class="userstats" align="left"><input type="text" name="email" size="50" maxlength="60" value="' + usr.netmail + '" /></td></tr>' });
 	if(system.newuser_questions & UQ_ADDRESS)
-		template.profile.push({html: '<tr><td class="userstats" align="right">Address: </td><td class="userstats" align="left"><input type="text" name="address" size="50" maxlength="50" value="' + usr.address + '" /></td></tr>' });
+		template.profile.push({html: '<tr><td class="userstatsright" align="right">Address: </td><td class="userstats" align="left"><input type="text" name="address" size="50" maxlength="50" value="' + usr.address + '" /></td></tr>' });
 	if(system.newuser_questions & UQ_LOCATION)
-		template.profile.push({html: '<tr><td class="userstats" align="right">City, State/Prov: </td><td class="userstats" align="left"><input type="text" name="location" size="50" maxlength="50" value="' + usr.location + '" /></td></tr>' });
+		template.profile.push({html: '<tr><td class="userstatsright" align="right">City, State/Prov: </td><td class="userstats" align="left"><input type="text" name="location" size="50" maxlength="50" value="' + usr.location + '" /></td></tr>' });
 	if(system.newuser_questions & UQ_ADDRESS)
-		template.profile.push({html: '<tr><td class="userstats" align="right">Zip/Postal Code: </td><td class="userstats" align="left"><input type="text" name="zipcode" size="50" maxlength="50" value="' + usr.zipcode + '" /></td></tr>' });
+		template.profile.push({html: '<tr><td class="userstatsright" align="right">Zip/Postal Code: </td><td class="userstats" align="left"><input type="text" name="zipcode" size="50" maxlength="50" value="' + usr.zipcode + '" /></td></tr>' });
 	if(system.newuser_questions & UQ_PHONE)
-		template.profile.push({html: '<tr><td class="userstats" align="right">Phone: </td><td class="userstats" align="left"><input type="text" name="phone" size="50" maxlength="50" value="' + usr.phone + '" /></td></tr>' });
+		template.profile.push({html: '<tr><td class="userstatsright" align="right">Phone: </td><td class="userstats" align="left"><input type="text" name="phone" size="50" maxlength="50" value="' + usr.phone + '" /></td></tr>' });
 	template.profile.push({html: '</table>' });
 	template.profile.push({html: '<h3>Web Profile</h3>'});
-	template.profile.push({html: '<p>Changes here are only visible in the Web Interface.</p>' });
-	template.profile.push({html: '<table class="userstats" cellpadding="0" cellspacing="2">' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">ICQ: </td><td class="userstats" align="left"><input type="text" name="icq" size="10" maxlength="10" value="' + usr.icq + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">MSN: </td><td class="userstats" align="left"><input type="text" name="msn" size="50" maxlength="50" value="' + usr.msn + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">Yahoo: </td><td class="userstats" align="left"><input type="text" name="yahoo" size="50" maxlength="50" value="' + usr.yahoo + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">AIM: </td><td class="userstats" align="left"><input type="text" name="aim" size="50" maxlength="50" value="' + usr.aim + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">Homepage: </td><td class="userstats" align="left"><input type="text" name="homepage" size="50" maxlength="50" value="' + usr.homepage + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">Hobbies: </td><td class="userstats" align="left"><input type="textarea" size="50" name="hobbies" value="' + usr.hobbies + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">Picture (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="picture" value="' + usr.picture + '" /></td></tr>' });
-	template.profile.push({html: '<tr><td class="userstats" align="right">Avatar (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="avatar" value="' + usr.avatar + '" /></td></tr>' });
+	template.profile.push({html: '<p>Changes here are only visible in the Web Interface.<br /><br /></p>' });
+	template.profile.push({html: '<table class="userstats2" cellpadding="2" cellspacing="1">' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">ICQ: </td><td class="userstats" align="left"><input type="text" name="icq" size="10" maxlength="10" value="' + usr.icq + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">MSN: </td><td class="userstats" align="left"><input type="text" name="msn" size="50" maxlength="50" value="' + usr.msn + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">Yahoo: </td><td class="userstats" align="left"><input type="text" name="yahoo" size="50" maxlength="50" value="' + usr.yahoo + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">AIM: </td><td class="userstats" align="left"><input type="text" name="aim" size="50" maxlength="50" value="' + usr.aim + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">Homepage: </td><td class="userstats" align="left"><input type="text" name="homepage" size="50" maxlength="50" value="' + usr.homepage + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">Hobbies: </td><td class="userstats" align="left"><input type="textarea" size="50" name="hobbies" value="' + usr.hobbies + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">Picture (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="picture" value="' + usr.picture + '" /></td></tr>' });
+	template.profile.push({html: '<tr><td class="userstatsright" align="right">Avatar (Link): </td><td class="userstats" align="left"><input type="textarea" size="50" name="avatar" value="' + usr.avatar + '" /></td></tr>' });
 	template.profile.push({html: '<tr><td class="userstats">&nbsp;</td><td class="userstats"><br /><input type="submit" value="Update Profile" /></td></tr></table></form><br />' });	
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
-
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("profile.inc");
-
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/members/info.ssjs b/web/root/members/info.ssjs
index 72a59322df75f73300c2c582cdd6e9b3a4adce55..bbb647b5f3dcbc5957f668f85b56e5dad9df02d7 100644
--- a/web/root/members/info.ssjs
+++ b/web/root/members/info.ssjs
@@ -1,10 +1,21 @@
+/* $Id$ */
+
 load("../web/lib/template.ssjs");
 
 var sub="";
 
 template.title=system.name+ " Information Menu";
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+
+template.user_num=user.number;
+
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("infomenu.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/members/lastcallers.ssjs b/web/root/members/lastcallers.ssjs
index d874f388d29697c739adb6bc03755a3575e85dbe..716e3c0e1aceb0629ef69fad75db08de5404ef8a 100644
--- a/web/root/members/lastcallers.ssjs
+++ b/web/root/members/lastcallers.ssjs
@@ -4,6 +4,9 @@ load("../web/lib/template.ssjs");
 
 var sub="";
 
+if(CurrTheme=="NightShade")
+	do_rightnav=false;
+
 if(user.number!=0) {
     var file = new File(system.data_dir + "logon.lst");
         if(file.open("r")) {
@@ -14,8 +17,14 @@ if(user.number!=0) {
     template.lastcallers=html_encode(template.lastcallers.join("\r\n"),true,false,true,true);
 }
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("lastcallers.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/members/newpw.ssjs b/web/root/members/newpw.ssjs
index 5a621ed3358c6d7e5fa78b2c5d940766ea0a39fe..f640accf7d807a9f1181755e83501c95240dc31f 100644
--- a/web/root/members/newpw.ssjs
+++ b/web/root/members/newpw.ssjs
@@ -11,8 +11,15 @@ template.title = "Change User Password";
 if(user.security.password_date!=0)
     template.pwchangedate=strftime("%A, %B %d, %Y." ,user.security.password_date);
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("newpw.inc");
-write_template("footer.inc");
\ No newline at end of file
+if(do_footer)
+	write_template("footer.inc");
+
diff --git a/web/root/members/picktheme.ssjs b/web/root/members/picktheme.ssjs
index 717c79b1f2056e3b7874415ada47f2c8ce8a4cb7..bb5bd48af3ea3e5d03745a9f4c8a770919872857 100644
--- a/web/root/members/picktheme.ssjs
+++ b/web/root/members/picktheme.ssjs
@@ -30,8 +30,14 @@ if(prefsfile.open("w+",false)) {
 load('../web/lib/template.ssjs');
 template.theme=Themes[CurrTheme];
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
-load("../web/lib/leftnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
+	load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("picktheme.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/members/sysinfo.ssjs b/web/root/members/sysinfo.ssjs
index a3acef56012aaf718985e0cd36cb2ed56c66f8b9..e951687cc5110ab516750a99762e5dc24c07b725 100644
--- a/web/root/members/sysinfo.ssjs
+++ b/web/root/members/sysinfo.ssjs
@@ -1,9 +1,14 @@
+/* $Id$ */
+
 load("../web/lib/template.ssjs");
 
 var sub="";
 
 template.title= system.name+ " - System Information";
 
+if(CurrTheme=="NightShade")
+	do_rightnav = false;
+
 template.sysinfo="";
 f=new File(system.text_dir+"system.msg");
 if(f.open("rb",true)) {
@@ -106,8 +111,14 @@ for(addr in system.fido_addr_list) {
 	template.fidoaddrs[addr].address=system.fido_addr_list[addr];
 }
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("sysinfo.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/members/themes.ssjs b/web/root/members/themes.ssjs
index 7f3842062e304b47747edf89dbd9c04bbab32012..b06814da46c0c5438293934d6aa2ba9eef912279 100644
--- a/web/root/members/themes.ssjs
+++ b/web/root/members/themes.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 load("../web/lib/template.ssjs");
 
 var sub='';
@@ -10,8 +12,15 @@ for(tname in Themes) {
 	template.theme_list+='>'+html_encode(Themes[tname].desc,true,true,false,false)+'</option>';
 }
 template.theme_list+='</select>';
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
-load("../web/lib/leftnav_html.ssjs");
+
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
+	load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)	
+	write_template("rightnav.inc");
 write_template("themes.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/members/updateprofile.ssjs b/web/root/members/updateprofile.ssjs
index 188c75d99585fd047564b9038ba781ad39c9ead4..9600f216ac7e85019ed978e01964081be895bab3 100644
--- a/web/root/members/updateprofile.ssjs
+++ b/web/root/members/updateprofile.ssjs
@@ -90,10 +90,15 @@ template.backurl='<a href="/members/userlist.ssjs">Back to Userlist</a>';
 
 template.update_message="Profile has been Updated."
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
-
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("updateprofile.inc");
+if(do_footer)
+	write_template("footer.inc");
 
-write_template("footer.inc");
\ No newline at end of file
diff --git a/web/root/members/userlist.ssjs b/web/root/members/userlist.ssjs
index f76db50f21942a9f58049fa1e765b8d530020027..337c40245ad82d70889c09daaa4806cfbf4d2dc3 100644
--- a/web/root/members/userlist.ssjs
+++ b/web/root/members/userlist.ssjs
@@ -40,11 +40,17 @@ for(i=1;i<=lastuser;i++) {
 if(http_request.query["sort"]!=undefined)
 	template.users.sort(alphasort);
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("userlist.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 function alphasort (a,b)
 {
diff --git a/web/root/members/userstats.ssjs b/web/root/members/userstats.ssjs
index 69da8b2806fa994cdac41f0e32790c126ebfe9e7..d1793cec6a19bc288807e0ca71e044b839013d36 100644
--- a/web/root/members/userstats.ssjs
+++ b/web/root/members/userstats.ssjs
@@ -22,11 +22,17 @@ else
 i=i ? 100/i : user.stats.total_posts > user.stats.total_logons ? 100 : 0;
 template.pinfo=parseInt(i);
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("userstats.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 function addcommas(num)
 {
diff --git a/web/root/members/viewprofile.ssjs b/web/root/members/viewprofile.ssjs
index caca3c99d191abe27166ddcae81b98a52791137e..f202a71468b0f75c943c94b1a7832e1a96fe6aba 100644
--- a/web/root/members/viewprofile.ssjs
+++ b/web/root/members/viewprofile.ssjs
@@ -151,10 +151,15 @@ if(is_sysop) {
 	template.profile.push({html: '</table><br />' });
 }
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
-if(CurrTheme=="NewLayout")
+if(do_rightnav)
 	write_template("rightnav.inc");
 write_template("profile.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
+
diff --git a/web/root/msgs/attachments.ssjs b/web/root/msgs/attachments.ssjs
index 771121659c3b1129a84ea72b80c35c8eb94358ec..8e6352bfe9f48ddeac92c637e739fe5b4ec343c9 100644
--- a/web/root/msgs/attachments.ssjs
+++ b/web/root/msgs/attachments.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 /* 
  * Attachment FS emulator
  * Request attachments in the form:
diff --git a/web/root/msgs/choosegroup.ssjs b/web/root/msgs/choosegroup.ssjs
index 8228659f74cfeee868fd390c3373aaf7dbb9fba4..7d479519533bba2e434e8438b4e604eda47c05f8 100644
--- a/web/root/msgs/choosegroup.ssjs
+++ b/web/root/msgs/choosegroup.ssjs
@@ -3,11 +3,20 @@
 load("../web/lib/msgslib.ssjs");
 
 template.title="Message Groups on " +system.name;
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
+	
 template.groups=msg_area.grp_list;
+	
 write_template("msgs/choosegroup.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 msgs_done();
diff --git a/web/root/msgs/choosesubs.ssjs b/web/root/msgs/choosesubs.ssjs
index 7f2a2b2cba2cbc3b64d2cd69af0fd1571ce3360b..fcccb901cb90458e031928b2a1ca72582639b4db 100644
--- a/web/root/msgs/choosesubs.ssjs
+++ b/web/root/msgs/choosesubs.ssjs
@@ -4,6 +4,7 @@ load("../web/lib/msgslib.ssjs");
 
 template.title="Choosing Message Subs in Group: "+msg_area.grp[grp].description;
 
+if(do_header)
 write_template("header.inc");
 
 template.group=msg_area.grp[grp];
@@ -36,9 +37,14 @@ for(s in msg_area.grp[grp].sub_list) {
     template.subs.push(thissub);
 }
 
-load("../web/lib/topnav_html.ssjs");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/choosesubs.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 msgs_done();
diff --git a/web/root/msgs/index.ssjs b/web/root/msgs/index.ssjs
index 0e4e5813bc9ef4f4bb0ad02466fad9da39cd92ca..ef3da72ea2f39c2f1ec1c78eb32f7459fd222bed 100644
--- a/web/root/msgs/index.ssjs
+++ b/web/root/msgs/index.ssjs
@@ -1,11 +1,23 @@
+/* $Id$ */
+
 load("../web/lib/msgslib.ssjs");
 
 template.title="Message Groups on " +system.name;
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
+	
 template.groups=msg_area.grp_list;
+	
 write_template("msgs/groups.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
+
 
 msgs_done();
diff --git a/web/root/msgs/inline.ssjs b/web/root/msgs/inline.ssjs
index d15398888cd0a62ea5a4e5d3eb555bb33559299d..3297afa82858761d97404952dcd407e05d8803cc 100644
--- a/web/root/msgs/inline.ssjs
+++ b/web/root/msgs/inline.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 /* 
  * Inline attachment FS emulator
  * Request attachments in the form:
diff --git a/web/root/msgs/management.ssjs b/web/root/msgs/management.ssjs
index 3daa2546003cb99313ea84ac763e0b7894e4fe9f..c9a5c6acd129b47daffed58c6ea60678cdc2419b 100644
--- a/web/root/msgs/management.ssjs
+++ b/web/root/msgs/management.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 load("../web/lib/template.ssjs");
 load("../web/lib/msgslib.ssjs");
 
@@ -58,10 +60,17 @@ if(http_request.query.Action=="Delete") {
 }
 template.sub_code=sub;
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/management.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
+
 
 msgs_done();
diff --git a/web/root/msgs/msg.ssjs b/web/root/msgs/msg.ssjs
index 2eda7acee55ede689a8e16791d1c71ca8a5162a5..c71614c16e1e8c623b90de2e6dcfef0bed3a2028 100644
--- a/web/root/msgs/msg.ssjs
+++ b/web/root/msgs/msg.ssjs
@@ -5,17 +5,59 @@ load("../web/lib/mime_decode.ssjs");
 
 template.txtbodybgwht=0;
 
+template.author_avatar = '';
+
+/*  If you want to disable display of certain .inc files  */
+/* for a specific theme declare it like this in the .ssjs */
+/* file corresponding to the page you want to overide the */
+/*           default display type for the theme			  */
+
+if(CurrTheme=="NightShade") {
+	do_leftnav=false;
+	do_rightnav=false;
+}
+
 if(msgbase.open!=undefined && msgbase.open()==false) {
     error(msgbase.last_error);
 }
 
+/* Check author info if message base is local and display it */
+/*    on the new expanded message read page for new theme    */
+
+var hdr=msgbase.get_msg_header(false,m);
+
+
+
+if(hdr.from_ext!=undefined) {
+	template.u_num = hdr.from_ext;
+	usr = new User(template.u_num);
+	template.author_firston = strftime("%m/%d/%y",usr.stats.firston_date);
+	template.author_posts = usr.stats.total_posts;
+	if((user.compare_ars(msg_area.sub[sub].operator_ars) && msg_area.sub[sub].operator_ars != '' || user.number==1) && show_ip==true) {
+		template.author_ip='IP: ' + usr.note + '<br /><br />';
+	}
+	template.author_ismod = '<br />Member<br /><br />';
+	if(usr.compare_ars(msg_area.sub[sub].operator_ars) && msg_area.sub[sub].operator_ars != '' || usr.number==1)
+		template.author_ismod = '<br />Moderator<br /><br />';
+	if(file_exists(prefs_dir + format("%04d.html_prefs",usr.number))); {
+		prefsfile=new File(prefs_dir + format("%04d.html_prefs",usr.number));
+		if(prefsfile.open("r",false)) {
+			if(prefsfile.iniGetValue('Profile', 'Avatar', '')!='') {
+				template.author_avatar=prefsfile.iniGetValue('Profile', 'Avatar', '');
+				var display_info=true;
+			} else
+			template.author_avatar = template.image_dir + "/nothumbnail.jpg";
+			prefsfile.close();
+		}
+	}
+}
+
 template.can_delete=can_delete(m);
 
 if(sub=='mail') {
     template.group=new Object;
     template.group.name="E-Mail";
-}
-else {
+} else {
     template.group=msg_area.grp[msg_area.sub[sub].grp_name];
 }
 
@@ -125,10 +167,16 @@ if(tmp!=undefined)
 else
     template.nextlink=no_next_msg_html;
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
-load("../web/lib/leftnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
+	load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/msg.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 msgs_done();
diff --git a/web/root/msgs/msgs.ssjs b/web/root/msgs/msgs.ssjs
index 9b07c5baca3af64e406637791d3ce0195c08ac76..0ff102e829f6a6f752b2936de3d7a13207a585db 100644
--- a/web/root/msgs/msgs.ssjs
+++ b/web/root/msgs/msgs.ssjs
@@ -221,7 +221,6 @@ if(sub!='mail')  {
     }
 }
 
-write_template("header.inc");
 last_offset=msgarray.length-1-offset;
 first_offset = offset;
 max_first_offset= offset+msgarray.length-1-offset;
@@ -245,6 +244,9 @@ if(DateDescending) {
      if(hdr==null)
           continue;
      template.messages[displayed.toString()]=hdr;
+	 template.messages[displayed.toString()].to=template.messages[displayed.toString()].to.substr(0,15);
+	 template.messages[displayed.toString()].from=template.messages[displayed.toString()].from.substr(0,15);
+	 template.messages[displayed.toString()].subject=template.messages[displayed.toString()].subject.substr(0,20);
      template.messages[displayed.toString()].attachments=count_attachments(hdr,msgbase.get_msg_body(true,msgarray[last_offset].offset));
      template.messages[displayed.toString()].offset=msgarray[last_offset].offset;
      displayed++;
@@ -255,8 +257,11 @@ if(DateDescending) {
       var hdr=clean_msg_headers(msgbase.get_msg_header(true,msgarray[first_offset].offset),0);
       if(hdr==null)
           continue;
-      template.messages[displayed.toString()]=hdr;
-      template.messages[displayed.toString()].attachments=count_attachments(hdr,msgbase.get_msg_body(true,msgarray[first_offset].offset));
+	  template.messages[displayed.toString()]=hdr;
+	  template.messages[displayed.toString()].to=template.messages[displayed.toString()].to.substr(0,15);
+	  template.messages[displayed.toString()].from=template.messages[displayed.toString()].from.substr(0,15);
+	  template.messages[displayed.toString()].subject=template.messages[displayed.toString()].subject.substr(0,20);
+	  template.messages[displayed.toString()].attachments=count_attachments(hdr,msgbase.get_msg_body(true,msgarray[first_offset].offset));
       template.messages[displayed.toString()].offset=msgarray[first_offset].offset;
       displayed++;
   }
@@ -270,8 +275,40 @@ if(sub=='mail') {
     template.post_button_image="new_message.gif";
 }           
 
-load("../web/lib/topnav_html.ssjs");
-load("../web/lib/leftnav_html.ssjs");
+if(http_request.query["sort"]!=undefined)
+	template.messages.sort(alphasort);
+
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
+	load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/msgs.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 msgs_done();
+
+function alphasort (a,b)
+{
+	if(http_request.query["sort"]==undefined)
+		return(0);
+	var sortby=http_request.query["sort"]
+	var au;
+	var bu;
+	if(a[sortby].toUpperCase!=undefined)
+		au=a[sortby].toUpperCase();
+	else
+		au=a[sortby];
+	if(b[sortby].toUpperCase!=undefined)
+		bu=b[sortby].toUpperCase();
+	else
+		bu=b[sortby];
+	if(au<bu)
+		return -1;
+	if(bu>au)
+		return 1;
+	return 0;
+}
\ No newline at end of file
diff --git a/web/root/msgs/savemsg.ssjs b/web/root/msgs/savemsg.ssjs
index 73d0148b74b9daf2f2b825cc46f4fe6ca284dd0a..f5e95319343ce2dde0302809627aa853d6dfa0e0 100644
--- a/web/root/msgs/savemsg.ssjs
+++ b/web/root/msgs/savemsg.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 load("../web/lib/msgslib.ssjs");
 
 if(sub==undefined)
@@ -90,7 +92,13 @@ if(sub=='mail' || (!(msgbase.cfg.settings&SUB_NOUSERSIG) && !(hdrs.attr&MSG_ANON
 
 if(!msgbase.save_msg(hdrs,client,body)) {
 	error(msgbase.last_error);
-}
+} else {
+	if(sub=='mail') {
+		user.sent_email();
+	}
+	else
+		user.posted_message();
+} 
 
 /* Mark original message for replied */
 if(hdrs.thread_orig!=undefined)  {
@@ -104,10 +112,17 @@ if(hdrs.thread_orig!=undefined)  {
 
 http_reply.status="201 Created";
 title="Message posted";
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/posted.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 msgs_done();
diff --git a/web/root/msgs/subinfo.ssjs b/web/root/msgs/subinfo.ssjs
index 73ef7ac753d10761cbeb7a5e3b1d0b148e17961f..640f3dac9b7c4a479e1e66252d04a553419fe836 100644
--- a/web/root/msgs/subinfo.ssjs
+++ b/web/root/msgs/subinfo.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 load("sbbsdefs.js");
 load("../web/lib/msgslib.ssjs");
 
@@ -38,10 +40,16 @@ else {
 
 template.backurl=http_request.header.referer;
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
-load("../web/lib/leftnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
+	load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/subinfo.inc");
+if(do_footer)
 write_template("footer.inc");
 
 msgs_done();
diff --git a/web/root/msgs/subs.ssjs b/web/root/msgs/subs.ssjs
index be2a3c5cfd2a1d7fdadda720a29648ad4b04aac9..e8979774f567184d638bb2a9ce5b6086c332ffe8 100644
--- a/web/root/msgs/subs.ssjs
+++ b/web/root/msgs/subs.ssjs
@@ -1,3 +1,5 @@
+/* $Id$ */
+
 load("../web/lib/msgslib.ssjs");
 
 var ShowAll=(http_request.query.show_all_subs != undefined
@@ -28,7 +30,8 @@ else {
 }
 template.title="Message Subs in Group: "+msg_area.grp[grp].description;
 
-write_template("header.inc");
+if(do_header)
+	write_template("header.inc");
 
 template.group=msg_area.grp[grp];
 template.subs=new Array;
@@ -46,7 +49,7 @@ for(s in msg_area.grp[grp].sub_list) {
 			if(lastdate!=undefined && lastdate != null) {
 				lastdate=lastdate.time;
 				if(lastdate>0)
-					lastdate=strftime("%b-%d-%y",lastdate);
+					lastdate=strftime("%b-%d-%y %H:%M",lastdate);
 			}
         }
         msgbase.close();
@@ -56,9 +59,14 @@ for(s in msg_area.grp[grp].sub_list) {
 	template.subs.push(thissub);
 }
 
-load("../web/lib/topnav_html.ssjs");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/subs.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
 
 msgs_done();
diff --git a/web/root/msgs/updatesubs.ssjs b/web/root/msgs/updatesubs.ssjs
index f0fe4f44bbd609466fd226f50289ca00a8d5d23b..bf1d36af9e968cdf3f88cbf7a20fab8036ca9da7 100644
--- a/web/root/msgs/updatesubs.ssjs
+++ b/web/root/msgs/updatesubs.ssjs
@@ -57,7 +57,14 @@ for(s in msg_area.grp[grp].sub_list) {
     template.subs.push(thissub);
 }
 
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("msgs/updatesubs.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
diff --git a/web/root/newuser.ssjs b/web/root/newuser.ssjs
index 374030f18f4c98184b2c37495aaa92744259a68b..86956d9c2003c5ae4117e0b1511197c6e46d3f79 100644
--- a/web/root/newuser.ssjs
+++ b/web/root/newuser.ssjs
@@ -40,9 +40,11 @@ template.nup=((this.login==undefined)?system.newuser_magic_word:system.newuser_p
 
 /* System is closed to new users */
 if(system.settings & SYS_CLOSED) {
-    write_template("header.inc");
+	if(do_header)
+	    write_template("header.inc");
     write("This system is closed to new users, sorry.");
-    write_template("footer.inc");
+	if(do_footer)
+	    write_template("footer.inc");
     exit(0);
 }
 
@@ -346,15 +348,21 @@ else {
     nuser.editor=http_request.query.editor;
 
     template.title="New user created";
-    write_template("header.inc");
-    load("../web/lib/topnav_html.ssjs");
-    load("../web/lib/leftnav_html.ssjs");
+	if(do_header)
+	    write_template("header.inc");
+	if(do_topnav)
+	    load("../web/lib/topnav_html.ssjs");
+	if(do_leftnav)
+	    load("../web/lib/leftnav_html.ssjs");
+	if(do_rightnav)
+		write_template("rightnav.inc");
     if(http_request.query.netmail != undefined && http_request.query.netmail != '')
         template.response=format("<p>Your account has been created and the password has been mailed to: %s.</p>" ,http_request.query.netmail);
     else
         template.response=format("<p>Your account has been created and the password is: %s </p>" ,newpw);
     write_template("newuser_created.inc");
-    write_template("footer.inc");
+    if(do_footer)
+	write_template("footer.inc");
 
 prefs_dir=system.data_dir + 'user/';
 
@@ -368,11 +376,17 @@ prefsfile=new File(prefs_dir + '/'+format("%04d.html_prefs",nuser.number));
 }
 
 function showform() {
-    write_template("header.inc");
-    load("../web/lib/topnav_html.ssjs");
-    load("../web/lib/leftnav_html.ssjs");
+	if(do_header)
+	    write_template("header.inc");
+	if(do_topnav)
+	    load("../web/lib/topnav_html.ssjs");
+	if(do_leftnav)
+    	load("../web/lib/leftnav_html.ssjs");
+	if(do_rightnav)
+		write_template("rightnav.inc");
     write_template("newuser.inc");
-    write_template("footer.inc");
+	if(do_footer)
+		write_template("footer.inc");
     exit(0);
 }
 
diff --git a/web/root/nodelist.ssjs b/web/root/nodelist.ssjs
index 178218d3d84f5ddd8365c33af339e84977ceb747..d71e36306e5763a1e3525bc6a1c123e8aafb8630 100644
--- a/web/root/nodelist.ssjs
+++ b/web/root/nodelist.ssjs
@@ -6,8 +6,15 @@ template.title= system.name + " - Who's Online";
 
 var sub='';
 
-write_template("header.inc");
-load("../web/lib/topnav_html.ssjs");
+if(do_header)
+	write_template("header.inc");
+if(do_topnav)
+	load("../web/lib/topnav_html.ssjs");
+if(do_leftnav)
 load("../web/lib/leftnav_html.ssjs");
+if(do_rightnav)
+	write_template("rightnav.inc");
 write_template("nodelist.inc");
-write_template("footer.inc");
+if(do_footer)
+	write_template("footer.inc");
+