// Copyright 1997-2004 Netopia
var menuOffsetTop=menuOffsetLeft=submenuOffsetTop=submenuOffsetLeft=submenuOffsetRight=0;
var standards=document.createElement && document.createTextNode?1:0;
var n=navigator.userAgent;
var gIE50=(n.indexOf("MSIE 5.0")>0);
var gIE=(n.indexOf("MSIE 5")>0 || n.indexOf("MSIE 6")>0);
var gMac=(n.indexOf("Mac")>0);
var gMacIE=(gMac && gIE);
var gWinIE=(gIE && !gMac);
var gNC=(n.indexOf("Gecko")>0);
var gMoz=gNC && !(n.indexOf("Netscape")>0);
var gMinNC61=(gMoz || gNC && n.indexOf("6.")!=-1 && parseInt(n.substr(n.indexOf("6.")+2,1))>1);
var gCSS1=(!document.compatMode && !gMacIE || document.doctype && document.doctype.name.indexOf("/TR/")>-1 || "CSS1Compat"==document.compatMode);
if(gWinIE) gCSS1=0;
var gUseMouseover=0;
var gInited=0;
var gMenulist = new Array();
var gDownBtn = null;
var gActiveMenu = null;
var gRightmostMenu = null;
var gLeftmostMenu = null;
var gBottommostMenu = null;
var gNumMenus = 0;
gVars={fb:0};
function tmObj(theUID, theTitle, theDesc, theType, theObject, theURL, theTarget, bValid) 
{this.uid = theUID; this.title = theTitle; this.desc = theDesc; this.URL = theURL; this.tType = theType; this.tObject = theObject; this.target = theTarget; this.vObject = bValid;}
var tmArray  = new Array();
var tmIdx = 0;
<!-- nHTML ERROR: SelectAll() could not find list 'MyTasks' -->
function AppendTaskToMenu(theUID, theTitle, theDesc, theURL, theType, theObject)
{
tmArray[tmArray.length]=new tmObj(theUID, theTitle, theDesc, theType, theObject, (theType=="ext"?theURL:"javascript:NavGoto('http://verizonsupersite.com/alternativebuildingconcom/"+theURL+"')"),(theType=="ext"?"_new":""),true);
UpdateTaskMenu();
}
window.onresize=function(){setTimeout("AdjustPos()",100);};
document.onmouseup=DoMouseUp;
function DoMouseUp(evt)
{
evt=evt?evt:window.event;
var t=evt.srcElement?evt.srcElement:evt.target;
if(t.nodeName=="#text")
t=t.parentNode;
if(!t.className || gDownBtn && t.className.indexOf("qbButtons")!=0 || !cTarget(t.menubar,gDownBtn))
if(gDownBtn)
RevertBtnStyle(gDownBtn,"qbButtons");
else if(gActiveMenu)
RevertBtnStyle(gActiveMenu.overBtn);
}
this.menubar=null;
////////////////////////////////////////////////////////////////////////////////
function fix()
{
var f=document.createElement("div");
with(f)
{
className="qbButtons";
with(style)
{
width=0;
margin=0;
if(!gWinIE) border=0;
padding=0;
fontSize=0;
visibility="hidden";
};
};
return f;
}
////////////////////////////////////////////////////////////////////////////////
function HideMenu(event)
{
e=event?event:window.event;
relatedTarget=e.toElement?e.toElement:e.relatedTarget;
if(relatedTarget!=null)
{
if(cTarget(this,relatedTarget) || this.menubar && this.menubar==relatedTarget)
return;
if(relatedTarget && this.overBtn && this.overBtn==relatedTarget || !gMoz && this.overBtn==relatedTarget.parentNode)
return;
if(this.outerMenu && cTarget(this.outerMenu,relatedTarget))
return;
if(this.as && (typeof this.as == "object") && cTarget(this.as,relatedTarget))
return;
}
if(gMoz)
{
if(this.as && (typeof this.as == "object") && gVars.c.y>GetTop(this.as)-3 && gVars.c.y<GetTop(this.as)+this.as.offsetHeight+3)
{
if(this.as.iar)
{
if(gVars.c.x+this.as.offsetWidth/2>this.as.offsetLeft)
return;
}
else if(gVars.c.x-this.as.offsetWidth/2<GetOffset(this.as,"offsetLeft")+this.as.offsetWidth)
return;
}
else if(this.outerMenu && gVars.c.y<this.outerMenu.offsetTop+this.outerMenu.offsetHeight)
{
if(this.iar)
{
if(gVars.c.x>this.outerMenu.offsetLeft && gVars.c.x<this.outerMenu.offsetLeft+this.outerMenu.offsetWidth+40)return;
}
else if(gVars.c.x>this.outerMenu.offsetLeft)
return;
}
}
if(gMoz && gVars.c.y<gActiveMenu.offsetTop+2)
return;
RevertMenuStyle(gActiveMenu);
if(gDownBtn)
RevertBtnStyle(gDownBtn,"qbButtons");
//  else gUseMouseover=0;
gActiveMenu=null;
this.isPos=0;
if (gWinIE)
{
ShowWindowedTags("SELECT");
ShowWindowedTags("OBJECT");
if (gIE50) ShowWindowedTags("IFRAME");
}
return false;
}
if(gMoz)
{
gVars.c={x:0,y:0};
document.addEventListener("mousemove",function(e){gVars.c.x=e.pageX;gVars.c.y=e.pageY;},false);
}
function noop()
{
status=status;
}
function RevertBtnStyle(btn,classname)
{
if(btn)
{
if(classname)
btn.className=classname;
if (btn.m)
{
btn.m.style.visibility="hidden";
if(btn.m.as)
RevertMenuStyle(btn.m.as);
}
}
gDownBtn=null;
gActiveMenu=null;
if (gWinIE)
{
ShowWindowedTags("SELECT");
ShowWindowedTags("OBJECT");
if (gIE50) ShowWindowedTags("IFRAME");
}
}
function RevertMenuStyle(menu)
{
if (menu  &&  (typeof menu == "object"))
{
if(menu.as)
RevertMenuStyle(menu.as);
if(menu.outerLabel)
{
menu.outerLabel.className="qbLabel";
if (menu.outerMenu) menu.outerMenu.as=null;
}
menu.style.visibility="hidden";
}
window.status=window.defaultStatus;
}
function MoveByY(deltaY)
{
this.style.top=parseInt(this.style.top)+deltaY+"px";
}
function KeepOnTop()
{
gVars.fb=1;
if(this.style.top=="")
this.style.top=typeof GetTop(this)=="number"?GetTop(this):this.offsetTop-1;
if(gMinNC61)
this.style.position="fixed";
else
{
viewTop=GetScrollTop();
viewBottom=GetViewHeight();
if(GetTop(this)+this.offsetHeight<viewTop)
this.style.top=(viewTop-this.offsetHeight)+"px";
if(this.top>viewBottom)
this.style.top=viewBottom+"px";
dy=Math.round(Math.abs(viewTop-GetTop(this))/2);
if(gDownBtn && dy>0)
RevertBtnStyle(gDownBtn,"qbButtons");
if(viewTop<GetTop(this))
dy=-dy;
this.moveByY(dy);
var sp=(GetTop(this)!=viewTop)?54:400;
if(sp==54 && gMacIE)
noop();
setTimeout(this.id+".keepOnTop()",sp);
}
}
function HideWindowedTags(tName,mTop,mLeft,mBottom,mRight)
{
var theTags = document.getElementsByTagName(tName);
var obj = null;
var oTop, oLeft, oBottom, oRight;
for (var i = 0; i < theTags.length; i++)
{
obj = theTags[i];
oTop = GetOffset(obj,"offsetTop");
oLeft = GetOffset(obj,"offsetLeft");
oBottom = oTop + GetOffset(obj,"offsetHeight");
oRight = oLeft + GetOffset(obj,"offsetWidth");
if ((oTop > mTop  &&  oTop < mBottom)  &&  (obj.getAttribute("wmode") != "Opaque"))
{
obj.style.visibility = "hidden";
obj.nssHide = 1;
}
}
}
function ShowWindowedTags(tName)
{
var theTags = document.getElementsByTagName(tName);
for (var i = 0; i < theTags.length; i++)
{
var obj = theTags[i];
if (obj  &&  obj.nssHide) 
{
obj.nssHide = 0;
obj.style.visibility = "";
}
}
}
function GetOffset(el,offset)
{
return (el[offset]+(el.offsetParent?GetOffset(el.offsetParent,offset):0));}
function GetTop(o)
{
if(gIE)
return o.style.posTop;
else 
return parseInt(document.defaultView.getComputedStyle(o,'').getPropertyValue('top'));
}
function GetScrollTop()
{
if(gNC)
return(window.pageYOffset);
return(document.body.scrollTop);
}
function GetScrollLeft()
{
if(gIE)
return(document.body.scrollLeft);
else return(window.pageXOffset);}
function GetViewWidth()
{
return(window.innerWidth)?window.innerWidth-18:document.body.clientWidth-2;
}
function GetViewHeight()
{
if(gNC)
return window.innerHeight-18;
return document.body.clientHeight-2;
}
function SpecialPosition(m)
{ 
var b=m.overBtn?1:0;
var l=m.outerLabel?1:0;
var uf=gVars.fb && gMinNC61 || gMoz;
m.bl=b?m.overBtn:m.outerLabel?m.outerLabel:null;
if(m.isPos && (l || b) && !(gIE && gVars.fb))
return;
var vw=GetViewWidth();
if(!uf)vw+=GetScrollLeft();
var vh=GetViewHeight();
if(!uf)vh+=GetScrollTop();
buttonHeight=m.bl.offsetHeight,buttonWidth=l?m.outerLabel.offsetWidth:0,buttonLeft=GetOffset(m.bl,"offsetLeft"),bot=m.bl?GetOffset(m.bl,"offsetTop"):0;
if(uf)m.style.position="fixed";
bot+=m.bl.menuOffsetTop;
ypos=bot;
m.right=m.offsetLeft+m.offsetWidth;
m.bottom=ypos+m.offsetHeight;
var mp,rp,lp,rvo=0,lvo=0;
rp=buttonLeft+buttonWidth;
rp+=m.bl.menuoffsetleft;
lp=buttonLeft-m.offsetWidth;
lp-=m.bl.menuoffsetright;
if(gMacIE && l)
{
rp-=parseInt(m.bl.currentStyle.paddingRight) || 0;
lp-=parseInt(m.bl.currentStyle.paddingLeft) || 0;
}
if(!b)if(rp+m.offsetWidth>vw)rvo=(rp+m.offsetWidth)-vw;
if(lp<0)lvo=-lp;
if(rvo>=0 && rvo<=lvo)
{
mp=rp;
m.iar=1;
gRightmostMenu=gRightmostMenu?(m.right>gRightmostMenu.right)?m:gRightmostMenu:m;
}
else
{
mp=lp;
m.iar=0;
gLeftmostMenu=gLeftmostMenu?(m.offsetLeft>gLeftmostMenu.offsetLeft)?m:gLeftmostMenu:m;
}
if(!isNaN(mp))m.style.left=mp+"px";
if(!m.iar && lvo>0)m.style.left="0px";
if(m.iar && rvo>0)
{
m.overlap=rvo;
AdjustRightPos(m);
}
m.stk=m.outerMenu?m.outerMenu.stk+100:10000;
m.style.zIndex=m.stk;
if(!isNaN(bot))m.style.top=bot+buttonHeight+"px";
if(m.bottom>vh)
{
m.vOverlap=m.bottom-vh;
AdjustBottomPos(m);
}
if(m.top<0)m.style.top="0px";
if(m.as)SpecialPosition(m.as);
gBottommostMenu=GetBottomMostMenu(GetRM(m));
if(b && m.bl.className && m.bl.className.indexOf("qbButtons")==0)
m.isPos=1;
}
function GetRM(m)
{
return (m.outerMenu?GetRM(m.outerMenu):m);
}
function GetBottomMostMenu(m)
{
if(!m.as)
return m;
else
{
if (typeof m.as == "object") 
gBottommostMenu=(m.bottom>=m.as.bottom)?m:m.as;
GetBottomMostMenu(m.as);
}
return m;
}
function AdjustRightPos(m)
{
m.style.left=GetOffset(m,"offsetLeft")-m.overlap+2+"px";
}
function AdjustBottomPos(m)
{
m.style.top=GetOffset(m,"offsetTop")-m.vOverlap-((m.outerLabel)?m.outerLabel.offsetHeight:2)+"px";
}
function AdjustPos(e)
{
var m=gMenulist;
for(var i=0;i<gMenulist.length;i++)
m[i].isPos=0;
if(gRightmostMenu)
SpecialPosition(gRightmostMenu);
if(gBottommostMenu)
SpecialPosition(gBottommostMenu);
if(gLeftmostMenu)
SpecialPosition(gLeftmostMenu);
}
function cTarget(a,b)
{
return (b?(b==a)?1:cTarget(a,b.parentNode):0);
}
function BtnOver(e)
{
if(gDownBtn==this)
return;
else if(gActiveMenu && !cTarget(this.menubar,gActiveMenu.overBtn))
{
this.className="qbButtonsOver";
return;
}
if(this.m && !this.m.overBtn || this.m.overBtn!=this)
this.m.overBtn=this;
SpecialPosition(this.m);
if(gDownBtn || gUseMouseover)
{
if(gDownBtn)
RevertBtnStyle(gDownBtn,"qbButtons");
if(gActiveMenu)
DoMouseUp();
BtnLblMouseover(this,e);
DepressBtn(this);
gDownBtn=this;
}
else 
this.className="qbButtonsOver";
window.status=this.m.help?this.msg+": "+this.m.help:this.msg;
}
function BtnClick(e)
{
if(gUseMouseover)
return;
if(gActiveMenu && gActiveMenu!=this.m)
DoMouseUp();
if(this==gDownBtn)
RevertBtnStyle(this,"qbButtonsOver");
else
{
BtnLblMouseover(this,e);
this.m.overBtn=this;
SpecialPosition(this.m);
DepressBtn(this);
gDownBtn=this;
}
if(gMacIE)
this.style.cursor="default";
}
function BtnOut(e)
{
if(gDownBtn==this)
return;
this.className="qbButtons";
window.status=window.defaultStatus;
}
function DepressBtn(btn)
{
btn.className="qbButtonsDown";
btn.m.style.visibility="visible";
gActiveMenu=btn.m;
var mTop, mLeft, mBottom, mRight;
mTop = gActiveMenu.offsetTop;
mLeft = gActiveMenu.offsetLeft;
mBottom = gActiveMenu.offsetHeight + mTop;
mRight = gActiveMenu.offsetWidth + mLeft;
if (gWinIE)
{
HideWindowedTags("SELECT",mTop,mLeft,mBottom,mRight);
HideWindowedTags("OBJECT",mTop,mLeft,mBottom,mRight);
if (gIE50) HideWindowedTags("IFRAME",mTop,mLeft,mBottom,mRight);
}
gDownBtn=this;
if(gNC)
btn.m.style.height="";
}
function BtnLblMouseover(btnlbl,e)
{
if(gUseMouseover)
btnlbl.m.onmouseout=HideMenu;
else btnlbl.m.onmouseout=noop;
}
function ItemMouseover(e)
{
if(this.outerMenu  &&  this.outerMenu.as)
{
RevertMenuStyle(this.outerMenu.as);
this.outerMenu.as=null;
}
}
function GetObj(s)
{
return (typeof s=="string"?document.getElementById(s):s);
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
function InitializeMenubar(id)
{
var theMenubar=GetObj(id);
theMenubar.buttons=[];
theMenubar.moveByY=MoveByY;
theMenubar.keepOnTop=KeepOnTop;
theMenubar.fb=0;
theMenubar.as=null;
// Determine the menubar height by creating then removing a button
var btn=document.body.appendChild(CreateDummyButton());
var h=btn.offsetHeight;
h+=gCSS1?2:4;
theMenubar.style.height=h+"px";
if(gNC)
theMenubar.style.clip="auto";
document.body.removeChild(btn);
theMenubar.onmouseout=function(e){if(!gUseMouseover || !gDownBtn)return;e=e?e:window.event;if(e.nodeName=="#text")e=e.parentNode;var rt=e.relatedTarget?e.relatedTarget:e.toElement;var t=e.currentTarget?e.currentTarget:e.srcElement;if(cTarget(document.documentElement,rt) && !cTarget(this,rt) && !cTarget(gDownBtn.m,rt))RevertBtnStyle(gDownBtn,"qbButtons");};
eval("menubar=theMenubar");
InitializeMenus(theMenubar);
TweakMenuBtns();
MenubarSetWidth(theMenubar, "auto",0);        
}
function TweakMenuBtns()
{
if (!gWinIE)
{
var theItems = document.getElementsByName("TweakMenuBtns");
if (theItems)
for (var i = 0; i < theItems.length; i++)
theItems[i].style.border = 0;
}
}
function InitializeMenus(theMenubar)
{
var theMenu = null;
var theBtn = null;
var theBtnText = "";
var theItems = null;
var theSeps = null;
var startIdx = parseInt(0);
var endIdx = startIdx + gNumMenus;
for (var i = startIdx; i < endIdx; i++)
{
theMenu = GetObj("Menu"+i);
if (theMenu)
{
theBtn = GetObj("MenubarB"+i);
if (theBtn)
{
theBtnText = gIE?theBtn.childNodes(0).nodeValue:theBtn.childNodes[0].nodeValue;
InitializeMenu(theMenu, theBtnText);
InitializeMenubarBtn(theMenubar, theMenu, theBtn);
theItems = document.getElementsByName("Menu"+i+"Item");
if (theItems)
for (var j = 0; j < theItems.length; j++)
InitializeMenuItem(theMenu, theItems[j]);
}
}
}
theSeps = document.getElementsByTagName("DIV");
if (theSeps)
for (var j = 0; j < theSeps.length; j++)
if (theSeps[j].className == "qbSeparator")
InitializeSeparator(theSeps[j]);
}
function InitializeMenu(theMenu, theBtnText)
{
theMenu.lt=theBtnText;
theMenu.setWidth=MenuSetWidth;
theMenu.outerMenu=null;
theMenu.as=null;
theMenu.help="";
theMenu.isPos=0;
theMenu.stk=1000;
gMenulist[gMenulist.length]=theMenu;
}
function InitializeMenubarBtn(theMenubar, theMenu, theBtn)
{
theMenu.overBtn=theBtn;
theMenubar.buttons[theMenubar.buttons.length++]=theBtn;
if(!theMenubar.hasAMenu)
theMenu.style.marginLeft="-1px";
theMenubar.hasAMenu=1;
theBtn.m=theMenu;
theBtn.as=null;
theBtn.menubar=theMenubar;
theBtn.m.menubar=theMenubar;
theBtn.msg=theMenu.lt;
theBtn.onmouseover=BtnOver;
if(!gUseMouseover)
{
theBtn.onclick=BtnClick;
theBtn.onmouseout=BtnOut;
}
else 
theBtn.onmousedown=BtnClick;
theBtn.menuOffsetTop=menuOffsetTop;
theBtn.menuoffsetleft=menuOffsetLeft;
theBtn.menuoffsetright=0;
}
function InitializeMenuItem(theMenu, theItem)
{
theItem.outerMenu=theMenu;
theItem.as=null;
theItem.onmouseover=ItemMouseover;
if(!gWinIE)
theItem.style.width="auto";
}
function InitializeSeparator(theSep)
{
theSep.as=null;
with(theSep.style)
{
if(gIE)
border="1px groove";
else
{
width="auto";
borderBottomWidth="2px";
borderBottomStyle="groove";
}
}
if(gMacIE)
theSep.style.marginTop=(parseInt(theSep.currentStyle.marginTop)-2)+"px";
}
function CreateDummyButton()
{
var btn;
btn=document.createElement("div");
btn.className="qbButtons";
btn.innerHTML="x";
btn.menuOffsetTop=menuOffsetTop;
btn.menuoffsetleft=menuOffsetLeft;
btn.menuoffsetright=0;
return btn;
}
function MenubarSetWidth(mb,w,i)
{
mb.style.width=w;
if(typeof i!="number")
i=2;
i-=gCSS1?2:0;
mb.style.width=(mb.offsetWidth+i)+"px";
}
function MenuSetWidth(wdth){var px="";if(typeof wdth=="number") px="px"; this.style.width=wdth+px;}
function SetNumMenus(i){gNumMenus=i;}
function SetupMenubar(bEditPage)
{
try
{
if(!window.standards) return;
if(gInited) return;
if(gWinIE  ||  gNC)
{
menuOffsetLeft = 2;
if (gMoz)
menuOffsetTop = 0;
else
menuOffsetTop = 3; 
}
else if(gMacIE)
{
menuOffsetTop = -8;
menuOffsetLeft = -6;
}
submenuOffsetTop = -14 ;
if(gWinIE)
submenuOffsetLeft = -12;
else if(gMacIE)
submenuOffsetLeft = -4;
submenuOffsetRight = 0;
InitializeMenubar("menubar2");
gUseMouseover=1;
gInited=1;
with (document.body.style)
{
margin=0;
marginTop=0;
marginBottom=0;
marginLeft=(bEditPage?10:0);
marginRight=(bEditPage?10:0);
}
}
catch(e)
{
alert("Error Initializing Quick Bar Menus:\n" + e.message);
}
}
function UpdateTaskMenu()
{
var taskMenuDiv=GetObj("Menu0");
if (taskMenuDiv)
{
var oldTaskTable=GetObj("MenuTable0");
if (oldTaskTable) taskMenuDiv.removeChild(oldTaskTable);
var newTaskTable=document.createElement("table");
var topTaskNode=newTaskTable;
var bEntry=false;
if (newTaskTable)
{
newTaskTable.id="MenuTable0";
newTaskTable.cellPadding=0;
newTaskTable.cellSpacing=0;
newTaskTable.style.margin="0px";
if(!gMacIE)
{
topTaskNode=document.createElement("tbody");
newTaskTable.appendChild(topTaskNode);
}
bEntry=true;
if (gMacIE) topTaskNode.appendChild(CreateEmptyRow());
topTaskNode.appendChild(CreateMenuItem(taskMenuDiv,"0","Edit Task List","javascript:NavGoto('http://verizonsupersite.com/alternativebuildingconcom/pages/common/edittasks.nhtml')","",true));
if (tmArray.length > 0)
{
if (gMacIE) topTaskNode.appendChild(CreateEmptyRow());
topTaskNode.appendChild(CreateMenuSep("0"));
}
for (var i=0;i<tmArray.length;i++)
{
if (gMacIE) topTaskNode.appendChild(CreateEmptyRow());
topTaskNode.appendChild(CreateMenuItem(taskMenuDiv,"0",tmArray[i].title,tmArray[i].URL,tmArray[i].target,tmArray[i].vObject));
}
if (tmArray.length<1 && !bEntry)
{
if (gMacIE) topTaskNode.appendChild(CreateEmptyRow());
topTaskNode.appendChild(CreateMenuItem(taskMenuDiv,"0","&lt;No Tasks Defined Yet&gt;","","",true));
}
taskMenuDiv.appendChild(newTaskTable);
}
}
}
function CreateMenuItem(theMenu, theMenuID, theTitle, theURL, theTarget, bValid)
{
var theItem=null;
if (!theURL  ||  theURL == "")
theItem=document.createElement("div");
else
{
theItem=document.createElement("a");
theItem.name="Menu"+theMenuID+"Item";
theItem.href=theURL;
if (theTarget  &&  theTarget != "") theItem.target=theTarget;
}
theItem.className="qbMenuItem";
if (!bValid) theItem.style.textDecoration="line-through";
theItem.innerHTML=theTitle;
InitializeMenuItem(theMenu,theItem);
return CreateMenuRow(theItem);
}
function CreateMenuSep(theMenuID)
{
var theSep=document.createElement("div");
theSep.className="qbSeparator";
theSep.name="Menu"+theMenuID+"Sep";
InitializeSeparator(theSep);
return CreateMenuRow(theSep);
}
function CreateMenuRow(theContents)
{
var theRow=document.createElement("tr");
var theCell=document.createElement("td");
theCell.appendChild(theContents);
theRow.appendChild(theCell);
return theRow;
}
function CreateEmptyRow()
{
var theRow=document.createElement("tr");
var theCell=document.createElement("td");
theCell.style.height="0px";
theRow.appendChild(theCell);
return theRow;
}
