<script language="javascript" type="text/javascript">
var menuDiv;
var win;
[b]function [red]setInnerHTML(x,menu)[/red][/b] {
if (menu.length > 0) {
menuDiv = window.frames["mainFrame"].document.getElementById("menuDiv");
if (win && menuDiv && menuDiv.style) {
win.populate(menu);
win.showPopup(x,0);
}
else {
var newElement = window.frames["mainFrame"].document.createElement("div");
newElement.setAttribute("name", "menuDiv");
newElement.setAttribute("id", "menuDiv");
window.frames["mainFrame"].document.body.appendChild(newElement);
with (window.frames["mainFrame"].document.getElementById("menuDiv").style)
{
position = "absolute";
backgroundColor = "transparent";
color = "MenuText";
width = "auto";
margin = "0";
padding = "0";
fontFamily = "Arial";
fontSize = "8pt";
overflow = "visible";
}
if (document.all) {
[teal]// This is for IE specific browsers[/teal]
with (window.frames["mainFrame"].document.styleSheets[0]) {
addRule("#menuDiv ul","margin:0;padding:0;list-style-type:none;width:210px;border:2px outset ThreeDFace;background:Menu;");
addRule("#menuDiv ul li","position: relative;background:Menu;overflow:visible;");
addRule("#menuDiv ul li ul","position: absolute;width:155px;top:0;visibility:hidden;background:Menu;");
addRule("#menuDiv ul li a","font-family:Arial;font-size: 8pt;display:block;overflow:auto;padding:1px 6px 1px 3px;color:MenuText;background-color:ThreeDFace;text-decoration:none;");
addRule("#menuDiv a:hover","color:HighlightText;background-color:Highlight;");
addRule("#menuDiv hr","padding:0;margin-top:-2px;color:ThreeDDarkShadow;");
addRule("#menuDiv .subfolderstyle","padding-right:0;background: url(/site/ArrowPopup.gif) no-repeat center right;");
addRule("* html #menuDiv ul li","float: left; height: 1%;");
addRule("* html #menuDiv ul li a","height: 1%;");
}
}
else if (document.getElementById) {
[teal]// This is for FireFox and Non-IE browsers[/teal]
var x = window.frames["mainFrame"].document.styleSheets[0];
x.insertRule("#menuDiv ul {margin:0;padding:0;list-style-type:none;width:210px;border:2px outset ThreeDFace;background:Menu;}",x.cssRules.length);
x.insertRule("#menuDiv ul li {position: relative;background:Menu;overflow:visible;}",x.cssRules.length);
x.insertRule("#menuDiv ul li ul {position: absolute;width:155px;top:0;visibility:hidden;background:Menu;}",x.cssRules.length);
x.insertRule("#menuDiv ul li a {font-family:Arial;font-size: 8pt;display:block;overflow:auto;padding:1px 5px;color:MenuText;background-color:ThreeDFace;text-decoration:none;}",x.cssRules.length);
x.insertRule("#menuDiv a:hover {color:HighlightText;background-color:Highlight;}",x.cssRules.length);
x.insertRule("#menuDiv hr {margin-top:-2px;padding:0px;color:ThreeDDarkShadow;}",x.cssRules.length);
x.insertRule("#menuDiv .subfolderstyle {background: url(/site/ArrowPopup.gif) no-repeat center right;}",x.cssRules.length);
x.insertRule("* html #menuDiv ul li {float: left; height: 1%;}",x.cssRules.length);
x.insertRule("* html #menuDiv ul li a {height: 1%;}",x.cssRules.length);
}
win = new PopupMenu('menuDiv');
win.autoHide();
if (!win.listenerAttached) {
win.listenerAttached = true;
win.attachListener();
}
win.populate(menu);
win.showPopup(x,0);
menuDiv = window.frames["mainFrame"].document.getElementById("menuDiv");
}
[teal]// Run script to convert unordered list to menus[/teal]
[red][b]buildsubmenus();[/b][/red]
[teal]// if main menu is too wide and the right edge extends off the screen, move it left[/teal]
var clientWidth = parseInt(window.frames["mainFrame"].document.body.clientWidth,10);
var done = false;
var elemWidth = parseInt(menuDiv.offsetWidth,10);
while (((getLeftPos(menuDiv)+elemWidth) > clientWidth) && !done) {
menuDiv.style.left = (getLeftPos(menuDiv) - 5) + "px";
elemWidth = parseInt(menuDiv.offsetWidth,10);
}
}
}
[teal]// This is called from clicking the link on the menu so that
// I can either create a popup window, or change the content
// of the mainFrame to be the requested page.[/teal]
[b]function [red]goMenu(url)[/red][/b] {
var urlStr = "";
if (url.charAt(0) == "p") {
urlStr = "window.open('"+url.substr(1)
+"','child','toolbar=no,width=700,height=500,resizable=yes,scrollbars=yes')";
if (win && win.hidePopup) win.hidePopup();
}
else {
window.frames["mainFrame"].document.body.style.pointer = 'wait';
urlStr = "window.frames[\"mainFrame\"].document.location.href='" + url +"';";
win = null;
menuDiv = null;
}
eval(urlStr);
}
[teal]/* This function will shrink the width of the given DIV until it can no longer
shrink, or until the height gets larger and then it will increase the size
slightly. */[/teal]
[b]function [red]resizeMenu(menuDivObj)[/red][/b] {
[teal]// When submenus have no spaces, the width can only be reduced so far[/teal]
var origHeight = menuDivObj.offsetHeight;
var prevWidth = 0;
while (origHeight == menuDivObj.offsetHeight
&& menuDivObj.offsetWidth != prevWidth) {
prevWidth = menuDivObj.offsetWidth;
menuDivObj.style.width = (menuDivObj.offsetWidth-3)+"px";
}
menuDivObj.style.width = (menuDivObj.offsetWidth+6)+"px";
}
[b]function [red]getLeftPos(inputObj)[/red][/b] {
var returnValue = inputObj.offsetLeft;
while((inputObj = inputObj.offsetParent) != null)
returnValue += inputObj.offsetLeft;
return parseInt(returnValue,10);
}
[teal]//SuckerTree Vertical Menu 1.1 (Nov 8th, 06)
//By Dynamic Drive: [URL unfurl="true"]http://www.dynamicdrive.com/style/[/URL][/teal]
var menuids=["suckermenu"] //Enter id(s) of SuckerTree UL menus, separated by commas
[b]function [red]buildsubmenus()[/red][/b] {
var menuObj = window.frames["mainFrame"].document.getElementById(menuids[0]);
resizeMenu(menuObj);
var clientWidth = parseInt(window.frames["mainFrame"].document.body.clientWidth,10);
for (var i=0; i<menuids.length; i++) {
var ultags=window.frames["mainFrame"].document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
resizeMenu(ultags[t]);
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
var myLeft;
//if this is a first level submenu
if (ultags[t].parentNode.parentNode.id == menuids[i]) {
//dynamically position first level submenus to the right of main menu item
myLeft = ultags[t].parentNode
}
else { //else if this is a sub level submenu (ul)
//position menu to the right of menu item that activated it
var myLeft = ultags[t].parentNode.getElementsByTagName("a")[0];
}
var leftEdge = parseInt(getLeftPos(myLeft))+parseInt(myLeft.offsetWidth);
var elemWidth = parseInt(ultags[t].offsetWidth);
if ((leftEdge+elemWidth) < clientWidth)
ultags[t].style.left=myLeft.offsetWidth+"px"
else {
// the submenu needs to be placed to the right of the parent UL item
ultags[t].style.left=(-elemWidth)+"px";
}
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
this.style.backgroundColor = "Highlight";
this.style.color = "HighlightText";
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
this.style.backgroundColor = "Menu";
this.style.color = "MenuText";
}
}
for (var t=ultags.length-1; t>-1; t--) {
//loop through all sub menus again, and use "display:none" to hide menus
//(to prevent possible page scrollbars)
ultags[t].style.visibility="visible"
ultags[t].style.display="none"
}
}
}
</script>