home *** CD-ROM | disk | FTP | other *** search
- <HTML>
- <HEAD>
- <TITLE></TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
- <STYLE>
- <!--
- .NormTxt
- {
- color: black;
- background-color:white;
- cursor:default;
- }
-
- .HltTxt
- {
- color: red;
- background-color:white;
- cursor:default;
- }
-
- .SelTxt
- {
- color: white;
-
- background-color:0000a0;
- cursor:default;
- }
- .linormal
- {
- list-style-type: none;
- display: list-item;
- color: black;
- background-color: white;
- }
- -->
- </STYLE>
- <SCRIPT language="javascript">
-
- var DropText;
- var bDrag = 0;
- var SelItem = null;
-
-
- function HltLE (CID, Flag)
- {
- ListElement = window.event.srcElement;
-
- if (ListElement.parentElement.value == 10)
- return;
-
-
- if (Flag)
- {
- ListElement.className = "HltTxt";
- }
- else
- {
- ListElement.className = "NormTxt";
- }
- }
-
- function MoveOverLi(CID, Flag)
- {
- var bFirst;
-
- if ((window.event.srcElement.tagName == "SPAN") || (window.event.srcElement.tagName == "IMG"))
- li = window.event.srcElement.parentElement;
- else
- li = window.event.srcElement;
-
- if ((li.value == 10) || (!bDrag) )
- return;
-
- lis = document.all.tags("LI");
- if (li == lis[0])
- bFirst = 1;
- else
- bFirst = 0;
-
-
- if (Flag)
- {
- li.all.DragDiv.innerHTML = " <img src='drop.gif'>" + DropText;
- if (bFirst)
- {
- if (event.offsetY < (li.offsetTop + li.offsetHeight/2))
- {
- li.style.borderTopStyle = "groove";
- li.style.borderBottomStyle = "none";
- }
- else
- {
- li.style.borderTopStyle = "none";
- li.style.borderBottomStyle = "groove";
- }
- }
- else
- li.style.borderBottomStyle = "groove";
-
- if (li.offsetTop<= document.body.scrollTop)
- document.body.doScroll ("scrollbarUp");
- if ((li.offsetTop+li.offsetHeight) >= (document.body.scrollTop+document.body.clientHeight))
- document.body.doScroll ("scrollbarDown");
-
-
- }
- else
- {
- li.all.DragDiv.innerHTML = "";
- li.style.borderBottomStyle = "none";
- li.style.borderTopStyle = "none";
- }
- }
-
-
- function ClickPoint (CID)
- {
- CurElement = window.event.srcElement;
- if (SelItem && SelItem!=CurElement)
- {
- SelItem.parentElement.value = 1;
- SelItem.className = "NormTxt";
- }
-
- CurElement.className = "SelTxt";
- DropText = CurElement.outerText;
- CurElement.parentElement.value=10;
-
- SelItem = CurElement;
- }
-
- function fnMoveItem (CID)
- {
- CurElement = window.event.srcElement;
- if ((window.event.button == 1) && (!bDrag))
- {
- ClickPoint (CID)
- bDrag = 1;
- DropText = SelItem.outerText;
- }
- else
- {
- if ((window.event.button != 1) && bDrag)
- bDrag = 0;
- }
- }
-
- function ClearDrag(CID)
- {
- var li = null;
-
- //li = window.event.srcElement.parentElement;
- if (bDrag)
- {
- bDrag = 0;
- if (CID != null)
- {
- lis = document.all.tags("LI");
- for (i=0; i < lis.length; i++)
- {
- if (lis[i].CIDVal == CID)
- {
- li = lis[i];
- break;
- }
- }
- if ((!li) || (!CID))
- return;
- li.all.DragDiv.innerHTML = "";
- InsertRemoveLi(li);
- }
- }
- }
-
-
- function InsertRemoveLi (targetLi)
- {
- var bAfter = 1;
-
- if (targetLi == SelItem.parentElement)
- return;
- if (!SelItem.parentElement)
- return;
-
-
- tmp = SelItem;
-
- targetLi.all.SpanId.className="NormTxt";
-
- if (targetLi.style.borderTopStyle == "groove")
- {
- targetLi.style.borderTopStyle = "none";
- bAfter = 0;
- }
-
- if (targetLi.style.borderBottomStyle == "groove")
- targetLi.style.borderBottomStyle = "none";
-
- if (bAfter)
- targetLi.outerHTML=targetLi.outerHTML+SelItem.parentElement.outerHTML;
- else
- targetLi.outerHTML=SelItem.parentElement.outerHTML + targetLi.outerHTML;
-
- SelItem.parentElement.outerHTML = "";
-
- lis = document.all.tags("LI");
-
- for (i=0; i < lis.length; i++)
- {
- if (lis[i].value == 10)
- SelItem = lis[i].all.SpanId;
- }
- }
-
-
- function SaveCTOrder ()
- {
- var CTss = Source.selectNodes("root/CTLIST/CATEGORY");
- var CTList = Source.selectSingleNode("root/CTLIST");
- var childLabel = CTList.firstChild;
- var child;
- var id;
-
- lis = document.all.tags("LI");
- for (i=0; i < lis.length; i++)
- {
- id = lis[i].CIDVal;
- child = Source.selectSingleNode("root\/CTLIST\/CATEGORY[@CID="+id+"]");
- if (child && (child != childLabel))
- {
- CTList.removeChild(child);
- CTList.insertBefore(child, childLabel);
- }
- else
- childLabel=childLabel.nextSibling;
- }
-
- }
-
-
- function fnDragCheck ()
- {
- if ((window.event.button != 1) && bDrag)
- bDrag = 0;
- }
-
- function Init (SourceXML)
- {
- Source = SourceXML;
-
- Style = new ActiveXObject("Microsoft.XMLDOM");
- Style.async = false;
- bOK = Style.load("tree.xsl");
-
- szHTML = Source.transformNode(Style);
- document.all.TreeRes.innerHTML = szHTML;
- }
-
- function RemoveEvent ()
- {
- window.event.returnValue = false;
- }
-
- function onKeyPress ()
- {
- if (event.keyCode == 13)
- top.onOKey();
-
- if (event.keyCode == 27)
- top.onCancel();
- }
-
-
- </SCRIPT>
- </HEAD>
-
- <BODY style="background-color:white" onselectstart=RemoveEvent() onmouseup=ClearDrag(null) ondragstart=RemoveEvent() onkeydown=onKeyPress()>
- <DIV ID="TreeRes" style="margin-top:-10px; margin-left:-5px; background-color:white;">
- </DIV>
- </BODY>
-
- </HTML>
-