Index: /trunk/gsdl/macros/english.dm
===================================================================
--- /trunk/gsdl/macros/english.dm	(revision 1945)
+++ /trunk/gsdl/macros/english.dm	(revision 1946)
@@ -669,4 +669,5 @@
 Subcollections to include:
 <br>}
+_textrelateddocdisplay_ {display related documents}
 _textfcoption_ { Include navigation bar at top of document pages}
 _texthloption_ { Highlight search terms within document text}
Index: /trunk/gsdl/macros/pref.dm
===================================================================
--- /trunk/gsdl/macros/pref.dm	(revision 1945)
+++ /trunk/gsdl/macros/pref.dm	(revision 1946)
@@ -43,5 +43,5 @@
   s = "_cgiargcc_";
   a = s.split (",");
-  for (i = 0; i < a.length ;i++) \{
+ for (i = 0; i < a.length ;i++) \{
     for (j = 0; j < document.PrefForm.cc.length; j++) \{
       if (a[i] == document.PrefForm.elements["cc"][j].value) \{
@@ -61,14 +61,16 @@
   if (savedccs[collection] == 1) savedccs[collection] = 0;
   else savedccs[collection] = 1;
-       
+		
   var i;
   argcc = "";
   var changed = 0;
+
   for (i in savedccs)
-    if (savedccs[i] == 1) \{
-       argcc += "&cc=" + i;
-       changed = 1;
-    \}
+  if (savedccs[i] == 1) \{
+	argcc += "&cc=" + i;
+        changed = 1;
+   \}	
   if (changed == 1) argcc += "&r=1";
+   
   updatehrefs();
 \}
@@ -84,5 +86,5 @@
 _getargsfunction_ {
 function getargs () \{
-  return argk + args + argm + argo + arghd + argb + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
+  return argk + args + argm + argo + arghd + argrd + argb + argqb + argfqn_If_(_collectionoption_,_ccsargs_)_If_(_htmloptions_,_htmlargs_);
 \}
 }
@@ -134,4 +136,12 @@
 _arghlon_ {arghl = "&hl=1";}
 _arghloff_ {arghl = "&hl=0";}
+
+_arghdblank_ {arghd = "";}
+_arghdon_ {arghd = "&hd=1";}
+_arghdoff_{arghd = "&hd=0";}
+
+_argrdblank_ {argrd = "";}
+_argrdon_ {argrd = "&rd=1";}
+_argrdoff_{argrd = "&rd=0";}
 
 _pagescriptextra_ {
@@ -146,4 +156,5 @@
 argb = "";
 arghd = "";
+argrd = "";
 argqb = "";
 argfqn = "";
@@ -183,11 +194,4 @@
 \}
 
-function updatefqn () \{
-  value = document.PrefForm.fqn.options[document.PrefForm.fqn.selectedIndex].value;
-  if (value != _cgiargfqn_) argfqn = "&fqn=" + value;
-  else argfqn = "";
-  updatehrefs();
-\}
-
 function updateb (value) \{
   if (value != _cgiargb_) argb = "&b=" + value;
@@ -196,19 +200,25 @@
 \}
 
+
 function updatehd() \{
-  arghd="";
-  if (document.PrefForm.hd[0].checked) \{
-     if ("_cgiarghd_" != "0") arghd = "&hd=0";
-  \}
-  else \{
-     value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value;
-     if (_cgiarghd_ != value) arghd = "&hd="+value;
-  \}
-  updatehrefs();
-\}
+   arghd="";
+   if (document.PrefForm.hd[0].checked) \{
+      if ("_cgiarghd_" != "0") arghd = "&hd=0";
+   \}
+   else \{
+      value = document.PrefForm.hdn[document.PrefForm.hdn.selectedIndex].value;
+      if (_cgiarghd_ != value) arghd = "&hd="+value;
+   \}
 
 function updateqb(value) \{
-  if (value != _cgiargqb_) argqb = "&qb=" + value;
-  else argqb = "";
+   if (value != _cgiargqb_) argqb = "&qb=" + value;
+   else argqb = "";
+\}
+
+function updaterd () \{
+  if (document.PrefForm.rd.checked)
+    _If_("_cgiargrd_" eq "1",_argrdblank_,_argrdon_)
+  else
+    _If_("_cgiargrd_" ne "1",_argrdblank_,_argrdoff_)
   updatehrefs();
 \}
@@ -227,12 +237,12 @@
   value = document.PrefForm.w.options[document.PrefForm.w.selectedIndex].value;
   location.href = location.href + "&nl=0&nw=" + value + getargs();
-\}
-
-function updateqt () \{
-  value = document.PrefForm.qt.options[document.PrefForm.qt.selectedIndex].value;
-  location.href = location.href + "&qt=" + value + getargs();
-\}
-}
-
+ \}
+ 
+ function updateqt () \{
+   value = document.PrefForm.qt.options[document.PrefForm.qt.selectedIndex].value;
+   location.href = location.href + "&qt=" + value + getargs();
+\}
+
+}
 
 #######################################################################
@@ -273,4 +283,23 @@
 }
 
+#search pref options
+ _boxsizeoption_{
+ <td valign=baseline>_textqueryboxsize_</td>
+ <td><input type=radio name=qb value=0 onClick="updateqb(0);"
+               _If_(_cgiargqb_,, checked)>_textregbox_<br>
+ <input type=radio name=qb value=1 onClick="updateqb(1);"
+               _If_(_cgiargqb_, checked)>_textbigbox_</td>
+ } 
+
+ _caseoption_ {
+ <td valign=baseline>_textcasediffs_</td>
+ <td><input type=radio name=k value=1 onClick="updatek(1);"
+               _If_(_cgiargk_, checked)>_textignorecase_<br>
+ <input type=radio name=k value=0 onClick="updatek(0);"
+               _If_(_cgiargk_,, checked)>_textmatchcase_</td>
+ }
+ 
+ _caseoption_ [l=ar] {}
+
 _fcoption_ {
 <input type=checkbox name=fc onClick="updatefc();"_If_("_cgiargfc_" eq "1", checked)> 
@@ -283,27 +312,8 @@
 }
 
-#search pref options
-_boxsizeoption_{
-<td valign=baseline>_textqueryboxsize_</td>
-<td><input type=radio name=qb value=0 onClick="updateqb(0);"
-		_If_(_cgiargqb_,, checked)>_textregbox_<br>
-<input type=radio name=qb value=1 onClick="updateqb(1);"
-		_If_(_cgiargqb_, checked)>_textbigbox_</td>
-}
-
-_caseoption_ {
-<td valign=baseline>_textcasediffs_</td>
-<td><input type=radio name=k value=1 onClick="updatek(1);"
-		_If_(_cgiargk_, checked)>_textignorecase_<br>
-<input type=radio name=k value=0 onClick="updatek(0);"
-		_If_(_cgiargk_,, checked)>_textmatchcase_</td>
-}
-
-_caseoption_ [l=ar] {}
 _caseoption_ [l=zh] {}
 
 _stemoption_ {
-<td valign=baseline>_textwordends_</td>
-<td><input type=radio name=s value=1 onClick="updates(1);"
+<input type=radio name=s value=1 onClick="updates(1);"
   _If_(_cgiargs_, checked)>_textstem_<br>
 <input type=radio name=s value=0 onClick="updates(0);"
@@ -312,29 +322,4 @@
 
 _stemoption_ [l=zh] {}
-
-
-_modeoption_ {
-<td valign=baseline>_textquerymode_</td>
-<td><input type=radio name=b value=0 onClick="updateb(0);"
-		_If_(_cgiargb_,, checked)>_textsimplemode_<br>
-<input type=radio name=b value=1 onClick="updateb(1);"
-		_If_(_cgiargb_, checked)>_textadvancedmode_</td>
-}
-
-
-_searchhistoryop_ {
-<td valign=baseline>_textsearchhistory_</td>
-<td><input type=radio name="hd" value=0 onClick="updatehd();"
-                _If_("_cgiarghd_" eq "0", checked)>_textnohistorydisplay_<br>
-<input type=radio name="hd" value=1 onClick="updatehd();"
-		_If_("_cgiarghd_" eq "0",, checked)>_texthistorydisplay_</td>   
-}
-
-_historynumrecords_{<select name="hdn" onChange="updatehd();">
-    <option value="5"_If_("_cgiarghd_" eq "5", selected)>5
-    <option value="10"_If_("_cgiarghd_" eq "10", selected)>10
-    <option value="15"_If_("_cgiarghd_" eq "15", selected)>15
-    <option value="20"_If_("_cgiarghd_" eq "20", selected)>20
-</select>}
 
 _maxdocoption_ {
@@ -355,7 +340,37 @@
 }
 
+modeoption_ {
+ <td valign=baseline>_textquerymode_</td>
+ <td><input type=radio name=b value=0 onClick="updateb(0);"
+               _If_(_cgiargb_,, checked)>_textsimplemode_<br>
+ <input type=radio name=b value=1 onClick="updateb(1);"
+               _If_(_cgiargb_, checked)>_textadvancedmode_</td>
+ }
+ 
+ 
+ _searchhistoryop_ {
+ <td valign=baseline>_textsearchhistory_</td>
+ <td><input type=radio name="hd" value=0 onClick="updatehd();"
+                 _If_("_cgiarghd_" eq "0", checked)>_textnohistorydisplay_<br>
+ <input type=radio name="hd" value=1 onClick="updatehd();"
+               _If_("_cgiarghd_" eq "0",, checked)>_texthistorydisplay_</td>   
+ }
+ 
+ _historynumrecords_{<select name="hdn" onChange="updatehd();">
+     <option value="5"_If_("_cgiarghd_" eq "5", selected)>5
+     <option value="10"_If_("_cgiarghd_" eq "10", selected)>10
+     <option value="15"_If_("_cgiarghd_" eq "15", selected)>15
+     <option value="20"_If_("_cgiarghd_" eq "20", selected)>20
+ </select>}
+ 
+_relateddocop_ {
+<input type=checkbox name="rd" onClick="updaterd();"
+                _If_("_cgiargrd_" eq "1", checked)>_textrelateddocdisplay_
+}
+
 _extlinkoption_ {
 <td>_textextlink_</td>
-<td><select name="el" onChange="updateel();">
+< <td><select name="el" onChange="updateel();">
+
   <option value="prompt"_If_("_cgiargel_" eq "prompt", selected)>
      _textlinkinterm_
@@ -367,5 +382,5 @@
 _intlinkoption_ {
 <td>_textintlink_</td>
-<td><select name="il" onChange="updateil();">
+< <td><select name="il" onChange="updateil();">
   <option value="l"_If_("_cgiargil_" eq "l", selected)>
      _textdigitlib_
@@ -375,11 +390,11 @@
 }
 
-# set from within pageaction
 _languageoption_ {}
+
 _encodingoption_ {}
 
 _formatoption_ {
 <td>_textformat_</td>
-<td><select name="v" onChange="updatev();">
+ <td><select name="v" onChange="updatev();">
   <option value="0"_If_("_cgiargv_" eq "0", selected)>_textgraphical_
   <option value="1"_If_("_cgiargv_" eq "1", selected)>_texttextual_
@@ -391,5 +406,4 @@
 _navigationbar_
 </center>
-
 <blockquote>
 
@@ -400,5 +414,5 @@
 _If_(_collectionoption_,_collectionprefs_)
 _presentationprefs_
-_If_("_cgiargct_" eq "1",_mgppsearchprefs_,_mgsearchprefs_)
+_searchprefs_
 
 </blockquote>
@@ -406,23 +420,24 @@
 }
 
-#search prefs for mg collections
-_mgsearchprefs_ {
+_searchprefs_ {
 <h3>_textsearchprefs_</h3>
-<table>
-<tr>_boxsizeoption_</tr>
-
-<tr>_caseoption_</tr>
-
-<tr>_stemoption_</tr>
-
-<tr>_modeoption_</tr>
-
-<tr>_searchhistoryop_</tr>
-
-<tr><td colspan=2>_textprefop_</td></tr>
-</table>
-</blockquote>
-_iconblankbar_
-<blockquote>
+<p>
+_caseoption_
+
+<p>
+_stemoption_
+
+<p>
+_modeoption_
+
+<p>
+_searchhistoryop_
+
+<p>
+_relateddocop_
+
+<p>
+_textprefop_
+<br>_iconblankbar_
 }
 
@@ -430,80 +445,21 @@
 <h3>_textcollectionprefs_</h3>
 _collectionoption_
-</blockquote>
-_iconblankbar_
-<blockquote>
+<br>_iconblankbar_
 }
 
 _presentationprefs_ {
 <h3>_textpresentationprefs_</h3>
-<table>_htmloptions_
-
-_If_(_languageoption_,<tr><td>_textlanguage_</td><td>_languageoption_</td></tr>)
-
-_If_(_encodingoption_,<tr><td>_textencoding_</td><td>_encodingoption_</td></tr>)
-
-<tr>_formatoption_</tr></table>
-</blockquote>
-_iconblankbar_
-<blockquote>
-}
-
-#######################################################
-## new stuff for prefs for form vs text search - for mgpp collections
-_mgppsearchprefs_ {
-<h3>_textsearchprefs_</h3>
-<table>
-<tr>_searchtypeop_</tr>
-
-_If_(_cgiargqt_,_formsearchoptions_,_textsearchoptions_)
-
-<tr>_caseoption_</tr>
-
-<tr>_stemoption_</tr>
-
-<tr>_searchhistoryop_</tr>
-
-<tr><td colspan=2>_textprefop_</td></tr></table>
-</blockquote>
-_iconblankbar_
-<blockquote>
-}
-
-
-_searchtypeop_ {
-<td>_texttypesearch_</td>
-<td><select name="qt" onChange="updateqt();">
-  <option value="0"_If_("_cgiargqt_" eq "0", selected)>_texttextsearch_
-  <option value="1"_If_("_cgiargqt_" eq "1", selected)>_textformsearch_
-</select></td>
-}
-
-_formsearchoptions_ {
-<tr>_formmodeoption_</tr>
-}
-
-_textsearchoptions_ {
-<tr>_boxsizeoption_</tr>
-<tr>_modeoption_</tr>
-}
-
-_formmodeoption_{
-<td valign=baseline>_textformtype_</td>
-<td><input type=radio name=b value=0 onClick="updateb(0);"
-		_If_(_cgiargb_,, checked)>_textsimple_<br>
-<input type=radio name=b value=1 onClick="updateb(1);"
-		_If_(_cgiargb_, checked)>_textadvanced_<br>
-_formnumoption_</td>
-}
-
-_formnumoption_ {_textwith_
-<select name="fqn" onChange="updatefqn();">
-  <option value="2"_If_("_cgiargfqn_" eq "2", selected)>2  
-  <option value="4"_If_("_cgiargfqn_" eq "4", selected)>4
-  <option value="6"_If_("_cgiargfqn_" eq "6", selected)>6
-  <option value="8"_If_("_cgiargfqn_" eq "8", selected)>8
-</select>_textfields_</td>
-}
-
+_htmloptions_
+
+<p>
+_languageoption_
+
+<p>
+_encodingoption_
+
+<p>
+_formatoption_
+<br>_iconblankbar_
+}
 
 #######################################################################
@@ -512,2 +468,12 @@
 
 _iconthispage_ {<img src="_httpiconhpref_" alt="_textpreferences_" width="_widthhpref_" height="_heighthpref_">}
+
+
+
+
+
+
+
+
+
+
