%# Dope will get you through times of no money better that money will get
%# you through times of no dope.  -- Gilbert Shelton

<& /RG/Elements/PageHeader, BGColor => '#7CBEBE' &>

<table class="poptable" width=100% bgcolor="#7CBEBE" border=0 cellspacing=0 cellpadding=2><tr valign=top><td width="2">&nbsp;</td><td valign="top" width="100%">
<form name="thisform" action="/RG/Report/View.html#<% $ClauseId ? "Clause$ClauseId" : "Part$PartId" %>" method='post' enctype="multipart/form-data" target="view" style="margin: 0">
<input type="hidden" name="Op" value="<% $Type %>Change">
<input type="submit" name="go" id="go" value="go" style="display: none">

% my $PartTag = $ContentObj->PartObj->tag;
% if (defined($PartTag) and ($session{reportPartTag} ne $PartTag)) {
%     $session{reportPartTag} = $PartTag;
<script><!--
if (parent.toolbar) {
    parent.toolbar.location.href="Toolbar.html?PartTag=<% $PartTag %>";
}
--></script>
% }

% my $last_att = ($Obj->Atts)[-1];
% foreach my $att ($Obj->Atts) {
%     my $item = $Obj->Att($att);
%     my $current = $item->Value;
%     $current = $item->Default unless defined $current;
%     next unless $item->Type and $item->Applicable;
%     my $is_last = ($att eq $last_att);
<span style="display: none; font-size: 0">|</span>
<table style="display: inline" cellspacing=0 cellpadding=0 border=0><tr><td><nobr><& "Property/" . $Obj->ucase($item->Type),
    ContentObj	    => $ContentObj,
    Object	    => $Obj,
    Item	    => $item,
    Current	    => $current,
    IsLast	    => $is_last &>
% if (!$is_last) {
</nobr></td><td><nobr>
<& /RG/Elements/VerticalBar &>
% }
</nobr></td></tr></table>
% }

</td><td align="right" width="<%
    ($Obj->Att($last_att)->Type !~ /upload|text/) ? '100%' : 10
%>">
<& /RG/Elements/VerticalBar3D &>
</td><td width="1"><nobr>
<& /RG/Elements/Submit,
    Op		=> "${Type}Change",
    Text	=> "Change",
    BGColor	=> '#7CBEBE',
&>
<& /RG/Elements/Submit,
    Op		=> "${Type}Up",
    Text	=> "Up",
    Disabled	=> !( $Obj and $Obj->prev_sibling ),
    BGColor	=> '#7CBEBE',
&>
<& /RG/Elements/Submit,
    Op		=> "${Type}Down",
    Text	=> "Down",
    Disabled	=> !( $Obj and $Obj->next_sibling ),
    BGColor	=> '#7CBEBE',
&>
<& /RG/Elements/Submit,
    Op		=> "${Type}Remove",
    Text	=> "Remove",
    BGColor	=> '#7CBEBE',
&>

</nobr></td></tr></table>
</form>

<%INIT>
our $DB;
my $ReportObj = $DB->ReportObj($session{reportId});
my $ContentObj = DBIx::ReportBuilder->new(
    Handle	=> $ReportObj->HandleObj,
    SearchHook	=> $ReportObj->SearchHook,
    Content	=> $session{reportContent},
    PartId	=> $PartId,
    ClauseId	=> $ClauseId,
    Loc         => \&loc,
);
$session{reportPartId} = $ContentObj->PartId;
$session{reportClauseId} = $ContentObj->ClauseId;
my $Obj = $ClauseId ? $ContentObj->ClauseObj : $ContentObj->PartObj or return;
my $Type = "";
$Type = 'Clause' if $ClauseId;

</%INIT>
<%ARGS>
$PartId	    => $session{reportPartId}
$ClauseId   => 0
</%ARGS>
