home *** CD-ROM | disk | FTP | other *** search
/ Beweegwijzer / beweegwijzer.iso / setup / _SETUP.1 / CopyPasteBtn.htc < prev    next >
Encoding:
Text File  |  2001-10-18  |  3.9 KB  |  66 lines

  1. <PUBLIC:ATTACH EVENT="onmouseover" HANDLER="Hilite" />
  2. <PUBLIC:ATTACH EVENT="onmouseout"  HANDLER="Restore" />
  3. <PUBLIC:ATTACH EVENT="onclick"  HANDLER="Choose" />
  4.  
  5. <script language="JavaScript">
  6. function Hilite() {
  7.   if (groeneWeken) return;
  8.   S = element.src;
  9.   element.src = S.slice(0,S.length-5) + '1' + S.slice(S.length-4);
  10.   }
  11.  
  12. function Restore() {
  13.   if (groeneWeken) return;
  14.   S = element.src;
  15.   element.src = S.slice(0,S.length-5) + '0' + S.slice(S.length-4);
  16.   }
  17.   
  18. function Choose() {
  19. if (groeneWeken) return;
  20.   switch (element.type) {
  21.     case 'copy':
  22.       cpweek = weekNum;
  23.       cpdag = chosenDag;
  24.       CopyPasteBtn[1].style.visibility = 'inherit';
  25.     break;
  26.     case 'paste':
  27.       if ((chosenDag == cpdag) && (weekNum == cpweek)) {
  28.         return;
  29.         }
  30.     
  31.       if (parent.goPage == 'beweegplan.html') {
  32.         tt = parent.userRoot.selectSingleNode("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']").getAttribute("totaal");
  33.         parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("totaal",tt);
  34.         rr = parent.userRoot.selectSingleNode("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']").getAttribute("result");
  35.         parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("result",rr); 
  36.         gg = parent.userRoot.selectSingleNode("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']").getAttribute("gewicht");
  37.         parent.userRoot.selectSingleNode("data/planweek[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("gewicht",gg);
  38.         for (var i=0; i<parent.userRoot.selectNodes("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act").length; i++) {
  39.           newAct = parent.userRoot.selectNodes("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act")[i].cloneNode(false);
  40.           theAct = parent.userRoot.selectSingleNode("data/planweek[@num='"+weekNum+"']/dag[@naam='"+chosenDag+"']").appendChild(newAct);
  41.           for (var j=0; j<parent.userRoot.selectNodes("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act")[i].selectNodes("item").length; j++) {
  42.             newItem = parent.userRoot.selectNodes("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act")[i].selectNodes("item")[j].cloneNode(false);
  43.             theItem = theAct.appendChild(newItem);
  44.             theItem.text = newItem = parent.userRoot.selectNodes("data/planweek[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act")[i].selectNodes("item")[j].text;
  45.             }
  46.           }
  47.         }
  48.       else {
  49.         tt = parent.userRoot.selectSingleNode("data/week[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']").getAttribute("totaal");
  50.         parent.userRoot.selectSingleNode("data/week[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("totaal",tt);
  51.         rr = parent.userRoot.selectSingleNode("data/week[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']").getAttribute("result");
  52.         parent.userRoot.selectSingleNode("data/week[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("result",rr); 
  53.         gg = parent.userRoot.selectSingleNode("data/week[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']").getAttribute("gewicht");
  54.         parent.userRoot.selectSingleNode("data/week[@num = '"+weekNum+"']/dag[@naam = '"+chosenDag+"']").setAttribute("gewicht",gg);
  55.         for (var i=0; i<parent.userRoot.selectNodes("data/week[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act").length; i++) {
  56.           newAct = parent.userRoot.selectNodes("data/week[@num = '"+cpweek+"']/dag[@naam = '"+cpdag+"']/act")[i].cloneNode(false);
  57.           parent.userRoot.selectSingleNode("data/week[@num='"+weekNum+"']/dag[@naam='"+chosenDag+"']").appendChild(newAct);
  58.           }
  59.         }
  60.       getWeek();
  61.       getDag();
  62.     break;
  63.     }
  64.   }  
  65. </script>
  66.