var docType = (document.compatMode && document.compatMode == "CSS1Compat");
var bodyRef;
function menu(size, orientation, x, y, offsetX, offsetY, bgOut, bgOver, fontFace, fontSize,
fontStyleOut, fontStyleOver, textColorOut, textColorOver, borderSize, borderColor, margin, showChar,
showOnClick, sepItems, isMainMenu, hasAnimations, animationType, hasShadow, sOffX, sOffY, shadowColor)
{
for (var i=0; i' + content + '
';
cell1.align = alignment;
if (content.src || this.showChar == "" || this.showChar == 0)
cell1.width = "100%";
else
cell1.width = "80%";
row.appendChild(cell1);
cell1.appendChild(fontTag);
if (!(content.src || this.showChar == "" || this.showChar == 0))
{
cell2.align = "right";
//cell2.vAlign = "top";
cell2.width = "20%";
row.appendChild(cell2);
cell2.appendChild(charFontTag);
}
link = link.replace(/[']/g, "\\'");
link = link.replace(/\"/g, "\\'");
if (!content.src)
{
contentFunctionOver = "html(this, '" + this.bgOver + "', '" + this.textColorOver + "', '" +
this.fontStyleOver + "', '" + showCharOverParam + "');";
contentFunctionOut = "html(this, '" + this.bgOut + "', '" + this.textColorOut + "', '" +
this.fontStyleOut + "', '" + showCharOutParam + "');";
if (link != "" && link != "#")
{
contentFunctionOver += "window.status='" + link + "';";
contentFunctionOut += "window.status='';";
}
}
else
{
contentFunctionOver = "roll(this, '" + rollover + "');";
contentFunctionOut = "roll(this, '" + rollout + "');";
}
if (this.showOnClick && menuToShow != 0)
temp.onmouseover = new Function("reset(" + (menus.length - 1) + ", " + menuToShow + ");" +
contentFunctionOver);
else
temp.onmouseover = new Function(showMenuFunction + contentFunctionOver);
if (menuToShow != 0)
{
if (!content.src)
this.activeItems[this.activeItems.length] = "html(menus[" + (menus.length-1) + "].items[" +
this.items.length + "], '" + this.bgOut + "', '" + this.textColorOut + "', '" +
this.fontStyleOut + "', '" + showCharOutParam + "');";
else
this.activeItems[this.activeItems.length] = "roll(menus[" + (menus.length-1) + "].items[" +
this.items.length + "], '" + rollout + "');";
if (link != "" && link != "#")
this.activeItems[this.activeItems.length-1] += "status='';";
}
else
temp.onmouseout = new Function(contentFunctionOut);
if (link != "" && link != "#")
{
if (target != "")
temp.onmouseup = new Function("window.open('" + link + "', '" + target + "');");
else
temp.onmouseup = new Function("location.href = '" + link + "';");
}
if (this.showOnClick && menuToShow != 0)
temp.onmouseup = new Function(showMenuFunction + contentFunctionOver);
if (this.sepItems)
{
if (this.orientation == "horizontal")
this.main.style.width = (parseInt(this.main.style.width) + iSize + this.borderSize) + "px";
else
this.main.style.height = (parseInt(this.main.style.height) + iSize + this.borderSize) + "px";
this.position += iSize + this.borderSize;
}
else
{
if (this.orientation == "horizontal")
this.main.style.width = (parseInt(this.main.style.width) + iSize) + "px";
else
this.main.style.height = (parseInt(this.main.style.height) + iSize) + "px";
this.position += iSize;
}
if (this.hasShadow)
{
this.shadow.style.height = this.main.style.height;
this.shadow.style.width = this.main.style.width;
}
temp.style.visibility = "inherit";
this.items[this.items.length] = temp;
}
function html(element, bgChange, textColor, fontStyle, showCharParam)
{
if (bgChange.indexOf("img:") != -1)
element.style.background = "url(" + bgChange.substr(4) + ")";
else
element.style.backgroundColor = bgChange;
if (element.onmouseup)
element.style.cursor = "pointer";
else
element.style.cursor = "default";
var isBold = false, isItalic = false, isUnderline = false;
if (fontStyle.indexOf("bold") != -1)
isBold = true;
if (fontStyle.indexOf("italic") != -1)
isItalic = true;
if (fontStyle.indexOf("underline") != -1)
isUnderline = true;
if (element.firstChild.tagName == "TABLE")
{
var mainElement = element.firstChild.firstChild.firstChild.firstChild.firstChild;
mainElement.style.color = textColor;
if (isBold)
mainElement.style.fontWeight = "bold";
else
mainElement.style.fontWeight = "normal";
if (isItalic)
mainElement.style.fontStyle = "italic";
else
mainElement.style.fontStyle = "normal";
if (isUnderline)
mainElement.style.textDecoration = "underline";
else
mainElement.style.textDecoration = "none";
var showChar = element.firstChild.firstChild.firstChild.lastChild.firstChild;
if (showCharParam != "none")
showChar.firstChild.src = showCharParam;
else
{
showChar.style.color = textColor;
if (isBold)
showChar.style.fontWeight = "bold";
else
showChar.style.fontWeight = "normal";
if (isItalic)
showChar.style.fontStyle = "italic";
else
showChar.style.fontStyle = "normal";
if (isUnderline)
showChar.style.textDecoration = "underline";
else
showChar.style.textDecoration = "none";
}
}
else
{
element.firstChild.color = textColor;
if (isBold)
element.firstChild.style.fontWeight = "bold";
else
element.firstChild.style.fontWeight = "normal";
if (isItalic)
element.firstChild.style.fontStyle = "italic";
else
element.firstChild.style.fontStyle = "normal";
if (isUnderline)
element.firstChild.style.textDecoration = "underline";
else
element.firstChild.style.textDecoration = "none";
}
}
function reset(num, sNum)
{
var i;
for (i=0; i iNum)
{
showY += parseInt(menus[pNum].main.style.height);
showX += parseInt(menus[pNum].items[iNum].style.left);
}
}
else
{
if (menus[pNum].items.length > iNum)
{
showX += parseInt(menus[pNum].main.style.width);
showY += parseInt(menus[pNum].items[iNum].style.top);
}
}
var bodyHeight = document.getElementsByTagName("HTML")[0].offsetHeight;
var bodyWidth = document.getElementsByTagName("HTML")[0].offsetWidth;
var scrollX = document.getElementsByTagName("HTML")[0].scrollLeft;
var scrollY = document.getElementsByTagName("HTML")[0].scrollTop;
if (showX + menus[num].main.offsetWidth > bodyWidth + scrollX)
{
showX -= (showX + menus[num].main.offsetWidth) - (bodyWidth + scrollX);
if (menus[num].hasShadow)
showX -= menus[num].sOffX;
}
if (showY + menus[num].main.offsetHeight > bodyHeight + scrollY)
{
showY -= (showY + menus[num].main.offsetHeight) - (bodyHeight + scrollY);
if (menus[num].hasShadow)
showY -= menus[num].sOffY;
}
showX += offsetX;
showY += offsetY;
if (menus[num].hasShadow)
{
menus[num].shadow.style.left = (showX + menus[num].sOffX) + "px";
menus[num].shadow.style.top = (showY + menus[num].sOffY) + "px";
}
menus[num].main.style.left = showX + "px";
menus[num].main.style.top = showY + "px";
menus[num].main.style.visibility = "visible";
if (menus[num].hasShadow) menus[num].shadow.style.visibility = "visible";
}
}
function hideAfter(num)
{
var i;
for (i=num+1; i' + this.main.innerHTML + '');
win.document.close();
win.focus();
}
function floatMenu(scrWidth, scrHeight, mrgLeft, adjustNum)
{
if (this.isMainMenu)
{
var bodyWidth = 0;
if (docType)
bodyWidth = document.getElementsByTagName("BODY")[0].offsetWidth;
else
bodyWidth = document.body.scrollWidth;
if (adjustNum == 0 || adjustNum == 2)
{
var menuLeft = Math.ceil(parseInt(this.main.style.left) + (screen.width - scrWidth)/2);
this.main.style.left = Math.ceil(menuLeft - (screen.width - bodyWidth)/2) + "px";
}
if (adjustNum == 1 || adjustNum == 2)
this.main.style.top = (parseInt(this.main.style.top) + (screen.height - scrHeight)/2) + "px";
if (this.hasShadow)
{
this.shadow.style.left = (parseInt(this.main.style.left) + this.sOffX) + "px";
this.shadow.style.top = (parseInt(this.main.style.top) + this.sOffY) + "px";
}
window.onresize = new Function("location.reload();");
}
}
var menus = new Array();