home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 October / PCgo 2008-10 (DVD).iso / interface / contents / vollversionen_6617 / 21733 / files / chrome / content / main.js < prev    next >
Encoding:
Text File  |  2008-08-20  |  2.2 KB  |  60 lines

  1. tabString = new Array();
  2. tabString[0] = "Programmname zur Suche mit Zoozle";
  3. tabString[1] = "Programmname zur Suche mit SerialSite";
  4.  
  5.  
  6. searchString = new Array();
  7. searchString[0] = "http://www.zoozle.net/zoozle.php?q=#_#&s=serial";
  8. searchString[1] = "http://serialsite.com/search.php?q=#_#";
  9.  
  10. searchHomes = new Array();
  11. searchHomes[0] = "http://www.zoozle.net";
  12. searchHomes[1] = "http://serialsite.com";
  13.  
  14. function init() {
  15.     mainWin = document.getElementById("main");
  16.     swidth  = mainWin.width;
  17.     sheight = mainWin.height;
  18.     mainWin.setAttribute("screenY",screen.height/2-sheight/2);
  19.     mainWin.setAttribute("screenX",screen.width/2-swidth/2);
  20.     for(c=0; c<=tabString.length; c++) {
  21.             cItem = document.getElementById("box"+c);
  22.             cItem.inputField.value = tabString[c];
  23.    }
  24. }
  25. function sSearch(tab) {
  26.     cItem = document.getElementById("box"+tab);
  27.     searchText = cItem.inputField.value;
  28.     cItem = document.getElementById("sViewer");
  29.     cItem.loadURI(searchHomes[tab]);
  30.     sURL = searchString[tab].replace(/#_#/g, searchText);
  31.     cItem.loadURI(sURL);
  32.     if(tab > 0) {
  33.         alert("Suche gestartet - bitte warten Sie bis die Ergebnisse angezeigt werden.\nKlicken Sie dann auf den OK-Knopf!");
  34.         aRefs = content.document.getElementsByTagName('a').length;
  35.         for (a=0; a<=aRefs; a++) {
  36.             cLink = content.document.getElementsByTagName('a')[a].href;
  37.             if(cLink.search(/javascript:serial/) != -1) {
  38.                 cLink = cLink.replace(/javascript:serial/g,"");
  39.                 cLink = cLink.replace(/()/,"/serial.php?serial=");
  40.                 cLink = cLink.replace(/\(/g,"");
  41.                 cLink = cLink.replace(/\)/g,"");
  42.                 content.document.getElementsByTagName('a')[a].href = cLink;
  43.             }
  44.             else {
  45.                 if(cLink.search(/serialsite.com/) != -1) {
  46.                     content.document.getElementsByTagName('a')[a].href = cLink;
  47.                 }
  48.             }
  49.         }
  50.     }
  51. }
  52.  
  53. function checkBox(tab) {
  54.     cItem = document.getElementById("box"+tab);
  55.     searchText = cItem.inputField.value;
  56.     if(searchText==tabString[tab]){
  57.         cItem.inputField.value = "";
  58.     }
  59. }
  60.