home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / cpjscript.chm / html / heading.js < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.0 KB  |  73 lines

  1. // <script>
  2.  
  3.  
  4. document.onclick = showDetails
  5. document.onmouseover = doDocumentOnMouseOver ;
  6. document.onmouseout = doDocumentOnMouseOut ;
  7. var imgload1 = new Image();
  8. imgload1.src = "/images/blueplus.gif";
  9. var imgload2 = new Image();
  10. imgload2.src = "/images/blueminus.gif";
  11.  
  12. // CHANGE HEADLINE COLOR ONMOUSEOVER
  13.  
  14. function doDocumentOnMouseOver() {
  15.     var eSrc = window.event.srcElement ;
  16.     if (eSrc.className == "clsHeading") 
  17.     { eSrc.style.color= "#6666FF" }
  18.  
  19.   }
  20.  
  21. // CHANGE HEADLINE COLOR ONMOUSEOUT
  22. function doDocumentOnMouseOut() {
  23.     var eSrc = window.event.srcElement ;
  24.     if (eSrc.className == "clsHeading") 
  25.         { eSrc.style.color= "#000000" }
  26.   }
  27. var lastId = 0;
  28. function showDetails() {
  29.  
  30.     if (window.event.srcElement.className == "clsHeading") 
  31.     {
  32.         var idString = window.event.srcElement.id
  33.         var idNumber = idString.substr((idString.length-1))
  34.         var eSrc = window.event.srcElement.parentElement
  35.         
  36.         if (lastId == idNumber) 
  37.         {
  38.             /*    If the current display mode is none then change it to display the 
  39.                 selected blurb and hisde the explanation
  40.             */        
  41.             if (window["idBlurb" + idNumber].style.display == 'none') 
  42.             {
  43.                 // Change the image to be a minus
  44.                 window["img" + idNumber].src ="images/blueminus.gif"; 
  45.                 window["idBlurb" + idNumber].style.display = 'block';
  46.                 explanation.style.display = 'none';
  47.             }
  48.             else 
  49.             {
  50.                 // Change the image to be a minus
  51.                 window["img" + idNumber].src ="images/blueplus.gif"; 
  52.                 window["idBlurb" + idNumber].style.display = 'none';
  53.                 explanation.style.display = 'block'    ;
  54.             }    
  55.                 
  56.         }
  57.         else 
  58.         {
  59.             if (lastId != 0) 
  60.                 {
  61.                     window["img" + lastId].src ="images/blueplus.gif"
  62.                     window["idBlurb" + lastId].style.display = 'none';
  63.                                         
  64.                 }
  65.             window["img" + idNumber].src ="images/blueminus.gif"; 
  66.             explanation.style.display = 'none'
  67.             window["idBlurb" + idNumber].style.display = 'block'
  68.         }        
  69.  
  70.         lastId=idNumber
  71.     }
  72.     window.event.cancelBubble=true
  73. }