+% my $mapname = "$username-$date";
+% my $img = "$RT::WebPath/Schedule/UserBar?Username=$username;Date=$date";
+ <span class="calendarright"
+ ><% $username %><img src = "<%$img|n%>"
+ useMap = "#<%$mapname%>"
+ height = <%$height%>
+ width = <%$width%>
+ ></span><br>
+
+ <MAP name="<%$mapname%>">
+
+% my %schedule = UserDaySchedule( CurrentUser => $CurrentUser,
+% username => $username,
+% 'date' => $date, #$Date->strftime('%F'),
+% );
+%
+% #block out / show / color code existing appointments
+% foreach my $id ( keys %{ $schedule{'scheduled'} } ) {
+% my( $starts, $due, $col, $t ) = @{ $schedule{'scheduled'}->{$id} };
+% my $s = int(($starts-$stime)/10);
+% my $e = int(($due-$stime)/10)-1;
+
+% #false laziness w/misc/xmlhttp-ticket-update.html & CalendarSlotSchedule
+% my %hash = $m->comp('/Ticket/Elements/Customers', Ticket => $t);
+% my @cust_main = values( %{$hash{cust_main}} );
+
+ <AREA
+ onmouseover = "overlib('<% FS::sched_avail::pretty_time($starts). '-'. FS::sched_avail::pretty_time($due) %><BR>' + <% $cust_main[0]->_FreesideURILabel |js_string %>, WRAP, BGCOLOR, '#000000', FGCOLOR, '#<%$col%>')"
+ onmouseout = "nd(); return true;"
+ shape = "rect"
+ coords = "<%$s%>,0,<%$e%>,<%$height%>"
+%# href = "test_href"
+%# alt =
+%# title =
+ >
+% }
+%
+% #white out available times
+% foreach my $avail ( @{ $schedule{'avail'} } ) {
+% my( $start, $end ) = @$avail;
+%
+% my $s = $start >= $stime ? int(($start-$stime)/10) : 0;
+% my $e = int(($end-$stime)/10)-1;
+ <AREA
+ onmouseover = "overlib('Available', WRAP, BGCOLOR, '#000000', FGCOLOR, '#FFFFFF')"
+ onmouseout = "nd(); return true;"
+ shape = "rect"
+ coords = "<%$s%>,0,<%$e%>,<%$height%>"
+%# XXX link to book - if the appointment we want can fit
+%# href = "test_href"
+%# alt =
+%# title =
+ >
+% }
+
+ <AREA
+ onmouseover = "overlib('Not available', WRAP, BGCOLOR, '#000000', FGCOLOR, '#666666', TEXTCOLOR, '#FFFFFF' )"
+ onmouseout = "nd(); return true;"
+ shape = "default"
+%# href = "test_href"
+%# alt =
+%# title =
+ >
+
+ </MAP>
+