home *** CD-ROM | disk | FTP | other *** search
/ PC Active 2002 December / pca1412.iso / intface / pca / TOOLS.JS < prev   
Encoding:
JavaScript  |  2002-09-26  |  2.4 KB  |  62 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. {    Item         = eval(soort + nummer);
  8.     ItemTitel    = titel[nummer];
  9.     PopupBreedte = 450;
  10.     PopupLengte  = 240;
  11.     PCAinterfaceX = (screen.availWidth - PopupBreedte) / 2 - 5;
  12.     PCAinterfaceY = ((screen.availHeight - PopupLengte) / 2) - 19;
  13.     if (soort == 'web')
  14.     {    PopupLengte  = 100;
  15.         PopupBreedte = Item.length * 7 + 65;
  16.     }
  17.     PopupWeergave = "resizable=no,status=no,scrollbars=no";
  18.     if ((Item.length * 0.5) + 85 > 300)
  19.     {    PopupWeergave = PopupWeergaveScroll;
  20.         // wordt gebruikt in window.open() functie. Bug in NS6:
  21.         // als slechts een venster wordt geopend, dus zonder bestand in te laden:
  22.         // window.open(""), worden toch geen scrollbars getoond. Wordt wel een
  23.         // bestand ingeladen: window.open("bestand"), dan verschijnen er
  24.         // wel scrollbars, maar pas als ze werkelijk nodig zijn...
  25.     }
  26.     if (soort == 'inst')
  27.     {    if (Item.lastIndexOf(".pca", Item.length - 1) != -1)
  28.             window.location.href = Item;
  29.         else if (Item.lastIndexOf(".htm", Item.length - 1) != -1)
  30.             lokaalVenster = window.open(Item, "lokaalvenster", "width=400,height=200,top=" + PCAinterfaceY + ",left=" + PCAinterfaceX + ",resizable=no,status=no,scrollbars=no")
  31.  
  32.         parent.parent.script.PauzeerMuziek();
  33.     }
  34.     else
  35.     {    Bestand = "";
  36.         lokaalVenster = window.open(Bestand, "lokaalvenster", "width=" + PopupBreedte + ",height=" + PopupLengte + "," + PositieY + "=" + PCAinterfaceY + "," + PositieX + "=" + PCAinterfaceX + PopupWeergave);
  37.         PopupWeergave = "resizable=no,status=no,scrollbars=no";
  38.         SchrijfInhoud(Item, ItemTitel);
  39.     }
  40. }
  41.  
  42. function SchrijfInhoud(Item, ItemTitel)
  43. {    ldw('<html><head><title>Informatie</title>');
  44.     ldw('<link rel="STYLESHEET" type="text/css" href="../../cdrom.css">');
  45.     ldw('<link rel="STYLESHEET" type="text/css" href="../pcactive.css">');
  46.     ldw('<script type="text/javascript" src="../popupsSluiten.js"></script>');
  47.     ldw('</head>');
  48.     ldw('<body background="../images/pcinfobk.gif">');
  49.     ldw('<table cellspacing=0 cellpadding=0>');
  50.     ldw('<tr><td width=30> </td>');
  51.     ldw('<td><br>');
  52.     if (Item.substring(0, 4) == 'http')
  53.         ldw('<center><a class=weblink href="' + Item + '" target=WebVenster>' + Item + '</a></center>');
  54.     else
  55.     {    ldw('<b>' + ItemTitel + '</b><p>');
  56.         ldw(Item);
  57.     }
  58.     ldw('</td></tr></table>');
  59.     ldw('</body></html>');
  60. }
  61.  
  62.