Index: login/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/login/index.php,v
retrieving revision 1.128
diff -u -r1.128 index.php
--- login/index.php	29 Aug 2007 18:19:04 -0000	1.128
+++ login/index.php	25 Sep 2007 11:22:54 -0000
@@ -64,7 +64,7 @@
     } else {
         $currlang = current_language();
         $langs    = get_list_of_languages();
-        $langlabel = '<span class="accesshide">'.get_string('language').':</span>';
+        $langlabel = get_accesshide(get_string('language'));
         $langmenu = popup_form ("$CFG->httpswwwroot/login/index.php?lang=", $langs, "chooselang", $currlang, "", "", "", true, 'self', $langlabel);
     }
 
Index: lib/weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.953
diff -u -r1.953 weblib.php
--- lib/weblib.php	24 Sep 2007 15:24:21 -0000	1.953
+++ lib/weblib.php	25 Sep 2007 11:22:54 -0000
@@ -1060,6 +1060,8 @@
  * @param boolean $return Indicates whether the function should return the text
  *         as a string or echo it directly to the page being rendered
  * @param string $targetwindow The name of the target page to open the linked page in.
+ * @param string $selectlabel Text to place in a [label] element - preferred for accessibility.
+ * @param array $optionsextra TODO, an array?
  * @return string If $return is true then the entire form is returned as a string.
  * @todo Finish documenting this function<br>
  */
@@ -3193,7 +3195,7 @@
     if ($text) {
         $htmltext = $text.'&nbsp;';
         if ($accesshide) {
-            $htmltext = '<span class="accesshide">'.$htmltext.'</span>';
+            $htmltext = get_accesshide($htmltext);
         }
     }
     if ($url) {
@@ -3227,7 +3229,7 @@
     if ($text) {
         $htmltext = '&nbsp;'.$text;
         if ($accesshide) {
-            $htmltext = '<span class="accesshide">'.$htmltext.'</span>';
+            $htmltext = get_accesshide($htmltext);
         }
     }
     if ($url) {
@@ -3241,6 +3243,19 @@
 }
 
 /**
+ * Return a HTML element with the class "accesshide", for accessibility.
+ *   Please use cautiously - where possible, text should be visible!
+ * @param string $text Plain text.
+ * @param string $elem Lowercase element name, default "span".
+ * @param string $class Additional classes for the element.
+ * @param string $attrs Additional attributes string in the form, "name='value' name2='value2'"
+ * @return string HTML string.
+ */
+function get_accesshide($text, $elem='span', $class='', $attrs='') {
+    return "<$elem class=\"accesshide $class\" $attrs>$text</$elem>";
+}
+
+/**
  * Return the breadcrumb trail navigation separator.
  * @return string HTML string.
  */
@@ -3303,8 +3318,7 @@
         }
 
         //Accessibility: breadcrumb links now in a list, &raquo; replaced with a 'silent' character.
-        $nav_text = get_string('youarehere','access');
-        $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
+        $output .= get_accesshide(get_string('youarehere','access'), 'h2')."<ul>\n";
 
         $output .= '<li class="first">'."\n".'<a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
                .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
@@ -5840,7 +5854,7 @@
     else {
         $skip_text = get_string('skipa', 'access', strip_tags($title));
     }
-    $skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'">'."\n".'<span class="accesshide">'.$skip_text.'</span>'."\n".'</a>';
+    $skip_link = '<a href="#sb-'.$block_id.'" class="skip-block" title="'.$skip_text.'">'."\n".get_accesshide($skip_text)."\n".'</a>';
     $skip_dest = '<span id="sb-'.$block_id.'" class="skip-block-to"></span>';
 
     if (! empty($heading)) {
@@ -6506,4 +6520,4 @@
 
 
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
+?>
\ No newline at end of file
Index: index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/index.php,v
retrieving revision 1.200
diff -u -r1.200 index.php
--- index.php	20 Sep 2007 06:49:52 -0000	1.200
+++ index.php	25 Sep 2007 11:22:53 -0000
@@ -100,7 +100,7 @@
     } else {
         $currlang = current_language();
         $langs = get_list_of_languages();
-        $langlabel = '<span class="accesshide">'.get_string('language').':</span>';
+        $langlabel = get_accesshide(get_string('language'));
         $langmenu = popup_form($CFG->wwwroot .'/index.php?lang=', $langs, 'chooselang', $currlang, '', '', '', true, 'self', $langlabel);
     }
 
