<script type="text/javascript">
var menuDiv;
var win;
function setInnerHTML(x,menu) {
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) {
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 5px;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(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) {
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 6px 1px 3px;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:0px;margin-bottom:0px;padding:0px;color:ThreeDDarkShadow;}",x.cssRules.length);
x.insertRule("#menuDiv .subfolderstyle {padding-right:0;background: url(ArrowPopup.gif) no-repeat center right;}",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");
}
// Run script to convert unordered list to menus
buildsubmenus();
// if main menu is too wide and the right edge extends off the screen, move it left
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) - 2) + "px";
elemWidth = parseInt(menuDiv.offsetWidth,10);
}
}
}
/* menu click handler to identify popup windows from main content href. */
function goMenu(url) {
var urlStr = "";
osList = false;
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 {
urlStr = "window.frames[\"mainFrame\"].document.location.href='" + url +"';";
win = null;
menuDiv = null;
}
eval(urlStr);
}
/* 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. */
function resizeMenu(menuDivObj)
{
// When submenus have no spaces, the width can only be reduced so far
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";
}
function getLeftPos(inputObj)
{
var returnValue = inputObj.offsetLeft;
while((inputObj = inputObj.offsetParent) != null)returnValue += inputObj.offsetLeft;
return parseInt(returnValue,10);
}
/*
SuckerTree Vertical Menu 1.1 (Nov 8th, 06)
By Dynamic Drive: [URL unfurl="true"]http://www.dynamicdrive.com/style/[/URL]
*/
var menuids=["suckermenu"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus() {
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++){
// First thing resize the submenus
resizeMenu(ultags[t]);
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
//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
ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px"
}
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>