+function viewer_link($label, $url='', $class='', $id='', $icon=null)
+{
+ global $path_to_root;
+
+ if ($class != '')
+ $class = " class='$class'";
+
+ if ($id != '')
+ $class = " id='$id'";
+
+ if ($url != "")
+ {
+ $pars = access_string($label);
+ if (user_graphic_links() && $icon)
+ $pars[0] = set_icon($icon, $pars[0]);
+ $preview_str = "<a target='_blank' $class $id href='$path_to_root/$url' onclick=\"javascript:openWindow(this.href,this.target); return false;\"$pars[1]>$pars[0]</a>";
+ }
+ else
+ $preview_str = $label;
+
+ return $preview_str;
+}
+
+function menu_link($url, $label, $id=null)
+{
+
+ $id = default_focus($id);
+ $pars = access_string($label);
+ return "<a href='$url' class='menu_option' id='$id' $pars[1]>$pars[0]</a>";
+}
+
+function submenu_option($title, $url, $id=null)
+{
+ global $path_to_root;
+ display_note(menu_link($path_to_root . $url, $title, $id), 0, 1);
+}
+
+function submenu_view($title, $type, $number, $id=null)
+{
+ display_note(get_trans_view_str($type, $number, $title, false, 'menu_option', $id), 0, 1);
+}
+
+function submenu_print($title, $type, $number, $id=null, $email=0)
+{
+ display_note(print_document_link($number, $title, true, $type, false, 'menu_option', $id, $email), 0, 1);
+}