home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / xml2html.js < prev    next >
Encoding:
JavaScript  |  2004-07-12  |  3.7 KB  |  170 lines

  1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. *     http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. //MSIE
  17. function f(e){
  18.     if (e.className=="ci") {
  19.         if (e.children(0).innerText.indexOf("\n")>0)
  20.             fix(e,"cb");
  21.     }
  22.     if (e.className=="di") {
  23.         if (e.children(0).innerText.indexOf("\n")>0)
  24.             fix(e,"db");
  25.     } e.id="";
  26. }
  27. function fix(e,cl){
  28.     e.className=cl;
  29.     e.style.display="block";
  30.     j=e.parentElement.children(0);
  31.     j.className="c";
  32.     k=j.children(0);
  33.     k.style.visibility="visible";
  34.     k.href="#";
  35. }
  36. function ch(e) {
  37.     mark=e.children(0).children(0);
  38.     if (mark.innerText=="+") {
  39.         mark.innerText="-";
  40.         for (var i=1;i<e.children.length;i++) {
  41.             e.children(i).style.display="block";
  42.         }
  43.     }
  44.     else if (mark.innerText=="-") {
  45.         mark.innerText="+";
  46.         for (var i=1;i<e.children.length;i++) {
  47.             e.children(i).style.display="none";
  48.         }
  49.     }
  50. }
  51. function ch2(e) {
  52.     mark=e.children(0).children(0);
  53.     contents=e.children(1);
  54.     if (mark.innerText=="+") {
  55.         mark.innerText="-";
  56.         if (contents.className=="db"||contents.className=="cb") {
  57.             contents.style.display="block";
  58.         }
  59.         else {
  60.             contents.style.display="inline";
  61.         }
  62.     }
  63.     else if (mark.innerText=="-") {
  64.         mark.innerText="+";
  65.         contents.style.display="none";
  66.     }
  67. }
  68. function cl() {
  69.     e=window.event.srcElement;
  70.     if (e.className!="c") {
  71.         e=e.parentElement;
  72.         if (e.className!="c") {
  73.             return;
  74.         }
  75.     }
  76.     e=e.parentElement;
  77.     if (e.className=="e") {
  78.         ch(e);
  79.     }
  80.     if (e.className=="k") {
  81.         ch2(e);
  82.     }
  83. }
  84.  
  85. //mozilla
  86. function moz_f(){
  87.     clean=document.getElementsByName('clean');
  88.     for(i=0; i<clean.length;i++)
  89.     {
  90.         e = clean[i];
  91.         if (e.className=="ci") {
  92.             if (e.childNodes[1].childNodes[0].nodeValue.indexOf("\n")>0)
  93.                 moz_fix(e,"cb");
  94.         }
  95.         if (e.className=="di") {
  96.             if (e.childNodes[1].nodeValue.indexOf("\n")>0)
  97.                 moz_fix(e,"db");
  98.         }
  99.     }
  100. }
  101. function moz_fix(e,cl){
  102.     e.className=cl;
  103.     e.style.display="block";
  104.     j=e.parentNode.childNodes[1];
  105.     j.className="c";
  106.     k=j.childNodes[0];
  107.     k.style.visibility="visible";
  108.     k.href="#";
  109. }
  110. function moz_ch(e) {
  111.     mark = e.childNodes[1].childNodes[1];
  112.  
  113.     if (mark.childNodes[0].nodeValue=="+") {
  114.         mark.childNodes[0].nodeValue="-";
  115.         for (var i=2;i<e.childNodes.length;i++) {
  116.             if(e.childNodes[i].nodeName != "#text")
  117.                 e.childNodes[i].style.display="block";
  118.         }
  119.     }
  120.     else if (mark.childNodes[0].nodeValue=="-") {
  121.         mark.childNodes[0].nodeValue="+";
  122.         for (var i=2;i<e.childNodes.length;i++) {
  123.             if(e.childNodes[i].nodeName != "#text")
  124.                 e.childNodes[i].style.display="none";
  125.         }
  126.     }
  127. }
  128. function moz_ch2(e) {
  129.     mark = e.childNodes[1].childNodes[0];
  130.     contents=e.childNodes[2];
  131.     if (mark.childNodes[0].nodeValue=="+") {
  132.         mark.childNodes[0].nodeValue="-";
  133.         if (contents.className=="db"||contents.className=="cb") {
  134.             contents.style.display="block";
  135.         }
  136.         else {
  137.             contents.style.display="inline";
  138.         }
  139.     }
  140.     else if (mark.childNodes[0].nodeValue=="-") {
  141.         mark.childNodes[0].nodeValue="+";
  142.         contents.style.display="none";
  143.     }
  144. }
  145.  
  146. function moz_cl(evnt) {
  147.     e=evnt.target.parentNode;
  148.  
  149.     if (e.className != "c") {
  150.         e=e.parentNode
  151.         if (e.className!="c") {
  152.             return;
  153.         }
  154.     }
  155.     e=e.parentNode
  156.     if (e.className=="e") {
  157.         moz_ch(e);
  158.     }
  159.     if (e.className=="k") {
  160.         moz_ch2(e);
  161.     }
  162. }
  163.  
  164. function ex(){}
  165. function h(){window.status=" ";}
  166. if(document.all)
  167.     document.onclick=cl;
  168. else if(document.getElementById)
  169.     document.onclick=moz_cl;
  170.