1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
// otl_handler javascript functions
var scroll = new Array();
var itemcount = 0;
function init_page()
{
if (! document.getElementById ) return false;
var spans = document.getElementsByTagName('span');
for (i = 0; i < spans.length; i++) {
var id = spans[i].getAttribute('id');
if (id == null || id == "") continue;
if (id.indexOf("itemtoplevel_") == -1) continue;
// ie doesn't support negative substr positions :\
// var num = id.substr(-1, 1);
var num = id.substr(13, 1);
var itemtoplevel = spans[i];
var itemgroup = document.getElementById("itemgroup_" + num);
if (! itemtoplevel || ! itemgroup) continue;
itemcount++;
itemgroup.style.display = 'none';
itemgroup.style.overflow = 'auto';
itemtoplevel.onmouseover = function() { this.className = 'level0_over'; }
itemtoplevel.onmouseout = function() { this.className = 'level0'; }
itemtoplevel.onmouseup = function() { this.className = 'level0'; toggle(this); return false; }
itemtoplevel.onselectstart = function() { return false; }
}
return;
}
function toggle(i)
{
var ig = document.getElementById( i.id.replace("toplevel", "group") );
if (! ig ) return;
var num = ig.id.substr(10,1);
// show
if (ig.style.display == "" ||
ig.style.display == "none") {
ig.style.height = "0pt";
ig.style.display = 'block';
grow(num);
// hide others
for (i = 0; i != itemcount; i++) {
if (i != num) shrink(i);
}
}
// hide
else {
shrink(num);
}
return;
}
function grow(num)
{
var ig = document.getElementById( "itemgroup_" + num );
if (! ig ) return;
scroll[num] = 1;
var curheight = parseInt(ig.style.height.replace("pt", ""));
if (curheight >= 250) {
scroll[num] = 0;
return;
}
var newheight = curheight + 25 + "pt";
ig.style.height = newheight;
setTimeout("grow(" + num + ")", 30);
return;
}
function shrink(num)
{
var ig = document.getElementById( "itemgroup_" + num );
if (! ig ) return;
if (scroll[num] == 1) return;
var curheight = parseInt(ig.style.height.replace("pt", ""));
if (curheight == 0) {
ig.style.display = 'none';
return;
}
var newheight = curheight - 50 + "pt";
ig.style.height = newheight;
setTimeout("shrink(" + num + ")", 30);
return;
}
|