This is from http://dean.edwards.name/IE7 and it saved the day for me at one point. I am working to get away from using it since it causes a jump in IE by the menus but is also how I got them working in IE.
function addLoadEvent(onloadFunction) {
/*
this code is based on www.sitepoint.com/blogs/2004/05/26/
closures-and-executing-javascript...
*/
var holdOnload = window.onload;
if (typeof window.onload != 'function') {
window.onload = onloadFunction;
}
else {
window.onload = function() {
holdOnload();
onloadFunction();
}
}
}
function dropDown() {
//first check if this is an IE browser
if (document.all && document.getElementById("dropmenu").currentStyle) {
var menuTree = document.getElementById("dropmenu");
var liEntries = menuTree.getElementsByTagName("LI");
for (i=0;i
Warning: This is only the second php code I wrote, although I cloned and changed code from Tom deLombarde.
pointer)) {
$ret = ''.$nl;
$ret .= ''.$nl.'';
if(trim($result->display) != '')
$row = $result->display;
else
$row = $result->headers;
if(strpos($row, AM)) {
$row = explode(AM, $row);
$mx = sizeof($row);
} else {
$row[0] = $row;
$mx = 1;
}
// build the header row while building the cell alignments
$fm = $result->formats;
if(strstr($fm, AM)) {
$fm = explode(AM, $fm);
} else {
$fm[0] = $fm;
}
for($ct = 0; $ct < $mx; $ct++) {
$fmt = $fm[$ct];
$ln = strlen($fmt);
$al = substr($fmt, $ln -1, 1);
switch(strtoupper($al)) {
case 'C':
$aln[$ct] = ' class="cellcenter"';
break;
case 'R':
$aln[$ct] = ' class="cellright"';
break;
default:
$aln[$ct] = ' class="cellleft"';
}
$ret .= ''.$row[$ct].' '.$nl;
}
$ret .= ' '.$nl.''.$nl;
// header built, now draw the body of the table
//$cl = $clo; // start with odd row style
$cl = 'tr class="cle"';
$rows = $result->results;
if(is_Array($rows)) {
$mz = sizeof($rows);
} else {
$rows[0] = $rows;
$mz = 1;
}
for($rx = 0; $rx < $mz; $rx++) {
if($cl == 'tr class="clo"')
$cl = 'tr class="cle"';
else
$cl = 'tr class="clo"';
$ret .= '<'.$cl.'>';
$row = $rows[$rx];
if(strstr($row, AM)) {
$row = explode(AM, $row);
$mx = sizeof($row);
} else {
$row[0] = $row;
$mx = 1;
}
for($ct = 0; $ct < $mx; $ct++) {
if(trim($row[$ct]) == '')
$row[$ct] = ' ';
$trw = str_replace(VM, "
\n", $row[$ct]);
$trw = str_replace(SM, "
\n", $trw);
$ret .= ''.$trw.' '.$nl;
}
$ret .= ''.$nl;
// $ret .= $nl;
}
$ret .= '
'.$nl;
} else {
$_emg='Object passed to fetch_table() is not a valid QM result.
';
trigger_error($_emg, E_USER_WARNING);
$ret = FALSE;
}
return $ret;
} // end fetch_table()
?>
This php4 code was written by Tom deLombarde. E-mail me at tincat@tincat-group.com if you are running OpenQM and I will contact the author if you are interested in using it.