M
Mos
Folks Please help this is driving me insane
The + expands but the minus fails
Error src is null or not an object
function Win_onLoad()
{
GetNameAndLink(0);
}
function GetNameAndLink(pkId)
{
var myMenu = eval("menuHolder" + pkId);
if(myMenu.innerHTML != "")
return;
var menus = xmlResponse.selectNodes("MenuItems/MenuItem");
var table = "";
for(i = 0; i< menus.length; i++)
{
var itemId = menus.selectSingleNode("ItemId").text;
var menuTitle = menus.selectSingleNode("MenuTitle").text;
var menuLink = menus.selectSingleNode("MenuLink").text;
var hasChildren = menus.selectSingleNode("HasChildren").text;
var menuLevel = menus.selectSingleNode("MenuLevel").text;
var menuIndent = (menuLevel - 1) * 24 + 2;
var menuItem = "";
if(hasChildren == "True")
{
menuItem = '<DIV id=menuIMG0 style="CURSOR: default" noWrap><IMG
onMouseOver="menuOver(\'N0' + itemId + '\')" onMouseOut="menuOff(\'N0'
+ itemId + '\')" class=collapse id=ExpImg' + itemId + ' style="LEFT: '
+ menuIndent +'px; POSITION: relative; TOP: 4px" onclick=Expando(' +
itemId + ') alt="' + menuTitle +'" src="Images/plus.gif"><SPAN
class=menulabel id=N0' + itemId + ' name=N0' + itemId + ' title="' +
menuTitle +'" style="LEFT: ' + menuIndent +'px; POSITION: relative"
onclick=Expando(' + itemId + ') onMouseOver="menuOver(\'N0' + itemId
+ '\')" onMouseOut="menuOff(\'N0' + itemId + '\')" >' + menuTitle +'</
SPAN></DIV>';
menuItem += '<DIV class=childContainer id=menuHolder' + itemId + '
style="DISPLAY: inline"></DIV>'
}
else
{
menuItem = '<DIV id=menuIMG0 style="CURSOR: default" noWrap><IMG
onMouseOver="menuOver(\'N0' + itemId + '\')" onMouseOut="menuOff(\'N0'
+ itemId + '\')" class=collapse id=E0 style="LEFT: ' + menuIndent
+'px; POSITION: relative; TOP: 4px" onclick="OpenItem(\'' + menuLink
+'\', \'N0' + itemId + '\')" alt="' + menuTitle +'" src="Images/
reporticon_big.gif"><SPAN class=menulabel id=N0' + itemId + '
name=N0' + itemId + ' title="' + menuTitle +'" style="LEFT: ' +
menuIndent +'px; POSITION: relative" onclick="OpenItem(\'' + menuLink
+'\', \'N0' + itemId + '\')" onMouseOver="menuOver(\'N0' + itemId +
'\')" onMouseOut="menuOff(\'N0' + itemId + '\')" >' + menuTitle +'</
SPAN></DIV>';
}
table += menuItem;
}
myMenu.innerHTML = table;
}
function OpenItem(menuLink, menuItem)
{
if(selectedId != "")
{
document.getElementsByName(selectedId)[0].className='menulabel';
}
selectedId = menuItem;
document.getElementsByName(selectedId)[0].className='menulabelon';
//parent.main.navigate(menuLink);
parent.frames["main"].location = menuLink;
}
function Expando(itemId)
{
var menuImage = eval("ExpImg" + itemId);
var childDiv = eval("menuHolder" + itemId);
if(menuImage.src.indexOf('plus') > 0)
{
menuImage.src = "Images/minus.gif";
childDiv.style.display = "";
GetNameAndLink(itemId);
}
else
{
menuImage.src = "Images/plus.gif";
childDiv.style.display = "none";
}
}
function menuOver(menuItem)
{
var oWorkItem;
oWorkItem = menuItem;
document.getElementsByName(oWorkItem)[0].className='menulabelon';
}
function menuOff(menuItem)
{
var oWorkItem
oWorkItem = menuItem
if (document.getElementsByName(oWorkItem)[0].className ==
"menulabelon" && oWorkItem != selectedId)
{
document.getElementsByName(oWorkItem)[0].className='menulabel';
}
}
</script>
</head>
<BODY topmargin="0" leftmargin="0" style="OVERFLOW: auto;border-right:
solid 1px black" bgcolor="#FAFAFF" onLoad="Win_onLoad()"
onhelp="OpenTrackerHelpFromOtherFrames(); return false;">
<table border="0" height="24" width="100%" cellpadding="0"
cellspacing="0">
<tr style="height: 25px">
<td class="filterHead" id="tdTitle" width="100%" style='padding-left:
5px;font-weight:bold;'>
TrackerSuite.Net
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="filterUpperBorder" >
<tr style="height: 1px">
<td><img src="images/1.gif" width="1" height="1"></td>
</tr>
</table>
<DIV id=menulabels style="padding-left:8px;padding-top:2px;">
<div id="menuHolder0" name="menuHolder0"></div>
</div><DIV id=mylabels style="padding-left:8px;padding-top:2px;"></
DIV>
<!--<OBJECT id=CookieScriptlet style="LEFT: 0px; TOP: 0px" type=text/x-
scriptlet height=0
width=0 data=CookieManager.htm></OBJECT>-->
</BODY>
</HTML>
The + expands but the minus fails
Error src is null or not an object
function Win_onLoad()
{
GetNameAndLink(0);
}
function GetNameAndLink(pkId)
{
var myMenu = eval("menuHolder" + pkId);
if(myMenu.innerHTML != "")
return;
var menus = xmlResponse.selectNodes("MenuItems/MenuItem");
var table = "";
for(i = 0; i< menus.length; i++)
{
var itemId = menus.selectSingleNode("ItemId").text;
var menuTitle = menus.selectSingleNode("MenuTitle").text;
var menuLink = menus.selectSingleNode("MenuLink").text;
var hasChildren = menus.selectSingleNode("HasChildren").text;
var menuLevel = menus.selectSingleNode("MenuLevel").text;
var menuIndent = (menuLevel - 1) * 24 + 2;
var menuItem = "";
if(hasChildren == "True")
{
menuItem = '<DIV id=menuIMG0 style="CURSOR: default" noWrap><IMG
onMouseOver="menuOver(\'N0' + itemId + '\')" onMouseOut="menuOff(\'N0'
+ itemId + '\')" class=collapse id=ExpImg' + itemId + ' style="LEFT: '
+ menuIndent +'px; POSITION: relative; TOP: 4px" onclick=Expando(' +
itemId + ') alt="' + menuTitle +'" src="Images/plus.gif"><SPAN
class=menulabel id=N0' + itemId + ' name=N0' + itemId + ' title="' +
menuTitle +'" style="LEFT: ' + menuIndent +'px; POSITION: relative"
onclick=Expando(' + itemId + ') onMouseOver="menuOver(\'N0' + itemId
+ '\')" onMouseOut="menuOff(\'N0' + itemId + '\')" >' + menuTitle +'</
SPAN></DIV>';
menuItem += '<DIV class=childContainer id=menuHolder' + itemId + '
style="DISPLAY: inline"></DIV>'
}
else
{
menuItem = '<DIV id=menuIMG0 style="CURSOR: default" noWrap><IMG
onMouseOver="menuOver(\'N0' + itemId + '\')" onMouseOut="menuOff(\'N0'
+ itemId + '\')" class=collapse id=E0 style="LEFT: ' + menuIndent
+'px; POSITION: relative; TOP: 4px" onclick="OpenItem(\'' + menuLink
+'\', \'N0' + itemId + '\')" alt="' + menuTitle +'" src="Images/
reporticon_big.gif"><SPAN class=menulabel id=N0' + itemId + '
name=N0' + itemId + ' title="' + menuTitle +'" style="LEFT: ' +
menuIndent +'px; POSITION: relative" onclick="OpenItem(\'' + menuLink
+'\', \'N0' + itemId + '\')" onMouseOver="menuOver(\'N0' + itemId +
'\')" onMouseOut="menuOff(\'N0' + itemId + '\')" >' + menuTitle +'</
SPAN></DIV>';
}
table += menuItem;
}
myMenu.innerHTML = table;
}
function OpenItem(menuLink, menuItem)
{
if(selectedId != "")
{
document.getElementsByName(selectedId)[0].className='menulabel';
}
selectedId = menuItem;
document.getElementsByName(selectedId)[0].className='menulabelon';
//parent.main.navigate(menuLink);
parent.frames["main"].location = menuLink;
}
function Expando(itemId)
{
var menuImage = eval("ExpImg" + itemId);
var childDiv = eval("menuHolder" + itemId);
if(menuImage.src.indexOf('plus') > 0)
{
menuImage.src = "Images/minus.gif";
childDiv.style.display = "";
GetNameAndLink(itemId);
}
else
{
menuImage.src = "Images/plus.gif";
childDiv.style.display = "none";
}
}
function menuOver(menuItem)
{
var oWorkItem;
oWorkItem = menuItem;
document.getElementsByName(oWorkItem)[0].className='menulabelon';
}
function menuOff(menuItem)
{
var oWorkItem
oWorkItem = menuItem
if (document.getElementsByName(oWorkItem)[0].className ==
"menulabelon" && oWorkItem != selectedId)
{
document.getElementsByName(oWorkItem)[0].className='menulabel';
}
}
</script>
</head>
<BODY topmargin="0" leftmargin="0" style="OVERFLOW: auto;border-right:
solid 1px black" bgcolor="#FAFAFF" onLoad="Win_onLoad()"
onhelp="OpenTrackerHelpFromOtherFrames(); return false;">
<table border="0" height="24" width="100%" cellpadding="0"
cellspacing="0">
<tr style="height: 25px">
<td class="filterHead" id="tdTitle" width="100%" style='padding-left:
5px;font-weight:bold;'>
TrackerSuite.Net
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0"
class="filterUpperBorder" >
<tr style="height: 1px">
<td><img src="images/1.gif" width="1" height="1"></td>
</tr>
</table>
<DIV id=menulabels style="padding-left:8px;padding-top:2px;">
<div id="menuHolder0" name="menuHolder0"></div>
</div><DIV id=mylabels style="padding-left:8px;padding-top:2px;"></
DIV>
<!--<OBJECT id=CookieScriptlet style="LEFT: 0px; TOP: 0px" type=text/x-
scriptlet height=0
width=0 data=CookieManager.htm></OBJECT>-->
</BODY>
</HTML>