<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># Virtualmin Framed Theme
# Icons copyright David Vignoni, all other theme elements copyright 2005-2007
# Virtualmin, Inc.

$main::cloudmin_no_create_links = 1;
$main::cloudmin_no_edit_buttons = 1;
$main::cloudmin_no_global_links = 1;

$main::mailbox_no_addressbook_button = 1;
$main::mailbox_no_folder_button = 1;

$main::basic_virtualmin_menu = 1;
$main::nocreate_virtualmin_menu = 1;
$main::nosingledomain_virtualmin_mode = 1;

# Global state for wrapper
# if 0, wrapper isn't on, add one and open it, if 1 close it, if 2+, subtract
# but don't close
$WRAPPER_OPEN = 0;
$COLUMNS_WRAPPER_OPEN = 0;

# theme_ui_post_header([subtext])
# Returns HTML to appear directly after a standard header() call
sub theme_ui_post_header
{
my ($text) = @_;
my $rv;
$rv .= "&lt;div class='ui_post_header'&gt;$text&lt;/div&gt;\n" if (defined($text));
#$rv .= "&lt;div class='section'&gt;\n";
$rv .= "&lt;p&gt;" if (!defined($text));
return $rv;
}

# theme_ui_pre_footer()
# Returns HTML to appear directly before a standard footer() call
sub theme_ui_pre_footer
{
my $rv;
$rv .= "&lt;/div&gt;&lt;p&gt;\n";
return $rv;
}

# ui_print_footer(args...)
# Print HTML for a footer with the pre-footer line. Args are the same as those
# passed to footer()
sub theme_ui_print_footer
{
local @args = @_;
print &amp;ui_pre_footer();
&amp;footer(@args);
}

sub theme_icons_table
{
my ($i, $need_tr);
my $cols = $_[3] ? $_[3] : 4;
my $per = int(100.0 / $cols);
print "&lt;div class='wrapper'&gt;\n";
print "&lt;table id='main' width=100% cellpadding=5 class='icons_table'&gt;\n";
for($i=0; $i&lt;@{$_[0]}; $i++) {
	if ($i%$cols == 0) { print "&lt;tr&gt;\n"; }
	print "&lt;td width=$per% align=center valign=top&gt;\n";
	&amp;generate_icon($_[2]-&gt;[$i], $_[1]-&gt;[$i], $_[0]-&gt;[$i],
		       $_[4], $_[5], $_[6], $_[7]-&gt;[$i], $_[8]-&gt;[$i]);
	print "&lt;/td&gt;\n";
        if ($i%$cols == $cols-1) { print "&lt;/tr&gt;\n"; }
        }
while($i++%$cols) { print "&lt;td width=$per%&gt;&lt;/td&gt;\n"; $need_tr++; }
print "&lt;/tr&gt;\n" if ($need_tr);
print "&lt;/table&gt;\n";
print "&lt;/div&gt;\n";
}

sub theme_generate_icon
{
my $w = !defined($_[4]) ? "width=48" : $_[4] ? "width=$_[4]" : "";
my $h = !defined($_[5]) ? "height=48" : $_[5] ? "height=$_[5]" : "";
if ($tconfig{'noicons'}) {
	if ($_[2]) {
		print "$_[6]&lt;a href=\"$_[2]\" $_[3]&gt;$_[1]&lt;/a&gt;$_[7]\n";
		}
	else {
		print "$_[6]$_[1]$_[7]\n";
		}
	}
elsif ($_[2]) {
	print "&lt;table&gt;&lt;tr&gt;&lt;td width=48 height=48&gt;\n",
	      "&lt;a href=\"$_[2]\" $_[3]&gt;&lt;img src=\"$_[0]\" alt=\"\" border=0 ",
	      "$w $h&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n";
	print "$_[6]&lt;a href=\"$_[2]\" $_[3]&gt;$_[1]&lt;/a&gt;$_[7]\n";
	}
else {
	print "&lt;table&gt;&lt;tr&gt;&lt;td width=48 height=48&gt;\n",
	      "&lt;img src=\"$_[0]\" alt=\"\" border=0 $w $h&gt;",
	      "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n$_[6]$_[1]$_[7]\n";
	}
}

# theme_post_save_domain(&amp;domain, action)
# Called by Virtualmin after a domain is updated, to refresh the left menu
sub theme_post_save_domain
{
local ($d, $action) = @_;
# Refresh left side, in case options have changed
print "&lt;script&gt;\n";
if ($action eq 'create') {
	# Select the new domain
	print "top.left.location = '$gconfig{'webprefix'}/left.cgi?dom=$d-&gt;{'id'}';\n";
	}
else {
	# Just refresh left
	print "top.left.location = top.left.location;\n";
	}
print "&lt;/script&gt;\n";
}

# theme_post_save_domains([domain, action]+)
# Called after multiple domains are updated, to refresh the left menu
sub theme_post_save_domains
{
print "&lt;script&gt;\n";
print "top.left.location = top.left.location;\n";
print "&lt;/script&gt;\n";
}

# theme_post_save_server(&amp;server, action)
# Called by Cloudmin after a server is updated, to refresh the left menu
sub theme_post_save_server
{
local ($s, $action) = @_;
if ($action eq 'create' || $action eq 'delete' ||
    !$done_theme_post_save_server++) {
	print "&lt;script&gt;\n";
	print "top.left.location = top.left.location;\n";
	print "&lt;/script&gt;\n";
	}
}

# theme_select_server(&amp;server)
# Called by Cloudmin when a page for a server is displayed, to select it on the
# left menu.
sub theme_select_server
{
local ($server) = @_;
print &lt;&lt;EOF;
&lt;script&gt;
if (window.parent &amp;&amp; window.parent.frames[0]) {
	var leftdoc = window.parent.frames[0].document;
	var leftform = leftdoc.forms[0];
	if (leftform) {
		var serversel = leftform['sid'];
		if (serversel &amp;&amp; serversel.value != '$server-&gt;{'id'}' ||
		    !serversel) {
			//if (serversel) {
			//	// Need to change value of selector
			//	serversel.value = '$server-&gt;{'id'}';
			//	}
			window.parent.frames[0].location = '$gconfig{'webprefix'}/left.cgi?mode=vm2&amp;sid=$server-&gt;{'id'}';
			}
		}
	}
&lt;/script&gt;
EOF
}

# theme_select_domain(&amp;domain)
# Called by Virtualmin when a page for a server is displayed, to select it on
# the left menu.
sub theme_select_domain
{
local ($d) = @_;
print &lt;&lt;EOF;
&lt;script&gt;
if (window.parent &amp;&amp; window.parent.frames[0]) {
	var leftdoc = window.parent.frames[0].document;
	var leftform = leftdoc.forms[0];
	if (leftform) {
		var domsel = leftform['dom'];
		if (domsel &amp;&amp; domsel.value != '$d-&gt;{'id'}') {
			// Need to change value
			// domsel.value = '$d-&gt;{'id'}';
			window.parent.frames[0].location = '$gconfig{'webprefix'}/left.cgi?mode=virtualmin&amp;dom=$d-&gt;{'id'}';
			}
		}
	}
&lt;/script&gt;
EOF
}

# theme_post_save_folder(&amp;folder, action)
# Called after some folder is changed, to refresh the left frame. The action
# may be 'create', 'delete', 'modify' or 'read'
sub theme_post_save_folder
{
local ($folder, $action) = @_;
my $ref;
if ($action eq 'create' || $action eq 'delete' || $action eq 'modify') {
	# Always refresh
	$ref = 1;
	}
else {
	# Only refesh if showing unread count
	if (defined(&amp;mailbox::should_show_unread) &amp;&amp;
	    &amp;mailbox::should_show_unread($folder)) {
		$ref = 1;
		}
	}
if ($ref) {
	print "&lt;script&gt;\n";
	print "top.frames[0].document.location = top.frames[0].document.location;\n";
	print "&lt;/script&gt;\n";
	}
}

sub theme_post_change_modules
{
print &lt;&lt;EOF;
&lt;script&gt;
var url = '' + top.left.location;
if (url.indexOf('mode=webmin') &gt; 0) {
    top.left.location = url;
    }
&lt;/script&gt;
EOF
}

sub theme_prebody
{
if ($script_name =~ /session_login.cgi/) {
	# Generate CSS link
	print "&lt;link rel='stylesheet' type='text/css' href='$gconfig{'webprefix'}/unauthenticated/gray-reset-fonts-grids-base.css'&gt;\n";
	print "&lt;link rel='stylesheet' type='text/css' href='$gconfig{'webprefix'}/unauthenticated/gray-virtual-server-style.css'&gt;\n";
	print "&lt;!--[if IE]&gt;\n";
	print "&lt;style type=\"text/css\"&gt;\n";
	print "table.formsection, table.ui_table, table.loginform { border-collapse: collapse; }\n";
	print "&lt;/style&gt;\n";
	print "&lt;![endif]--&gt;\n";
	}
if (get_module_name() eq "virtual-server") {
	# No need for Module Index link, as we have the left-side frame
	$tconfig{'nomoduleindex'} = 1;
	}
}

sub theme_prehead
{
print "&lt;link rel='stylesheet' type='text/css' href='$gconfig{'webprefix'}/unauthenticated/gray-reset-fonts-grids-base.css'&gt;\n";
print "&lt;link rel='stylesheet' type='text/css' href='$gconfig{'webprefix'}/unauthenticated/gray-virtual-server-style.css' /&gt;\n";
print "&lt;!--[if IE]&gt;\n";
print "&lt;style type=\"text/css\"&gt;\n";
print "table.formsection, table.ui_table, table.loginform { border-collapse: collapse; }\n";
print "&lt;/style&gt;\n";
print "&lt;![endif]--&gt;\n";
print "&lt;script&gt;\n";
print "var rowsel = new Array();\n";
print "&lt;/script&gt;\n";
print "&lt;script type='text/javascript' src='$gconfig{'webprefix'}/unauthenticated/sorttable.js'&gt;&lt;/script&gt;\n";
if ($ENV{'HTTP_USER_AGENT'} =~ /Chrome/) {
	print "&lt;style type=\"text/css\"&gt;\n";
	print "textarea,pre { font-size:120%; }\n";
	print "&lt;/style&gt;\n";
	}
}

sub theme_popup_prehead
{
return &amp;theme_prehead();
}

# ui_table_start(heading, [tabletags], [cols], [&amp;default-tds], [right-heading])
# A table with a heading and table inside
sub theme_ui_table_start
{
my ($heading, $tabletags, $cols, $tds, $rightheading) = @_;
if (! $tabletags =~ /width/) { $tabletages .= " width=100%"; }
if (defined($main::ui_table_cols)) {
  # Push on stack, for nested call
  push(@main::ui_table_cols_stack, $main::ui_table_cols);
  push(@main::ui_table_pos_stack, $main::ui_table_pos);
  push(@main::ui_table_default_tds_stack, $main::ui_table_default_tds);
  }
my $rv;
my $colspan = 1;

if (!$WRAPPER_OPEN) {
	$rv .= "&lt;table class='shrinkwrapper' $tabletags&gt;\n";
	$rv .= "&lt;tr&gt;&lt;td&gt;\n";
	}
$WRAPPER_OPEN++;
$rv .= "&lt;table class='ui_table' $tabletags&gt;\n";
if (defined($heading) || defined($rightheading)) {
        $rv .= "&lt;thead&gt;&lt;tr&gt;";
        if (defined($heading)) {
                $rv .= "&lt;td&gt;&lt;b&gt;$heading&lt;/b&gt;&lt;/td&gt;"
                }
        if (defined($rightheading)) {
                $rv .= "&lt;td align=right&gt;$rightheading&lt;/td&gt;";
                $colspan++;
                }
        $rv .= "&lt;/tr&gt;&lt;/thead&gt;\n";
        }
$rv .= "&lt;tbody&gt; &lt;tr class='ui_table_body'&gt; &lt;td colspan=$colspan&gt;".
       "&lt;table width=100%&gt;\n";
$main::ui_table_cols = $cols || 4;
$main::ui_table_pos = 0;
$main::ui_table_default_tds = $tds;
return $rv;
}

# ui_table_row(label, value, [cols], [&amp;td-tags])
# Returns HTML for a row in a table started by ui_table_start, with a 1-column
# label and 1+ column value.
sub theme_ui_table_row
{
my ($label, $value, $cols, $tds) = @_;
$cols ||= 1;
$tds ||= $main::ui_table_default_tds;
my $rv;
if ($main::ui_table_pos+$cols+1 &gt; $main::ui_table_cols &amp;&amp;
    $main::ui_table_pos != 0) {
    # If the requested number of cols won't fit in the number
    # remaining, start a new row
    $rv .= "&lt;/tr&gt;\n";
    $main::ui_table_pos = 0;
    }
$rv .= "&lt;tr class='ui_form_pair'&gt;\n" if ($main::ui_table_pos%$main::ui_table_cols == 0);
$rv .= "&lt;td class='ui_form_label' $tds-&gt;[0]&gt;&lt;b&gt;$label&lt;/b&gt;&lt;/td&gt;\n" if (defined($label));
$rv .= "&lt;td class='ui_form_value' colspan=$cols $tds-&gt;[1]&gt;$value&lt;/td&gt;\n";
$main::ui_table_pos += $cols+(defined($label) ? 1 : 0);
if ($main::ui_table_pos%$main::ui_table_cols == 0) {
    $rv .= "&lt;/tr&gt;\n";
    $main::ui_table_pos = 0;
    }
return $rv;
}

# ui_table_end()
# The end of a table started by ui_table_start
sub theme_ui_table_end
{
my $rv;
if ($main::ui_table_cols == 4 &amp;&amp; $main::ui_table_pos) {
  # Add an empty block to balance the table
  $rv .= &amp;ui_table_row(" ", " ");
  }
if (@main::ui_table_cols_stack) {
  $main::ui_table_cols = pop(@main::ui_table_cols_stack);
  $main::ui_table_pos = pop(@main::ui_table_pos_stack);
  $main::ui_table_default_tds = pop(@main::ui_table_default_tds_stack);
  }
else {
  $main::ui_table_cols = undef;
  $main::ui_table_pos = undef;
  $main::ui_table_default_tds = undef;
  }
$rv .= "&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n";
if ($WRAPPER_OPEN==1) {
	#$rv .= "&lt;/div&gt;\n";
	$rv .= "&lt;/td&gt;&lt;/tr&gt;\n";
	$rv .= "&lt;/table&gt;\n";
	}
$WRAPPER_OPEN--;
return $rv;
}

# theme_ui_tabs_start(&amp;tabs, name, selected, show-border)
# Render a row of tabs from which one can be selected. Each tab is an array
# ref containing a name, title and link.
sub theme_ui_tabs_start
{
my ($tabs, $name, $sel, $border) = @_;
my $rv;
if (!$main::ui_hidden_start_donejs++) {
  $rv .= &amp;ui_hidden_javascript();
  }

# Build list of tab titles and names
my $tabnames = "[".join(",", map { "\"".&amp;quote_escape($_-&gt;[0])."\"" } @$tabs)."]";
my $tabtitles = "[".join(",", map { "\"".&amp;quote_escape($_-&gt;[1])."\"" } @$tabs)."]";
$rv .= "&lt;script&gt;\n";
$rv .= "document.${name}_tabnames = $tabnames;\n";
$rv .= "document.${name}_tabtitles = $tabtitles;\n";
$rv .= "&lt;/script&gt;\n";

# Output the tabs
my $imgdir = "$gconfig{'webprefix'}/images";
$rv .= &amp;ui_hidden($name, $sel)."\n";
$rv .= "&lt;table border=0 cellpadding=0 cellspacing=0 class='ui_tabs'&gt;\n";
$rv .= "&lt;tr&gt;&lt;td bgcolor=#ffffff colspan=".(scalar(@$tabs)*2+1)."&gt;";
if ($ENV{'HTTP_USER_AGENT'} !~ /msie/i) {
	# For some reason, the 1-pixel space above the tabs appears huge on IE!
	$rv .= "&lt;img src=$imgdir/1x1.gif&gt;";
	}
$rv .= "&lt;/td&gt;&lt;/tr&gt;\n";
$rv .= "&lt;tr&gt;\n";
$rv .= "&lt;td bgcolor=#ffffff width=1&gt;&lt;img src=$imgdir/1x1.gif&gt;&lt;/td&gt;\n";
foreach my $t (@$tabs) {
	if ($t ne $tabs[0]) {
		# Spacer
		$rv .= "&lt;td width=2 bgcolor=#ffffff class='ui_tab_spacer'&gt;".
		       "&lt;img src=$imgdir/1x1.gif&gt;&lt;/td&gt;\n";
		}
	my $tabid = "tab_".$t-&gt;[0];
	$rv .= "&lt;td id=${tabid} class='ui_tab'&gt;";
	$rv .= "&lt;table cellpadding=0 cellspacing=0 border=0&gt;&lt;tr&gt;";
	if ($t-&gt;[0] eq $sel) {
		# Selected tab
		$rv .= "&lt;td valign=top class='tabSelected'&gt;".
		       "&lt;img src=$imgdir/lc2.gif alt=\"\"&gt;&lt;/td&gt;";
		$rv .= "&lt;td class='tabSelected' nowrap&gt;".
		       "&amp;nbsp;&lt;b&gt;$t-&gt;[1]&lt;/b&gt;&amp;nbsp;&lt;/td&gt;";
		$rv .= "&lt;td valign=top class='tabSelected'&gt;".
		       "&lt;img src=$imgdir/rc2.gif alt=\"\"&gt;&lt;/td&gt;";
		}
	else {
		# Other tab (which has a link)
		$rv .= "&lt;td valign=top class='tabUnselected'&gt;".
		       "&lt;img src=$imgdir/lc1.gif alt=\"\"&gt;&lt;/td&gt;";
		$rv .= "&lt;td class='tabUnselected' nowrap&gt;".
		       "&amp;nbsp;&lt;a href='$t-&gt;[2]' ".
		       "onClick='return select_tab(\"$name\", \"$t-&gt;[0]\")'&gt;".
		       "$t-&gt;[1]&lt;/a&gt;&amp;nbsp;&lt;/td&gt;";
		$rv .= "&lt;td valign=top class='tabUnselected'&gt;".
		       "&lt;img src=$imgdir/rc1.gif ".
		       "alt=\"\"&gt;&lt;/td&gt;";
		$rv .= "&lt;/td&gt;\n";
		}
	$rv .= "&lt;/tr&gt;&lt;/table&gt;";
	$rv .= "&lt;/td&gt;\n";
	}
$rv .= "&lt;td bgcolor=#ffffff width=1&gt;&lt;img src=$imgdir/1x1.gif&gt;&lt;/td&gt;\n";
$rv .= "&lt;/table&gt;\n";

if ($border) {
	# All tabs are within a grey box
	$rv .= "&lt;table width=100% cellpadding=0 cellspacing=0 ".
	       "class='ui_tabs_box'&gt;\n";
	$rv .= "&lt;tr&gt; &lt;td bgcolor=#ffffff rowspan=3 width=1&gt;&lt;img src=$imgdir/1x1.gif&gt;&lt;/td&gt;\n";
	$rv .= "&lt;td $cb colspan=3 height=2&gt;&lt;img src=$imgdir/1x1.gif&gt;&lt;/td&gt; &lt;/tr&gt;\n";
	$rv .= "&lt;tr&gt; &lt;td $cb width=2&gt;&lt;img src=$imgdir/1x1.gif&gt;&lt;/td&gt;\n";
	$rv .= "&lt;td valign=top&gt;";
	}
$main::ui_tabs_selected = $sel;
return $rv;
}

# theme_ui_columns_start(&amp;headings, [width-percent], [noborder], [&amp;tdtags], [title])
# Returns HTML for a multi-column table, with the given headings
sub theme_ui_columns_start
{
my ($heads, $width, $noborder, $tdtags, $title) = @_;
my ($href) = grep { $_ =~ /&lt;a\s+href/i } @$heads;
my $rv;
$theme_ui_columns_row_toggle = 0;
if (!$noborder &amp;&amp; !$COLUMNS_WRAPPER_OPEN) {
	$rv .= "&lt;table class='wrapper' width="
	     . ($width ? $width : "100")
	     . "%&gt;\n";
	$rv .= "&lt;tr&gt;&lt;td&gt;\n";
	}
if (!$noborder) {
	$COLUMNS_WRAPPER_OPEN++;
	}
my @classes;
push(@classes, "ui_table") if (!$noborder);
push(@classes, "sortable") if (!$href);
push(@classes, "ui_columns");
$rv .= "&lt;table".(@classes ? " class='".join(" ", @classes)."'" : "").
    (defined($width) ? " width=$width%" : "")."&gt;\n";
if ($title) {
  $rv .= "&lt;thead&gt; &lt;tr $tb class='ui_columns_heading'&gt;".
	 "&lt;td colspan=".scalar(@$heads)."&gt;&lt;b&gt;$title&lt;/b&gt;&lt;/td&gt;".
	 "&lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt;\n";
  }
$rv .= "&lt;thead&gt; &lt;tr $tb class='ui_columns_heads'&gt;\n";
my $i;
for($i=0; $i&lt;@$heads; $i++) {
  $rv .= "&lt;td ".$tdtags-&gt;[$i]."&gt;&lt;b&gt;".
         ($heads-&gt;[$i] eq "" ? "&lt;br&gt;" : $heads-&gt;[$i])."&lt;/b&gt;&lt;/td&gt;\n";
  }
$rv .= "&lt;/tr&gt;&lt;/thead&gt; &lt;tbody&gt;\n";
$theme_ui_columns_count++;
return $rv;
}

# theme_ui_columns_row(&amp;columns, &amp;tdtags)
# Returns HTML for a row in a multi-column table
sub theme_ui_columns_row
{
$theme_ui_columns_row_toggle = $theme_ui_columns_row_toggle ? '0' : '1';
local ($cols, $tdtags) = @_;
my $rv;
$rv .= "&lt;tr class='ui_columns_row row$theme_ui_columns_row_toggle' onMouseOver=\"this.className='mainhigh'\" onMouseOut=\"this.className='mainbody row$theme_ui_columns_row_toggle'\"&gt;\n";
my $i;
for($i=0; $i&lt;@$cols; $i++) {
	$rv .= "&lt;td ".$tdtags-&gt;[$i]."&gt;".
	       ($cols-&gt;[$i] !~ /\S/ ? "&lt;br&gt;" : $cols-&gt;[$i])."&lt;/td&gt;\n";
	}
$rv .= "&lt;/tr&gt;\n";
return $rv;
}

# theme_ui_columns_end()
# Returns HTML to end a table started by ui_columns_start
sub theme_ui_columns_end
{
my $rv;
$rv = "&lt;/tbody&gt; &lt;/table&gt;\n";
if ($COLUMNS_WRAPPER_OPEN == 1) { # Last wrapper
	$rv .= "&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;\n";
	}
$COLUMNS_WRAPPER_OPEN--;
return $rv;
}

# theme_ui_grid_table(&amp;elements, columns, [width-percent], [tds], [tabletags],
#   [title])
# Given a list of HTML elements, formats them into a table with the given
# number of columns. However, themes are free to override this to use fewer
# columns where space is limited.
sub theme_ui_grid_table
{
my ($elements, $cols, $width, $tds, $tabletags, $title) = @_;
return "" if (!@$elements);
	
my $rv = "&lt;table class='wrapper' " 
       . ($width ? " width=$width%" : " width=100%")
       . ($tabletags ? " ".$tabletags : "")
       . "&gt;&lt;tr&gt;&lt;td&gt;\n";
$rv .= "&lt;table class='ui_table ui_grid_table'"
     . ($width ? " width=$width%" : "")
     . ($tabletags ? " ".$tabletags : "")
     . "&gt;\n";
if ($title) {
	$rv .= "&lt;thead&gt;&lt;tr class='ui_grid_heading'&gt; ".
	       "&lt;td colspan=$cols&gt;&lt;b&gt;$title&lt;/b&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/thead&gt;\n";
	}
$rv .= "&lt;tbody&gt;\n";
my $i;
for($i=0; $i&lt;@$elements; $i++) {
  $rv .= "&lt;tr class='ui_grid_row'&gt;" if ($i%$cols == 0);
  $rv .= "&lt;td ".$tds-&gt;[$i%$cols]." valign=top class='ui_grid_cell'&gt;".
	 $elements-&gt;[$i]."&lt;/td&gt;\n";
  $rv .= "&lt;/tr&gt;" if ($i%$cols == $cols-1);
  }
if ($i%$cols) {
  while($i%$cols) {
    $rv .= "&lt;td ".$tds-&gt;[$i%$cols]." class='ui_grid_cell'&gt;&lt;br&gt;&lt;/td&gt;\n";
    $i++;
    }
  $rv .= "&lt;/tr&gt;\n";
  }
$rv .= "&lt;/table&gt;\n";
$rv .= "&lt;/tbody&gt;\n";
$rv .= "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n"; # wrapper
return $rv;
}

# theme_ui_hidden_table_start(heading, [tabletags], [cols], name, status,
#                             [&amp;default-tds], [rightheading])
# A table with a heading and table inside, and which is collapsible
sub theme_ui_hidden_table_start
{
my ($heading, $tabletags, $cols, $name, $status, $tds, $rightheading) = @_;
my $rv;
if (!$main::ui_hidden_start_donejs++) {
  $rv .= &amp;ui_hidden_javascript();
  }
my $divid = "hiddendiv_$name";
my $openerid = "hiddenopener_$name";
my $defimg = $status ? "open.gif" : "closed.gif";
my $defclass = $status ? 'opener_shown' : 'opener_hidden';
my $text = defined($tconfig{'cs_text'}) ? $tconfig{'cs_text'} :
        defined($gconfig{'cs_text'}) ? $gconfig{'cs_text'} : "000000";
if (!$WRAPPER_OPEN) { # If we're not already inside of a wrapper, wrap it
	$rv .= "&lt;table class='shrinkwrapper' $tabletags&gt;\n";
	$rv .= "&lt;tr&gt;&lt;td&gt;\n";
	}
$WRAPPER_OPEN++;
my $colspan = 1;
$rv .= "&lt;table class='ui_table' $tabletags&gt;\n";
if (defined($heading) || defined($rightheading)) {
	$rv .= "&lt;thead&gt;&lt;tr&gt;";
	if (defined($heading)) {
		$rv .= "&lt;td&gt;&lt;a href=\"javascript:hidden_opener('$divid', '$openerid')\" id='$openerid'&gt;&lt;img border=0 src='$gconfig{'webprefix'}/images/$defimg'&gt;&lt;/a&gt; &lt;a href=\"javascript:hidden_opener('$divid', '$openerid')\" class='ui-hidden-table-title'&gt;&lt;b&gt;$heading&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;";
		}
        if (defined($rightheading)) {
                $rv .= "&lt;td align=right&gt;$rightheading&lt;/td&gt;";
                $colspan++;
                }
	$rv .= "&lt;/tr&gt; &lt;/thead&gt;\n";
	}
$rv .= "&lt;tbody&gt;&lt;tr&gt; &lt;td colspan=$colspan&gt;&lt;div class='$defclass' id='$divid'&gt;&lt;table width=100%&gt;\n";
$main::ui_table_cols = $cols || 4;
$main::ui_table_pos = 0;
$main::ui_table_default_tds = $tds;
return $rv;
}

# ui_hidden_table_end(name)
# Returns HTML for the end of table with hiding, as started by
# ui_hidden_table_start
sub theme_ui_hidden_table_end
{
my ($name) = @_;
local $rv = "&lt;/table&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;\n";
if ( $WRAPPER_OPEN == 1 ) {
	$WRAPPER_OPEN--;
	#$rv .= "&lt;/div&gt;\n";
	$rv .= "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n";
	}
elsif ($WRAPPER_OPEN) { $WRAPPER_OPEN--; }
return $rv;
}

# theme_select_all_link(field, form, text)
# Adds support for row highlighting to the normal select all
sub theme_select_all_link
{
local ($field, $form, $text) = @_;
$form = int($form);
$text ||= $text{'ui_selall'};
return "&lt;a class='select_all' href='#' onClick='f = document.forms[$form]; ff = f.$field; ff.checked = true; r = document.getElementById(\"row_\"+ff.id); if (r) { r.className = \"mainsel\" }; for(i=0; i&lt;f.$field.length; i++) { ff = f.${field}[i]; if (!ff.disabled) { ff.checked = true; r = document.getElementById(\"row_\"+ff.id); if (r) { r.className = \"mainsel\" } } } return false'&gt;$text&lt;/a&gt;";
}

# theme_select_invert_link(field, form, text)
# Adds support for row highlighting to the normal invert selection
sub theme_select_invert_link
{
local ($field, $form, $text) = @_;
$form = int($form);
$text ||= $text{'ui_selinv'};
return "&lt;a class='select_invert' href='#' onClick='f = document.forms[$form]; ff = f.$field; ff.checked = !f.$field.checked; r = document.getElementById(\"row_\"+ff.id); if (r) { r.className = ff.checked ? \"mainsel\" : \"mainbody\" }; for(i=0; i&lt;f.$field.length; i++) { ff = f.${field}[i]; if (!ff.disabled) { ff.checked = !ff.checked; r = document.getElementById(\"row_\"+ff.id); if (r) { r.className = ff.checked ? \"mainsel\" : \"mainbody row\"+((i+1)%2) } } } return false'&gt;$text&lt;/a&gt;";
}

# theme_select_status_link(name, form, &amp;folder, &amp;mails, start, end, status, label)
# Adds support for row highlighting to read mail module selector
# XXX can delete after Usermin 1.400
sub theme_select_status_link
{
local ($name, $formno, $folder, $mail, $start, $end, $status, $label) = @_;
$formno = int($formno);
local @sel;
for(my $i=$start; $i&lt;=$end; $i++) {
	local $read = &amp;get_mail_read($folder, $mail-&gt;[$i]);
	if ($status == 0) {
		push(@sel, ($read&amp;1) ? 0 : 1);
		}
	elsif ($status == 1) {
		push(@sel, ($read&amp;1) ? 1 : 0);
		}
	elsif ($status == 2) {
		push(@sel, ($read&amp;2) ? 1 : 0);
		}
	}
my $js = "var sel = [ ".join(",", @sel)." ]; ";
$js .= "var f = document.forms[$formno]; ";
$js .= "for(var i=0; i&lt;sel.length; i++) { document.forms[$formno].${name}[i].checked = sel[i]; var ff = f.${name}[i]; var r = document.getElementById(\"row_\"+ff.id); if (r) { r.className = ff.checked ? \"mainsel\" : \"mainbody row\"+((i+1)%2) } }";
$js .= "return false;";
return "&lt;a class='select_status' href='#' onClick='$js'&gt;$label&lt;/a&gt;";
}

sub theme_select_rows_link
{
local ($field, $form, $text, $rows) = @_;
$form = int($form);
my $js = "var sel = { ".join(",", map { "\"".&amp;quote_escape($_)."\":1" } @$rows)." }; ";
$js .= "for(var i=0; i&lt;document.forms[$form].${field}.length; i++) { var ff = document.forms[$form].${field}[i]; var r = document.getElementById(\"row_\"+ff.id); ff.checked = sel[ff.value]; if (r) { r.className = ff.checked ? \"mainsel\" : \"mainbody row\"+((i+1)%2) } } ";
$js .= "return false;";
return "&lt;a class='select_rows' href='#' onClick='$js'&gt;$text&lt;/a&gt;";
}

sub theme_ui_checked_columns_row
{
$theme_ui_columns_row_toggle = $theme_ui_columns_row_toggle ? '0' : '1';
local ($cols, $tdtags, $checkname, $checkvalue, $checked, $disabled, $tags) = @_;
my $rv;
my $cbid = &amp;quote_escape(quotemeta("${checkname}_${checkvalue}"));
my $rid = &amp;quote_escape(quotemeta("row_${checkname}_${checkvalue}"));
my $ridtr = &amp;quote_escape("row_${checkname}_${checkvalue}");
my $mycb = $cb;
if ($checked) {
	$mycb =~ s/mainbody/mainsel/g;
	}
$mycb =~ s/class='/class='row$theme_ui_columns_row_toggle ui_checked_columns /;
$rv .= "&lt;tr id=\"$ridtr\" $mycb onMouseOver=\"this.className = document.getElementById('$cbid').checked ? 'mainhighsel' : 'mainhigh'\" onMouseOut=\"this.className = document.getElementById('$cbid').checked ? 'mainsel' : 'mainbody row$theme_ui_columns_row_toggle'\"&gt;\n";
$rv .= "&lt;td class='ui_checked_checkbox' ".$tdtags-&gt;[0]."&gt;".
       &amp;ui_checkbox($checkname, $checkvalue, undef, $checked, $tags." "."onClick=\"document.getElementById('$rid').className = this.checked ? 'mainhighsel' : 'mainhigh';\"", $disabled).
       "&lt;/td&gt;\n";
my $i;
for($i=0; $i&lt;@$cols; $i++) {
	$rv .= "&lt;td ".$tdtags-&gt;[$i+1]."&gt;";
	if ($cols-&gt;[$i] !~ /&lt;a\s+href|&lt;input|&lt;select|&lt;textarea/) {
		$rv .= "&lt;label for=\"".
			&amp;quote_escape("${checkname}_${checkvalue}")."\"&gt;";
		}
	$rv .= ($cols-&gt;[$i] !~ /\S/ ? "&lt;br&gt;" : $cols-&gt;[$i]);
	if ($cols-&gt;[$i] !~ /&lt;a\s+href|&lt;input|&lt;select|&lt;textarea/) {
		$rv .= "&lt;/label&gt;";
		}
	$rv .= "&lt;/td&gt;\n";
	}
$rv .= "&lt;/tr&gt;\n";
return $rv;
}

sub theme_ui_radio_columns_row
{
local ($cols, $tdtags, $checkname, $checkvalue, $checked) = @_;
my $rv;
my $cbid = &amp;quote_escape(quotemeta("${checkname}_${checkvalue}"));
my $rid = &amp;quote_escape(quotemeta("row_${checkname}_${checkvalue}"));
my $ridtr = &amp;quote_escape("row_${checkname}_${checkvalue}");
my $mycb = $cb;
if ($checked) {
	$mycb =~ s/mainbody/mainsel/g;
	}

$mycb =~ s/class='/class='ui_radio_columns /;
$rv .= "&lt;tr $mycb id=\"$ridtr\" onMouseOver=\"this.className = document.getElementById('$cbid').checked ? 'mainhighsel' : 'mainhigh'\" onMouseOut=\"this.className = document.getElementById('$cbid').checked ? 'mainsel' : 'mainbody'\"&gt;\n";
$rv .= "&lt;td ".$tdtags-&gt;[0]." class='ui_radio_radio'&gt;".
       &amp;ui_oneradio($checkname, $checkvalue, undef, $checked, "onClick=\"for(i=0; i&lt;form.$checkname.length; i++) { ff = form.${checkname}[i]; r = document.getElementById('row_'+ff.id); if (r) { r.className = 'mainbody' } } document.getElementById('$rid').className = this.checked ? 'mainhighsel' : 'mainhigh';\"").
       "&lt;/td&gt;\n";
my $i;
for($i=0; $i&lt;@$cols; $i++) {
	$rv .= "&lt;td ".$tdtags-&gt;[$i+1]."&gt;";
	if ($cols-&gt;[$i] !~ /&lt;a\s+href|&lt;input|&lt;select|&lt;textarea/) {
		$rv .= "&lt;label for=\"".
			&amp;quote_escape("${checkname}_${checkvalue}")."\"&gt;";
		}
	$rv .= ($cols-&gt;[$i] !~ /\S/ ? "&lt;br&gt;" : $cols-&gt;[$i]);
	if ($cols-&gt;[$i] !~ /&lt;a\s+href|&lt;input|&lt;select|&lt;textarea/) {
		$rv .= "&lt;/label&gt;";
		}
	$rv .= "&lt;/td&gt;\n";
	}
$rv .= "&lt;/tr&gt;\n";
return $rv;
}

# theme_ui_nav_link(direction, url, disabled)
# Returns an arrow icon linking to provided url
sub theme_ui_nav_link
{
my ($direction, $url, $disabled) = @_;
my $alt = $direction eq "left" ? '&lt;-' : '-&gt;';
if ($disabled) {
  return "&lt;img alt=\"$alt\" align=\"middle\""
       . "src=\"$gconfig{'webprefix'}/images/$direction-grey.gif\"&gt;\n";
  }
else {
  return "&lt;a href=\"$url\"&gt;&lt;img alt=\"$alt\" align=\"top\""
       . "src=\"$gconfig{'webprefix'}/images/$direction.gif\"&gt;&lt;/a&gt;\n";
  }
}

# theme_footer([page, name]+, [noendbody])
# Output a footer for returning to some page
sub theme_footer
{
my $i;
my $count = 0;
my %module_info = get_module_info(get_module_name());
for($i=0; $i+1&lt;@_; $i+=2) {
	local $url = $_[$i];
	if ($url ne '/' || !$tconfig{'noindex'}) {
		if ($url eq '/') {
			$url = "/?cat=$module_info{'category'}";
			}
		elsif ($url eq '' &amp;&amp; get_module_name() eq 'virtual-server' ||
		       $url eq '/virtual-server/') {
			# Don't bother with virtualmin menu
			next;
			}
		elsif ($url eq '' &amp;&amp; get_module_name() eq 'server-manager' ||
		       $url eq '/server-manager/') {
			# Don't bother with Cloudmin menu
			next;
			}
		elsif ($url =~ /(view|edit)_domain.cgi/ &amp;&amp;
		       get_module_name() eq 'virtual-server' ||
		       $url =~ /^\/virtual-server\/(view|edit)_domain.cgi/) {
			# Don't bother with link to domain details
			next;
			}
		elsif ($url =~ /edit_serv.cgi/ &amp;&amp;
		       get_module_name() eq 'server-manager' ||
		       $url =~ /^\/virtual-server\/edit_serv.cgi/) {
			# Don't bother with link to system details
			next;
			}
		elsif ($url eq '' &amp;&amp; get_module_name()) {
			$url = "/".get_module_name()."/".
			       $module_info{'index_link'};
			}
		elsif ($url =~ /^\?/ &amp;&amp; get_module_name()) {
			$url = "/".get_module_name()."/$url";
			}
		$url = "$gconfig{'webprefix'}$url" if ($url =~ /^\//);
		if ($count++ == 0) {
			print theme_ui_nav_link("left", $url);
			}
		else {
			print "&amp;nbsp;|\n";
			}
		print "&amp;nbsp;&lt;a href=\"$url\"&gt;",&amp;text('main_return', $_[$i+1]),"&lt;/a&gt;\n";
		}
	}
print "&lt;br&gt;\n";
if (!$_[$i]) {
	print "&lt;/body&gt;&lt;/html&gt;\n";
	}
}

# Don't show virtualmin menu
sub theme_redirect
{
local ($orig, $url) = @_;
if (get_module_name() eq "virtual-server" &amp;&amp; $orig eq "" &amp;&amp;
    $url =~ /^((http|https):\/\/([^\/]+))\//) {
	$url = "$1/right.cgi";
	}
print "Location: $url\n\n";
}

# theme_ui_hidden_javascript()
# Returns &lt;script&gt; and &lt;style&gt; sections for hiding functions and CSS
sub theme_ui_hidden_javascript
{
my $rv;
my $imgdir = "$gconfig{'webprefix'}/images";

return &lt;&lt;EOF;
&lt;style&gt;
.opener_shown {display:inline}
.opener_hidden {display:none}
&lt;/style&gt;
&lt;script&gt;
// Open or close a hidden section
function hidden_opener(divid, openerid)
{
var divobj = document.getElementById(divid);
var openerobj = document.getElementById(openerid);
if (divobj.className == 'opener_shown') {
  divobj.className = 'opener_hidden';
  openerobj.innerHTML = '&lt;img border=0 src=$imgdir/closed.gif&gt;';
  }
else {
  divobj.className = 'opener_shown';
  openerobj.innerHTML = '&lt;img border=0 src=$imgdir/open.gif&gt;';
  }
}

// Show a tab
function select_tab(name, tabname, form)
{
var tabnames = document[name+'_tabnames'];
var tabtitles = document[name+'_tabtitles'];
for(var i=0; i&lt;tabnames.length; i++) {
  var tabobj = document.getElementById('tab_'+tabnames[i]);
  var divobj = document.getElementById('div_'+tabnames[i]);
  var title = tabtitles[i];
  if (tabnames[i] == tabname) {
    // Selected table
    tabobj.innerHTML = '&lt;table cellpadding=0 cellspacing=0&gt;&lt;tr&gt;'+
		       '&lt;td valign=top class=\\'tabSelected\\'&gt;'+
		       '&lt;img src=$imgdir/lc2.gif alt=""&gt;&lt;/td&gt;'+
		       '&lt;td class=\\'tabSelected\\' nowrap&gt;'+
		       '&amp;nbsp;&lt;b&gt;'+title+'&lt;/b&gt;&amp;nbsp;&lt;/td&gt;'+
	               '&lt;td valign=top class=\\'tabSelected\\'&gt;'+
		       '&lt;img src=$imgdir/rc2.gif alt=""&gt;&lt;/td&gt;'+
		       '&lt;/tr&gt;&lt;/table&gt;';
    divobj.className = 'opener_shown';
    }
  else {
    // Non-selected tab
    tabobj.innerHTML = '&lt;table cellpadding=0 cellspacing=0&gt;&lt;tr&gt;'+
		       '&lt;td valign=top class=\\'tabUnselected\\'&gt;'+
		       '&lt;img src=$imgdir/lc1.gif alt=""&gt;&lt;/td&gt;'+
		       '&lt;td class=\\'tabUnselected\\' nowrap&gt;'+
                       '&amp;nbsp;&lt;a href=\\'\\' onClick=\\'return select_tab("'+
		       name+'", "'+tabnames[i]+'")\\'&gt;'+title+'&lt;/a&gt;&amp;nbsp;&lt;/td&gt;'+
		       '&lt;td valign=top class=\\'tabUnselected\\'&gt;'+
    		       '&lt;img src=$imgdir/rc1.gif alt=""&gt;&lt;/td&gt;'+
		       '&lt;/tr&gt;&lt;/table&gt;';
    divobj.className = 'opener_hidden';
    }
  }
if (document.forms[0] &amp;&amp; document.forms[0][name]) {
  document.forms[0][name].value = tabname;
  }
return false;
}
&lt;/script&gt;
EOF
}

# XXX Temporary until ui-lib.pl valign stuff gets cleaned up
#
# theme_ui_columns_table(&amp;headings, width-percent, &amp;data, &amp;types, no-sort, title,
#		   empty-msg)
# Returns HTML for a complete table.
# headings - An array ref of heading HTML
# width-percent - Preferred total width
# data - A 2x2 array ref of table contents. Each can either be a simple string,
#        or a hash ref like :
#          { 'type' =&gt; 'group', 'desc' =&gt; 'Some section title' }
#          { 'type' =&gt; 'string', 'value' =&gt; 'Foo', 'colums' =&gt; 3,
#	     'nowrap' =&gt; 1 }
#          { 'type' =&gt; 'checkbox', 'name' =&gt; 'd', 'value' =&gt; 'foo',
#            'label' =&gt; 'Yes', 'checked' =&gt; 1, 'disabled' =&gt; 1 }
#          { 'type' =&gt; 'radio', 'name' =&gt; 'd', 'value' =&gt; 'foo', ... }
# types - An array ref of data types, such as 'string', 'number', 'bytes'
#         or 'date'
# no-sort - Set to 1 to disable sorting by theme
# title - Text to appear above the table
# empty-msg - Message to display if no data
sub theme_ui_columns_table
{
my ($heads, $width, $data, $types, $nosort, $title, $emptymsg) = @_;
my $rv;

# Just show empty message if no data
if ($emptymsg &amp;&amp; !@$data) {
	$rv .= &amp;ui_subheading($title) if ($title);
	$rv .= "&lt;b&gt;$emptymsg&lt;/b&gt;&lt;p&gt;\n";
	return $rv;
	}

# Are there any checkboxes in each column? If so, make those columns narrow
my @tds;
my $maxwidth = 0;
foreach my $r (@$data) {
	my $cc = 0;
	foreach my $c (@$r) {
		if (ref($c) &amp;&amp;
		    ($c-&gt;{'type'} eq 'checkbox' || $c-&gt;{'type'} eq 'radio')) {
			$tds[$cc] .= " width=5" if ($tds[$cc] !~ /width=/);
			}
		$cc++;
		}
	$maxwidth = $cc if ($cc &gt; $maxwidth);
	}
$rv .= &amp;ui_columns_start($heads, $width, 0, \@tds, $title);

# Add the data rows
foreach my $r (@$data) {
	my $c0;
	if (ref($r-&gt;[0]) &amp;&amp; ($r-&gt;[0]-&gt;{'type'} eq 'checkbox' ||
			     $r-&gt;[0]-&gt;{'type'} eq 'radio')) {
		# First column is special
		$c0 = $r-&gt;[0];
		$r = [ @$r[1..(@$r-1)] ];
		}
	# Turn data into HTML
	my @rtds = @tds;
	my @cols;
	my $cn = 0;
	$cn++ if ($c0);
	foreach my $c (@$r) {
		if (!ref($c)) {
			# Plain old string
			push(@cols, $c);
			}
		elsif ($c-&gt;{'type'} eq 'checkbox') {
			# Checkbox in non-first column
			push(@cols, &amp;ui_checkbox($c-&gt;{'name'}, $c-&gt;{'value'},
					         $c-&gt;{'label'}, $c-&gt;{'checked'},
						 $c-&gt;{'tags'},
						 $c-&gt;{'disabled'}));
			}
		elsif ($c-&gt;{'type'} eq 'radio') {
			# Radio button in non-first column
			push(@cols, &amp;ui_oneradio($c-&gt;{'name'}, $c-&gt;{'value'},
					         $c-&gt;{'label'}, $c-&gt;{'checked'},
						 $c-&gt;{'tags'},
						 $c-&gt;{'disabled'}));
			}
		elsif ($c-&gt;{'type'} eq 'group') {
			# Header row that spans whole table
			$rv .= &amp;ui_columns_header([ $c-&gt;{'desc'} ],
						  [ "colspan=$width" ]);
			next;
			}
		elsif ($c-&gt;{'type'} eq 'string') {
			# A string, which might be special
			push(@cols, $c-&gt;{'value'});
			if ($c-&gt;{'columns'} &gt; 1) {
				splice(@rtds, $cn, $c-&gt;{'columns'},
				       "colspan=".$c-&gt;{'columns'});
				}
			if ($c-&gt;{'nowrap'}) {
				$rtds[$cn] .= " nowrap";
				}
			}
		$cn++;
		}
	# Add the row
	if (!$c0) {
		$rv .= &amp;ui_columns_row(\@cols, \@rtds);
		}
	elsif ($c0-&gt;{'type'} eq 'checkbox') {
		$rv .= &amp;ui_checked_columns_row(\@cols, \@rtds, $c0-&gt;{'name'},
					       $c0-&gt;{'value'}, $c0-&gt;{'checked'},
					       $c0-&gt;{'disabled'},
					       $c0-&gt;{'tags'});
		}
	elsif ($c0-&gt;{'type'} eq 'radio') {
		$rv .= &amp;ui_radio_columns_row(\@cols, \@rtds, $c0-&gt;{'name'},
					     $c0-&gt;{'value'}, $c0-&gt;{'checked'},
					     $c0-&gt;{'disabled'},
					     $c0-&gt;{'tags'});
		}
	}

$rv .= &amp;ui_columns_end();
return $rv;
}

=yui

Functions for generating YUI CSS grids markup.

=cut

# ui_yui_grid_start(id, type)
# Return a yui grid opening div.
# Available types are:
# g - 1/2,1/2
# gb - 1/3, 1/3, 1/3
# gc - 2/3, 1/3
# gd - 1/3, 2/3
# ge - 3/4, 1/4
# gf - 1/4, 3/4
sub theme_ui_yui_grid_start {
	my ($id, $type) = @_;
	return "&lt;div id='grid_$id' class='yui-$type'&gt;\n";
}

sub theme_ui_yui_grid_end {
	my ($id) = @_;
	return "&lt;/div&gt; &lt;!-- grid_$id --&gt;\n";
}

# ui_yui_grid_section_start(id, first?)
# Return a yui grid markup section opening div.
sub theme_ui_yui_grid_section_start {
	my ($id, $first) = @_;
	if ($first) { return "&lt;div id='grid_$id' class='yui-u first'&gt;\n"; }
	else { return "&lt;div id='grid_$id' class='yui-u'&gt;\n"; }
}
sub theme_ui_yui_grid_section_end {
	my ($id) = @_;
	return "&lt;/div&gt; &lt;!-- grid_$id --&gt;\n";
}

1;

</pre></body></html>