home *** CD-ROM | disk | FTP | other *** search
/ PC Active 2005 July/August / PCA1707.ISO / intface / pca / TOOLS.JS < prev   
Encoding:
JavaScript  |  2005-05-26  |  2.6 KB  |  69 lines

  1. /*
  2. versie 1.0 : Andre van Groenestein
  3. versie 1.5 : - algemene scripts verzameld in interactie.js
  4. */
  5.  
  6. function PopupVenster(nummer, soort)
  7. {
  8.     switch (soort)
  9.     {
  10.         case 'inst' : Item = tool[nummer + 1]; break;
  11.         case 'web'  : Item = tool[nummer + 2]; break;
  12.         case 'info' : Item = tool[nummer + 3]; break;
  13.     }
  14.  
  15.     ItemTitel    = tool[nummer];
  16.     PopupBreedte = 450;
  17.     PopupLengte  = 240;
  18.     if (soort == 'web')
  19.     {    PopupLengte  = 100;
  20.         PopupBreedte = Item.length * 7 + 65;
  21.     }
  22.     PCAinterfaceX = (screen.availWidth - PopupBreedte) / 2 - 5;
  23.     PCAinterfaceY = ((screen.availHeight - PopupLengte) / 2) - 19;
  24.     PopupWeergave = "resizable=no,status=no,scrollbars=no";
  25.     if ((Item.length * 0.5) + 85 > 300)
  26.     {    PopupWeergave = PopupWeergaveScroll;
  27.         // wordt gebruikt in window.open() functie. Bug in NS6:
  28.         // als slechts een venster wordt geopend, dus zonder bestand in te laden:
  29.         // window.open(""), worden toch geen scrollbars getoond. Wordt wel een
  30.         // bestand ingeladen: window.open("bestand"), dan verschijnen er
  31.         // wel scrollbars, maar pas als ze werkelijk nodig zijn...
  32.     }
  33.     if (soort == 'inst')
  34.     {    if (Item.lastIndexOf(".pca", Item.length - 1) != -1)
  35.             window.location.href = Item;
  36.         else if (Item.lastIndexOf(".htm", Item.length - 1) != -1)
  37.             lokaalVenster = window.open(Item, "lokaalvenster", "width=400,height=200,top=" + PCAinterfaceY + ",left=" + PCAinterfaceX + ",resizable=no,status=no,scrollbars=no")
  38.  
  39.         parent.parent.script.PauzeerMuziek();
  40.     }
  41.     else
  42.     {    Bestand = "";
  43.         lokaalVenster = window.open(Bestand, "lokaalvenster", "width=" + PopupBreedte + ",height=" + PopupLengte + "," + PositieY + "=" + PCAinterfaceY + "," + PositieX + "=" + PCAinterfaceX + PopupWeergave);
  44.         PopupWeergave = "resizable=no,status=no,scrollbars=no";
  45.         SchrijfInhoud(Item, ItemTitel, PopupBreedte-60, nummer);
  46.     }
  47. }
  48.  
  49. function SchrijfInhoud(Item, ItemTitel, PopupBreedte, nummer)
  50. {    ldw('<html><head><title>Informatie</title>');
  51.     ldw('<link rel="STYLESHEET" type="text/css" href="../../cdrom.css">');
  52.     ldw('<link rel="STYLESHEET" type="text/css" href="../pcactive.css">');
  53.     ldw('<script type="text/javascript" src="../popupsSluiten.js"></script>');
  54.     ldw('</head>');
  55.     ldw('<body background="../images/pcinfobk.gif">');
  56.     ldw('<div style="position:absolute; top:30px; left:40px; width:' + PopupBreedte + '">');
  57.     if (Item.substring(0, 4) == 'http')
  58.         ldw('<center><a class=weblink href="' + Item + '" target=WebVenster>' + Item + '</a></center>');
  59.     else
  60.     {    ldw('<b>' + ItemTitel + '</b><p>');
  61.         ldw(Item);
  62.         ldw('<p>');
  63.         ldw('<a href="javascript:opener.PopupVenster(' + nummer + ', \'inst\')">installeren</a>');
  64.     }
  65.     ldw('</div>');
  66.     ldw('</body></html>');
  67. }
  68.  
  69.