function updposition(delayed) {
if (typeof(document.flymenus) != 'undefined') {
hidden = new Array();
for (var i = 0; i < document.flymenus.length; i++) {
hidden[i] = document.flymenus[i].shide(true);
}
for (var i = 0; i < document.flymenus.length; i++) {
document.flymenus[i].up();
}
for (var i = 0; i < document.flymenus.length; i++) {
if (!hidden[i])
document.flymenus[i].show();
}
}
}
function objpos(obj) {
if (obj.offsetParent.tagName == 'BODY') {
return new Array(obj.offsetLeft, obj.offsetTop);
} else {
cps = objpos(obj.offsetParent);
cps[0] += obj.offsetLeft;
cps[1] += obj.offsetTop;
return cps;
}
}
function flyer(name, parentname, x, y, pos, dsp, val, hal, stl, txt, delay, zindex, snaptb, snaptp) {
this.name = name;
this.parentname = parentname;
this.delay = delay;
this.zindex = zindex;
this.snaptb = snaptb;
this.snaptp = snaptp;
this.val = val;
this.hal = hal;
nav = new navi();
this.pos = pos;
this.dsp = dsp;
this.stl = stl;
this.txt = txt;
this.css = false;
this.obj = false;
this.cnt = -1;
this.pt = pt;
this.mv = mv;
this.hide = hide;
this.show = show;
this.init = init;
function pt(x, y) {
if (this.obj) {
if (!isNaN(x)) {
this.x = x;
this.obj.style.left = x + 'px';
}
if (!isNaN(y)) {
this.y = y;
this.obj.style.top = y + 'px';
}
}
}
function mv(x, y) {
this.pt((this.x += x), (this.y += y));
}
function hide() {
if (this.obj) {
this.css.display = 'none';
}
}
function show() {
if (this.obj) {
this.css.display = '';
}
}
function init() {
if (!this.initf) {
var divt = '';
if (nav.nn4) {
if (this.pos == 'relative') {
divt += '';
}
divt += '' + this.txt + '';
if (this.pos == 'relative') {
divt += '';
}
} else {
divt += '
' + this.txt + '
';
}
document.write(divt);
this.obj = getobj(this.name);
this.css = getcss(this.obj);
if (!document.flyers) document.flyers = new Array();
document.flyers[document.flyers.length] = this;
this.cnt = document.flyers.length - 1;
}
}
}
function flymenu(name, x, y, wd, hg, val, hal, xoff, yoff, delay, nohide, parent, zindex, snaptb, snaptp) {
this.name = name;
this.x = x;
this.y = y;
this.inix = x;
this.iniy = y;
this.wd = wd;
this.hg = hg;
this.val = val;
this.hal = hal;
this.xoff = xoff;
this.yoff = yoff;
this.delay = delay;
this.nohide = nohide;
this.parentname = parent;
this.zindex = zindex;
this.snaptb = snaptb;
this.snaptp = snaptp;
this.hidden = true;
this.items = new Array();
this.activeitems = new Array();
this.submenus = new Array();
this.itmo = false;
this.itmm = false;
this.itmp = false;
this.obj = false;
this.cnt = -1;
nav = new navi();
this.styleover = false;
this.styleout = false;
this.bg = '';
this.cs = 0;
this.cp = 0;
this.sx = sx;
this.sy = sy;
this.pt = pt;
this.mv = mv;
this.up = up;
this.ur = ur;
this.additem = additem;
this.addactiveitem = addactiveitem;
this.popactiveitem = popactiveitem;
this.shiftactiveitem = shiftactiveitem;
this.addsubmenu = addsubmenu;
this.allhidden = allhidden;
this.shide = shide;
this.hide = hide;
this.show = show;
this.setstyleover = setstyleover;
this.setstyleout = setstyleout;
this.setstyle = setstyle;
this.honmouseover = honmouseover;
this.honmouseout = honmouseout;
this.init = init;
if (!document.flymenus) document.flymenus = new Array();
document.flymenus[document.flymenus.length] = this;
this.cnt = document.flymenus.length - 1;
function sx(x) {
this.x = x;
this.obj.x = x;
}
function sy(y) {
this.y = y;
this.obj.y = y;
}
function pt(x, y) {
this.obj.pt(x, y);
}
function mv(x, y) {
this.obj.mv(x, y);
}
function up(oninit) {
if (this.snaptb) {
sno = getobj('s' + this.name);
if (sno) {
cps = objpos(sno);
dx = cps[0];
dy = cps[1];
this.ur(dx, dy);
}
} else if (this.snaptp) {
} else {
nav = new navi();
cw = (oninit ? nav.width : Math.max(nav.width, nav.scrollWidth));
ch = (oninit ? nav.height : Math.max(nav.height, nav.scrollHeight));
switch (this.val) {
case 'left':
dx = 0;
break;
case 'right':
dx = cw;
break;
case 'center':
dx = Math.floor(cw / 2);
break;
default:
dx = 0;
break;
}
switch (this.hal) {
case 'top':
dy = 0;
break;
case 'bottom':
dy = dy;
break;
case 'middle':
dy = Math.floor(ch / 2);
if (nav.nn4) dy -= 8;
break;
default:
dy = 0;
break;
}
if (this.obj) {
this.pt(this.inix + dx, this.iniy + dy);
} else {
this.sx(this.inix + dx);
this.sy(this.iniy + dy);
}
}
}
function ur(dx, dy) {
for (var j = 0; j < this.submenus.length; j++) {
child = eval(this.submenus[j]);
child.ur(dx, dy);
}
if (this.snaptp) {
dx += this.inix;
dy += this.iniy;
}
if (this.obj) {
this.pt(dx, dy);
} else {
this.sx(dx);
}
}
function menuitem(href, targ, text, valg, styl, nrow, omover, omout, submenu) {
this.href = href;
this.targ = targ;
this.text = text;
this.valg = valg;
this.styl = styl;
this.nrow = nrow;
this.omover = omover;
this.omout = omout;
this.submenu = submenu;
}
function additem(href, targ, text, valg, styl, nrow, omover, omout, submenu) {
if (submenu != '') {
this.submenus[this.submenus.length] = submenu;
}
return (this.items[this.items.length] = new menuitem(href, targ, text, valg, styl, nrow, omover, omout, submenu));
}
function addactiveitem(item) {
this.activeitems[this.activeitems.length] = item;
return this.activeitems[this.activeitems];
}
function popactiveitem() {
alert(this.activeitems.pop);
return this.activeitems.pop();
}
function shiftactiveitem() {
var nitems = new Array();
for (i = 0; i < (this.activeitems.length - 1); i++) {
nitems[i] = this.activeitems[i];
}
var item = this.activeitems[this.activeitems.length - 1];
this.activeitems = nitems;
return item;
}
function addsubmenu(submenu) {
if (submenu != '') {
this.submenus[this.submenus.length] = submenu;
}
}
function allhidden(test) {
if (this.submenus) {
if (test == 'test') alert(this.submenus.length);
for (i = 0; i < this.submenus.length; i++) {
child = eval(this.submenus[i]);
if (child.hidden == false) return false;
}
}
return true;
}
function shide(now) {
state = this.hidden;
if (!this.itmp || now) {
if ((this.obj && !this.itmo && !this.itmm && this.allhidden()) || now) {
this.hidden = true;
parent = eval(this.parentname);
if (parent && parent.styleover) {
for (i = 0; i < parent.activeitems.length; i++) {
if (parent.items[parent.activeitems[i]].submenu == this.name) {
css = getcss(getobj(parent.name + '_' + parent.shiftactiveitem()));
css.background = parent.styleout.bg;
css.border = parent.styleout.br;
css.color = parent.styleout.cl;
}
}
}
this.obj.hide();
} else {
this.hide();
}
}
return state;
}
function hide() {
if (!this.nohide) {
this.itmp = false;
setTimeout('document.flymenus[' + this.cnt + '].shide()', this.delay);
}
}
function show() {
if (this.obj) {
this.itmp = true;
this.hidden = false;
this.obj.show();
}
}
function createstyle(bg, br, cl) {
this.bg = bg;
this.br = br;
this.cl = cl;
}
function setstyleover(bg, br, cl) {
this.styleover = new createstyle(bg, br, cl);
}
function setstyleout(bg, br, cl) {
this.styleout = new createstyle(bg, br, cl);
}
function setstyle(bg, cp, cs) {
this.bg = bg;
this.cp = cp;
this.cs = cs;
}
function honmouseover() {
document.flymenus[this.parent].itmm = true;
}
function honmouseout() {
document.flymenus[this.parent].itmm = false;
}
function init() {
var mnu = '';
if (nav.nn4) {
document.write('');
}
thg = 0;
for (i = 0; i < this.items.length; i++) thg += this.items[i].nrow;
mnu += '';
mnu += '' + "\n";
for (i = 0; i < this.items.length; i++) {
if (this.items[i].nrow && (i != 0)) mnu += ' ';
if (!nav.nn4) {
if (this.items[i].submenu != '') {
omover = ' onmouseover="clearall(' + this.name + ');' + ((this.styleover) ? ('this' + getevalcss() + '.background = \'' + this.styleover.bg + '\'; this' + getevalcss() + '.border = \'' + this.styleover.br + '\'; this' + getevalcss() + '.color = \'' + this.styleover.cl + '\'; document.flymenus[' + this.cnt + '].addactiveitem(' + i + '); ') : ('')) + this.items[i].submenu + '.show()' + this.items[i].omover + ';"';
omout = ' onmouseout="' + this.items[i].submenu + '.hide()' + this.items[i].omout + ';"';
} else {
omover = ' onmouseover="clearall(' + this.name + ');' + ((this.styleover) ? ('this' + getevalcss() + '.background = \'' + this.styleover.bg + '\'; this' + getevalcss() + '.border = \'' + this.styleover.br + '\'; this' + getevalcss() + '.color = \'' + this.styleover.cl + '\'; ') : ('')) + this.items[i].omover + ';"';
omout = ' onmouseout="' + ((this.styleout) ? ('this' + getevalcss() + '.background = \'' + this.styleout.bg + '\'; this' + getevalcss() + '.border = \'' + this.styleout.br + '\'; this' + getevalcss() + '.color = \'' + this.styleout.cl + '\'; ') : ('')) + this.items[i].omout + ';"';
}
if (this.items[i].href != '') {
switch (this.items[i].targ) {
case '_blank':
oclick = ' onclick="window.open(\'' + this.items[i].href + '\')"';
break;
default:
oclick = ' onclick="document.location.href=\'' + this.items[i].href + '\';"';
break;
}
} else {
oclick = '';
}
mnu += '| ' + this.items[i].text + ' | ';
} else {
mnu += '' + this.items[i].text + ' | ' + "\n";
}
}
mnu += ' ';
mnu += ' |
';
this.obj = new flyer(this.name, this.parentname, this.x, this.y, 'absolute', 'none', this.val, this.hal, '', mnu, this.delay, this.zindex, this.snaptb, this.snaptp);
this.obj.init();
if (nav.nn4) this.obj.obj.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
this.obj.obj.parent = this.cnt;
this.obj.obj.onmouseover = this.honmouseover;
this.obj.obj.onmouseout = this.honmouseout;
if (window.onresize == null)
window.onresize = updposition;
if (window.onmove == null)
window.onmove = updposition;
ol = nav.getonload();
if (ol[1].indexOf('updposition') == -1) {
nav.addonload('updposition();');
}
}
}
function hideflymenus() {
for (i = 0; i < document.flymenus.length; i++) {
document.flymenus[i].hide();
}
}
function clearall(menu) {
while (menu.activeitems.length > 0) {
itemcss = getcss(getobj(menu.name + '_' + menu.shiftactiveitem()));
itemcss.background = menu.styleout.bg;
itemcss.border = menu.styleout.br;
itemcss.color = menu.styleout.cl;
}
}