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 / ie.javascript < prev    next >
Encoding:
Text File  |  2004-07-12  |  2.3 KB  |  78 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.  
  17. function Toggle(button)
  18. {
  19.     ypos = document.body.scrollTop;
  20.  
  21.     src = button.firstChild.src.split('/');
  22.     srcparts = src[src.length-1].split('_');
  23.     if (srcparts[1]=='op.gif')
  24.     {
  25.         button.firstChild.src= srcparts[0] + '_neer.gif';
  26.         button.parentNode.nextSibling.style.display='';
  27.     }
  28.     else if (srcparts[1]=='neer.gif')
  29.     {
  30.         button.firstChild.src= srcparts[0] + '_op.gif';
  31.         button.parentNode.nextSibling.style.display='none';
  32.     }
  33.     
  34. }
  35.  
  36.  
  37. function DoRecursive(node,newDisplay,newImgSuffix)
  38. {
  39.   if (node.hasChildNodes())
  40.   {                      
  41.     if (node.style!=null && node.style.display!=newDisplay)
  42.     {
  43.         if (node.previousSibling && node.previousSibling.firstChild && node.previousSibling.firstChild.firstChild && node.previousSibling.firstChild.firstChild.src && node.previousSibling.firstChild.firstChild.src.indexOf('_pre') <0 )
  44.         {
  45.             node.style.display=newDisplay;
  46.  
  47.             src = node.previousSibling.firstChild.firstChild.src.split('/');
  48.             srcparts = src[src.length-1].split('_');
  49.  
  50.             node.previousSibling.firstChild.firstChild.src=srcparts[0]+newImgSuffix;
  51.         }
  52.     }
  53.     DoRecursive(node.firstChild,newDisplay,newImgSuffix);
  54.   }
  55.   if (node.nextSibling)
  56.     DoRecursive(node.nextSibling,newDisplay,newImgSuffix);
  57. }
  58.  
  59.  
  60.  
  61. function ToggleAll(button)
  62. {
  63.     src = button.firstChild.src.split('/');
  64.     srcparts = src[src.length-1].split('_');
  65.     
  66.     if (srcparts[1]=='op.gif')
  67.     {
  68.         DoRecursive(button.parentNode.nextSibling,'','_neer.gif');        
  69.     }
  70.     else if (srcparts[1]=='neer.gif')
  71.     {
  72.         DoRecursive(button.parentNode.nextSibling,'none','_op.gif');        
  73.     }
  74.     
  75.     event.cancelBubble=true;
  76.     return false;
  77. }
  78.