I have this bit of php that works fine as is but I would like to separate out the javascript calls to an onLoad function.
<?php
include("casefile.class");
$cf = new casefile_Rec;
$seclogin=$sess->getSessVar("seclogin");
if ($cf->primary_case_list($seclogin["uname"])) {
echo "<ul>";
while ($row = mysql_fetch_assoc($cf->res)) {
if ($aLine=="evenListing") { $aLine="oddListing";
} else { $aLine="evenListing"; }
printf("<div class=\"%s\">\n", $aLine);
printf("<li><a onClick=\"wcmsJS.showCaseSummary('%s');\"
onDblClick=\"caseWindow('view&cnmbr=%s');\">%s</a> %s %s %s %s</li></div>",
$row["casenmbr"], $row["casenmbr"], $row["casecode"], $row["cswcab"], $row["csstamp"], $row["csclaim"], $row["casetyp_code"]);
}
echo "</ul>";
} else { echo "You have no Open Cases in the System<br>"; }
?>
This displays an unordered list of records, with alternating colors. Each element of the list has two events, onClick and onDblClick. Because the list is dynamic I have not assigned and id to each discrete <div>. An id is necessary for all event listeners I've seen so my question is what is a good way to create an array of objects and utilize the array in an onLoad (and onUnload) function.