--- loncom/interface/lonmenu.pm	2006/02/21 20:14:49	1.165
+++ loncom/interface/lonmenu.pm	2006/04/07 21:56:01	1.170
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.165 2006/02/21 20:14:49 raeburn Exp $
+# $Id: lonmenu.pm,v 1.170 2006/04/07 21:56:01 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -279,9 +279,9 @@ $groups
 <td bgcolor="$tabbg">
 <img align="right" src="$logo" alt="Logo" />
 <b>LON-CAPA</b></td>
-$form
 </tr>
 </table>
+$form
 <script type="text/javascript">
 // END LON-CAPA Internal
 </script>
@@ -1177,12 +1177,18 @@ function catalog_info() {
 function chat_win() {
    lonchat=window.open('/res/adm/pages/chatroom.html',"LONchat",'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no');
 }
+
+function group_chat(group) {
+   var url = '/adm/groupchat?group='+group;
+   var winName = 'LONchat_'+group;
+   grpchat=window.open(url,winName,'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no');
+}
 ENDUTILITY
 }
 
 sub serverform {
     return(<<ENDSERVERFORM);
-<form name="server" action="/adm/logout" method="post" target="_top">
+<form name="server" action="/adm/logout" method="POST" target="_top">
 <input type="hidden" name="postdata" value="none" />
 <input type="hidden" name="command" value="none" />
 <input type="hidden" name="url" value="none" />
@@ -1193,14 +1199,14 @@ ENDSERVERFORM
 
 sub constspaceform {
     return(<<ENDCONSTSPACEFORM);
-<form name="constspace" action="/adm/logout" method="post" target="_top">
+<form name="constspace" action="/adm/logout" method="POST" target="_top">
 <input type="hidden" name="filename" value="" />
 </form>
-<form name="cstrdelete" action="/adm/cfile" method="post" target="_top">
+<form name="cstrdelete" action="/adm/cfile" method="POST" target="_top">
 <input type="hidden" name="action" value="delete" /> 
 <input type="hidden" name="filename" value="" />
 </form>
-<form name="cstrprint" action="/adm/printout" target="_parent" method="post">
+<form name="cstrprint" action="/adm/printout" target="_parent" method="POST">
 <input type="hidden" name="postdata" value="" />
 <input type="hidden" name="curseed" value="" />
 <input type="hidden" name="problemtype" value="" />
@@ -1235,7 +1241,6 @@ sub handler {
 	$env{'browser.interface'} ne 'textual') {
 	$form=&serverform();
     }
-    my $bodytag=&Apache::loncommon::bodytag('Main Menu');
     my $function='student';
     if ($env{'request.role'}=~/^(cc|in|ta|ep)/) {
 	$function='coordinator';
@@ -1265,40 +1270,32 @@ ENDSCRIPT
 	$env{'browser.interface'}='faketextual';
 	$env{'environment.remote'}='off';
     }
-    my $html=&Apache::lonxml::xmlbegin();
-    $r->print(<<ENDHEADER);
-$html
-<head>
-<title>LON-CAPA Main Menu</title>
-$script_tag
-</head>
-$bodytag
-ENDHEADER
+    $r->print(&Apache::loncommon::start_page('Main Menu',$script_tag));
     $r->print('<table>'.&inlinemenu().'</table>'.$form);
-    $r->print('</body></html>');
+    $r->print(&Apache::loncommon::end_page());
     return OK;
 }
 
 # ================================================================ Main Program
 
 BEGIN {
-  if (! defined($readdesk)) {
-   {
-    my $tabfile = $Apache::lonnet::perlvar{'lonTabDir'}.'/mydesk.tab';
-    if ( CORE::open( my $config,"<$tabfile") ) {
-        while (my $configline=<$config>) {
-            $configline=(split(/\#/,$configline))[0];
-            $configline=~s/^\s+//;
-            chomp($configline);
-            if ($configline) {
-                $desklines[$#desklines+1]=$configline;
-            }
-        }
-        CORE::close($config);
+    if (! defined($readdesk)) {
+	{
+	    my $tabfile = $Apache::lonnet::perlvar{'lonTabDir'}.'/mydesk.tab';
+	    if ( CORE::open( my $config,"<$tabfile") ) {
+		while (my $configline=<$config>) {
+		    $configline=(split(/\#/,$configline))[0];
+		    $configline=~s/^\s+//;
+		    chomp($configline);
+		    if ($configline) {
+			push(@desklines,$configline);
+		    }
+		}
+		CORE::close($config);
+	    }
+	}
+	$readdesk='done';
     }
-   }
-   $readdesk='done';
-  }
 }
 
 1;