You'll need to post a test page before anyone delves into that, but I would steer clear of any code that uses the detection above.
Here is a standalone version of the code:
[HTML]<html>
<body>
<STYLE>#foldheaderTreeView{cursor:pointer;cursor:h and ;
list-style-image: url('https://eportal-gad5-dev.ca.boeing.com/gs5/BCACore/Treeview/Images/plus.gif');
margin-left: -20px }
#foldheaderListTreeView{cursor:pointer;cursor:hand ;
list-style-image: url('https://eportal-gad5-dev.ca.boeing.com/gs5/BCACore/Treeview/Images/minus.gif');
margin-left: -20px }
#foldinglistTreeView{list-style-image: url('https://eportal-gad5-dev.ca.boeing.com/gs5/BCACore/Treeview/Images/minus.gif')} </STYLE>
<SCRIPT language="javascript">
[/HTML]
- var Op8=window.opera
-
var ns6Op8=(document.getElementById&&!document.all)||Op8
-
var ie4=document.all&&!Op8
-
-
/*************************************************************************
-
Function Name : fncheckcontained
-
Description : function called on click of the Item details.
-
Input Parameters : e - Event Clicked
-
Returned Values : None
-
*************************************************************************/
-
function fncheckcontained(e)
-
{
-
var lblncontained; // Boolean Variable to hold the status of the ID
-
var lstrCurrentItem; //Variable to hole current Item.
-
var lstrfoldercontent; //Variable to hole folder content.
-
lblncontained=0;
-
lstrCurrentItem=ns6Op8? e.target : event.srcElement;
-
//alert('lstrCurrentItem.id:' + lstrCurrentItem.id);
-
-
if (lstrCurrentItem.id=="foldheaderTreeView")
-
{
-
//alert('id==foldheaderTreeView');
-
lblncontained=1;
-
}
-
else
-
while (ns6Op8&&lstrCurrentItem.parentNode|| (ie4&&lstrCurrentItem.parentElement))
-
{
-
//alert('in loop:' + lstrCurrentItem.id);
-
if (lstrCurrentItem.id=="foldheaderTreeView"|| lstrCurrentItem.id=="foldinglistTreeView")
-
{
-
lblncontained=(lstrCurrentItem.id=="foldheaderTreeView")? 1 : 0
-
break;
-
}
-
lstrCurrentItem=ns6Op8? lstrCurrentItem.parentNode : lstrCurrentItem.parentElement
-
}
-
-
if (lblncontained)
-
{
-
lstrfoldercontent=ns6Op8? lstrCurrentItem.nextSibling.nextSibling : lstrCurrentItem.all.tags("UL")[0]
-
//alert('lstrfoldercontent.style.display:' + lstrfoldercontent.style.display);
-
if (lstrfoldercontent.style.display=="none")
-
{
-
lstrfoldercontent.style.display=""
-
// Ver 1$ Start
-
lstrCurrentItem.style.listStyleImage= "url(https://eportal-gad5-dev.ca.boeing.com/gs5/BCACore/Treeview/Images/minus.gif)"
-
// Ver 1$ End
-
}
-
else
-
{
-
lstrfoldercontent.style.display="none"
-
// Ver 1$ Start
-
lstrCurrentItem.style.listStyleImage= "url(https://eportal-gad5-dev.ca.boeing.com/gs5/BCACore/Treeview/Images/plus.gif)"
-
// Ver 1$ End
-
}
-
}
-
event.cancelBubble = true;
-
}
-
function fnNewWindow(lstrurl,ablnWindowStatus)
-
{
-
var lstrPageName; //variable to hold Page name.
-
var lstrnewWind; //variable to hold Window status.
-
var lstrPopupName;
-
var d = new Date();
-
lstrPageName = lstrurl;
-
if(lstrPageName.substring(0,3).toUpperCase()=="WWW")
-
lstrPageName = "http://"+lstrPageName;
-
-
if ((lstrPageName.substring(0,4).toUpperCase()!="HTTP")&& (lstrPageName.substring(0,4).toUpperCase()!="FILE"))
-
lstrPageName = "file:"+lstrPageName;
-
else if(lstrPageName.substring(0,4).toUpperCase()!="FILE")
-
lstrPageName = lstrPageName
-
if (ablnWindowStatus == 0)
-
document.location.href=lstrPageName;
-
else
-
{
-
var wLeft = 50 + 10 * Math.floor(Math.random()*50);
-
var wTop = 50 + 10 * Math.floor(Math.random()*50);
-
lstrPopupName = "New_Win" + d.getTime();
-
window.open(lstrPageName,lstrPopupName,"width=640,height=480,left=" + wLeft + ",top=" + wTop + ",toolbar=yes,status=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,directories=yes");
-
}
-
}
[HTML]
</script>
<UL>
<LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);">
<U><A onclick="javascript
:fnNewWindow('http://woot.com','1')" >test</A></U>
</LI>
<UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL>
<LI id=foldheaderTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('http://www.boeing.com','1')" >boeing.com</A></U>
<UL id=foldinglistTreeView style="DISPLAY: none;head: " onclick = "javascript
:fncheckcontained(event);">
<LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('http://woot.com','1')" >Test</A></U>
</LI>
<UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL>
<LI id=foldheaderTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('http://www.asp.net','1')" >ASP.NET</A></U>
<UL id=foldinglistTreeView style="DISPLAY: none;head: " onclick = "javascript
:fncheckcontained(event);">
<LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('http://www.usps.org','1')" >usps.org</A></U>
</LI>
<UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL>
</UL></LI><LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);" ><U><A onclick="javascript
:fnNewWindow('http://www.ski.org','1')" >ski.org</A></U>
</LI>
<UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL>
</UL></LI><LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);" ><U><A onclick="javascript
:fnNewWindow('http://inside.boeing.com','1')" >inside.boeing.com</A></U></LI><UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL><LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('asdfasdf','1')" >asdfasdf</A></U></LI><UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL><LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('http://www.cnn.com','1')" >cnn.com</A></U></LI><UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL><LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('asdfadf','1')" >etwtwa</A></U></LI><UL id=foldinglistTreeView style="DISPLAY: none; head: " onclick = "javascript
:fncheckcontained(event);"> </UL><LI id=foldheaderListTreeView onclick = "javascript
:fncheckcontained(event);"><U><A onclick="javascript
:fnNewWindow('http://www.foxnews.com','1')" >foxnews</A></U></LI>
<UL id=foldinglistTreeView style="DISPLAY: block;head: " onclick = "javascript
:fncheckcontained(event);"> </UL>
</UL>
</body>
</html>[/HTML]