home *** CD-ROM | disk | FTP | other *** search
/ Chip 2009 November / Chip_2009.11_CD.iso / Chip_WPI / WPIScripts / configwizard.js < prev    next >
Encoding:
JavaScript  |  2007-08-10  |  53.9 KB  |  2,050 lines

  1. //
  2. // Date Last Modified: Tuesday June 26th, 2007
  3. //
  4. // Modified By: Kelsenellenelvian
  5. //
  6.  
  7.  
  8. function CreateNavigation()
  9. {
  10.     position="configwizard.js";
  11.     whatfunc="CreateNavigation()";
  12.  
  13.     if (SortWithinCats)
  14.         configList.sort(byName);
  15.     
  16.     var txt="";
  17.     txt='<table border="0">';
  18.     for (var i=0; i<configList.length && configList[i] != null; i++)
  19.     {
  20.         txt += '<tr>';
  21.         txt += '<td class="opTxt" align="right" valign="top">'+ configList[i].ordr + ' </td>';
  22.         txt += '<td valign="top"><a class="opTxt" onClick="JumpToEntry(' + i + ')">' + configList[i].prog + '</a></td>';
  23.         txt += '</tr>';
  24.     }
  25.     txt += '</table>';
  26.  
  27.     document.getElementById("quickref").innerHTML=txt;
  28. }
  29.  
  30.  
  31. function CreateControls()
  32. {
  33.     position="configwizard.js";
  34.     whatfunc="CreateControls()";
  35.      
  36.     var txt=new String(); txt="";
  37.  
  38.     strFile=wpipath + "\\Common\\configwizardtemplate.htm";
  39.     if (!FileExists(strFile))
  40.     {
  41.         alert(getText(errCouldNotOpenFile)+" '"+strFile+"'.");
  42.         ExitWPI();
  43.     }
  44.     try 
  45.     {
  46.         tf=fso.OpenTextFile(strFile, 1);        
  47.         while (!tf.AtEndOfStream)
  48.             txt=tf.ReadAll();
  49.     }
  50.     catch (ex) 
  51.     { ; }
  52.     finally 
  53.     {    
  54.         tf.Close(); 
  55.     }
  56.      document.getElementById("layerconfig").innerHTML=txt;
  57.  
  58.     LocalizeConfigButtonsTexts();
  59. }
  60.  
  61.  
  62. function LocalizeConfigButtonsTexts()
  63. {
  64.     position="configwizard.js";
  65.     whatfunc="LocalizeConfigButtonsTexts()";
  66.      
  67.     document.getElementById("lblNavigation").innerHTML=getText(lblNavigation);
  68.  
  69.     document.getElementById("configFirst").value=getText(btnFirst);
  70.     document.getElementById("configPrevious").value=getText(btnPrevious);
  71.     document.getElementById("configNext").value=getText(btnNext);
  72.     document.getElementById("configLast").value=getText(btnLast);
  73.     document.getElementById("configAdd").value=getText(btnAdd);
  74.     document.getElementById("configClone").value=getText(btnClone);
  75.     document.getElementById("configDelete").value=getText(btnDelete);
  76.  
  77.     document.getElementById("configNewConfig").value=getText(btnNewConfig);
  78.     document.getElementById("configRead").value=getText(btnRead);
  79.     document.getElementById("configSave").value=getText(btnSave);
  80.     document.getElementById("configSaveAs").value=getText(btnSaveAs);
  81.     document.getElementById("configExit").value=getText(btnExit);
  82. }
  83.  
  84.  
  85. function LocalizeConfigTexts()
  86. {
  87.     position="configwizard.js";
  88.     whatfunc="LocalizeConfigTexts()";
  89.      
  90.     document.getElementById("lblName").innerHTML=getText(lblName);
  91.     document.getElementById("lblInstallOrder").innerHTML=getText(lblInstallOrder);
  92.     document.getElementById("lblDescription").innerHTML=getText(lblDescription);
  93.     document.getElementById("lblUniqueID").innerHTML=getText(lblUniqueID);
  94.     document.getElementById("lblDefault").innerHTML=getText(lblDefault);
  95.     document.getElementById("lblCategory").innerHTML=getText(lblCategory);
  96.     document.getElementById("lblForced").innerHTML=getText(lblForced);
  97.     document.getElementById("lblConfigurations").innerHTML=getText(lblConfigurations);
  98.     document.getElementById("lblDependentOf").innerHTML=getText(lblDependentOf);
  99.     document.getElementById("lblExcludes").innerHTML=getText(lblExcludes);
  100.     document.getElementById("lblCondition").innerHTML=getText(lblCondition);
  101.     document.getElementById("lblGrayedCondition").innerHTML=getText(lblGrayedCondition);
  102.     document.getElementById("lblRegistryBefore").innerHTML=getText(lblRegistryBefore);
  103.     document.getElementById("lblCommand1").innerHTML=getText(lblCommand1);
  104.     document.getElementById("lblCommand2").innerHTML=getText(lblCommand2);
  105.     document.getElementById("lblCommand3").innerHTML=getText(lblCommand3);
  106.     document.getElementById("lblCommand4").innerHTML=getText(lblCommand4);
  107.     document.getElementById("lblCommand5").innerHTML=getText(lblCommand5);
  108.     document.getElementById("lblCommand6").innerHTML=getText(lblCommand6);
  109.     document.getElementById("lblCommand7").innerHTML=getText(lblCommand7);
  110.     document.getElementById("lblCommand8").innerHTML=getText(lblCommand8);
  111.     document.getElementById("lblCommand9").innerHTML=getText(lblCommand9);
  112.     document.getElementById("lblCommand10").innerHTML=getText(lblCommand10);
  113.     document.getElementById("lblRegistryAfter").innerHTML=getText(lblRegistryAfter);
  114.     document.getElementById("lblPictureFile").innerHTML=getText(lblPictureFile);
  115.     document.getElementById("lblPictureDetails").innerHTML=getText(lblPictureDetails);
  116.     document.getElementById("lblPictureWidth").innerHTML=getText(lblPictureWidth);
  117.     document.getElementById("lblPictureHeight").innerHTML=getText(lblPictureHeight);
  118.     document.getElementById("lblTextLocation").innerHTML=getText(lblTextLocation);
  119.  
  120.  
  121.     document.getElementById("cbocats").options[0].text=getText(optOther);
  122.     document.getElementById("cbocats").options[1].text=getText(optApplications);
  123.     document.getElementById("cbocats").options[2].text=getText(optDrivers);
  124.     document.getElementById("cbocats").options[3].text=getText(optGames);
  125.     document.getElementById("cbocats").options[4].text=getText(optMultiMedia);
  126.     document.getElementById("cbocats").options[5].text=getText(optOffice);
  127.     document.getElementById("cbocats").options[6].text=getText(optRegistryTweaks);
  128.     document.getElementById("cbocats").options[7].text=getText(optSystem);
  129.     document.getElementById("cbocats").options[8].text=getText(optUtilities);
  130.     var opt = cbocats.getElementsByTagName("OPTGROUP");
  131.     opt[1].label = getText(lblUserDefined);
  132.  
  133.     document.getElementById("textl").options[0].text=getText(optTop);
  134.     document.getElementById("textl").options[1].text=getText(optBottom);
  135.     document.getElementById("textl").options[2].text=getText(optLeft);
  136.     document.getElementById("textl").options[3].text=getText(optRight);
  137. }
  138.  
  139.  
  140. function FillInConfig(CreateNav,pos)
  141. {
  142.     position="configwizard.js";
  143.     whatfunc="FillInConfig()";
  144.  
  145.     if (CreateNav)
  146.         CreateNavigation();
  147.  
  148.     document.getElementById("prog").value=configList[pos].prog;
  149.     document.getElementById("ordr").value=configList[pos].ordr;
  150.     document.getElementById("desc").value=configList[pos].desc;
  151.     document.getElementById("uid").value=configList[pos].uid;
  152.     document.getElementById("dflt").checked=configList[pos].dflt=="yes" ? 1 : 0;
  153.     document.getElementById("cbocats").value=configList[pos].cat;
  154.     document.getElementById("cat").value="";
  155.     document.getElementById("cat").style.visibility='hidden';
  156.     document.getElementById("forc").checked=configList[pos].forc=="yes" ? 1 : 0;
  157.     document.getElementById("SelectConfigs").value="blank";
  158.     document.getElementById("configs").value=configList[pos].configs;
  159.     document.getElementById("deps").value=configList[pos].deps;
  160.     document.getElementById("excl").value=configList[pos].excl;
  161.     document.getElementById("cond").value=configList[pos].cond;
  162.     document.getElementById("gcond").value=configList[pos].gcond;
  163.     document.getElementById("regb").value=configList[pos].regb;
  164.     document.getElementById("cmd1").value=configList[pos].cmd1;
  165.     document.getElementById("cmd2").value=configList[pos].cmd2;
  166.     document.getElementById("cmd3").value=configList[pos].cmd3;
  167.     document.getElementById("cmd4").value=configList[pos].cmd4;
  168.     document.getElementById("cmd5").value=configList[pos].cmd5;
  169.     document.getElementById("cmd6").value=configList[pos].cmd6;
  170.     document.getElementById("cmd7").value=configList[pos].cmd7;
  171.     document.getElementById("cmd8").value=configList[pos].cmd8;
  172.     document.getElementById("cmd9").value=configList[pos].cmd9;
  173.     document.getElementById("cmd10").value=configList[pos].cmd10;
  174.     document.getElementById("rega").value=configList[pos].rega;
  175.     document.getElementById("picf").value=configList[pos].picf;
  176.     document.getElementById("picw").value=configList[pos].picw;
  177.     document.getElementById("pich").value=configList[pos].pich;
  178.     document.getElementById("textl").value=configList[pos].textl;
  179.  
  180.     TogglePictureGadgets();
  181.  
  182.     FillUID(configList[pos].prog);
  183. }
  184.  
  185.  
  186. function CopyConfig(pos)
  187. {
  188.     position="configwizard.js";
  189.     whatfunc="CopyConfig()";
  190.      
  191.     configList[pos].prog=document.getElementById("prog").value;
  192.     configList[pos].ordr=document.getElementById("ordr").value;
  193.     configList[pos].desc=document.getElementById("desc").value;
  194.     configList[pos].uid=document.getElementById("uid").value;
  195.     configList[pos].dflt=document.getElementById("dflt").checked ? "yes" : "no";
  196.     configList[pos].cat=document.getElementById("cbocats").value;
  197.     if (configList[pos].cat=="other")
  198.     configList[pos].cat=document.getElementById("cat").value;
  199.     configList[pos].forc=document.getElementById("forc").checked ? "yes" : "no";
  200.     configList[pos].configs=document.getElementById("configs").value;
  201.     configList[pos].deps=document.getElementById("deps").value;
  202.     configList[pos].excl=document.getElementById("excl").value;
  203.     configList[pos].cond=document.getElementById("cond").value;
  204.     configList[pos].gcond=document.getElementById("gcond").value;
  205.     configList[pos].regb=document.getElementById("regb").value;
  206.     configList[pos].cmd1=document.getElementById("cmd1").value;
  207.     configList[pos].cmd2=document.getElementById("cmd2").value;
  208.     configList[pos].cmd3=document.getElementById("cmd3").value;
  209.     configList[pos].cmd4=document.getElementById("cmd4").value;
  210.     configList[pos].cmd5=document.getElementById("cmd5").value;
  211.     configList[pos].cmd6=document.getElementById("cmd6").value;
  212.     configList[pos].cmd7=document.getElementById("cmd7").value;
  213.     configList[pos].cmd8=document.getElementById("cmd8").value;
  214.     configList[pos].cmd9=document.getElementById("cmd9").value;
  215.     configList[pos].cmd10=document.getElementById("cmd10").value;
  216.     configList[pos].rega=document.getElementById("rega").value;
  217.     configList[pos].picf=document.getElementById("picf").value;
  218.     configList[pos].picw=document.getElementById("picw").value;
  219.     configList[pos].pich=document.getElementById("pich").value;
  220.     configList[pos].textl=document.getElementById("textl").value;
  221. }
  222.  
  223.  
  224. function clearProgram(entry)
  225. {
  226.     position="configwizard.js";
  227.     whatfunc="clearProgram()";
  228.  
  229.     entry.prog="";
  230.     entry.ordr="";
  231.     entry.desc="";
  232.     entry.uid="";
  233.     entry.dflt="yes";
  234.     entry.cat="Applications";
  235.     entry.forc="no";
  236.     entry.configs="";
  237.     entry.deps="";
  238.     entry.excl="";
  239.     entry.cond="";
  240.     entry.gcond="";
  241.     entry.regb="";
  242.     entry.cmd1="";
  243.     entry.cmd2="";
  244.     entry.cmd3="";
  245.     entry.cmd4="";
  246.     entry.cmd5="";
  247.     entry.cmd6="";
  248.     entry.cmd7="";
  249.     entry.cmd8="";
  250.     entry.cmd9="";
  251.     entry.cmd10="";
  252.     entry.rega="";
  253.     entry.picf="";
  254.     entry.picw="";
  255.     entry.pich="";
  256.     entry.textl="";
  257. }
  258.  
  259.  
  260. function ToggleAllGadgets(state)
  261. {
  262.     position="configwizard.js";
  263.     whatfunc="ToggleAllGadgets()";
  264.      
  265.     document.getElementById("prog").disabled=false;
  266.     document.getElementById("ordr").disabled=state;
  267.     document.getElementById("desc").disabled=state;
  268.     document.getElementById("uid").disabled=state;
  269.     document.getElementById("dflt").disabled=state;
  270.     document.getElementById("cbocats").disabled=state;
  271.     document.getElementById("cat").disabled=state;
  272.     document.getElementById("cat").style.visibility='hidden';
  273.     document.getElementById("forc").disabled=state;
  274.     document.getElementById("SelectConfigs").disabled=state;
  275.     document.getElementById("configs").disabled=state;
  276.     document.getElementById("deps").disabled=state;
  277.     document.getElementById("excl").disabled=state;
  278.     document.getElementById("cond").disabled=state;
  279.     document.getElementById("gcond").disabled=state;
  280.     document.getElementById("regb").disabled=state;
  281.     document.getElementById("cmd1").disabled=state;
  282.     document.getElementById("cmd2").disabled=state;
  283.     document.getElementById("cmd3").disabled=state;
  284.     document.getElementById("cmd4").disabled=state;
  285.     document.getElementById("cmd5").disabled=state;
  286.     document.getElementById("cmd6").disabled=state;
  287.     document.getElementById("cmd7").disabled=state;
  288.     document.getElementById("cmd8").disabled=state;
  289.     document.getElementById("cmd9").disabled=state;
  290.     document.getElementById("cmd10").disabled=state;
  291.     document.getElementById("rega").disabled=state;
  292.     document.getElementById("picf").disabled=state;
  293.     ToggleGenUID(state);
  294.     ToggleFileRequesters(state);
  295.     ToggleUSSFs(state);
  296.     TogglePictureGadgets();
  297.     ToggleDefaultImages(state);
  298. }
  299.  
  300.  
  301. function TogglePictureGadgets()
  302. {
  303.     position="configwizard.js";
  304.     whatfunc="TogglePictureGadgets()";
  305.      
  306.     document.getElementById("picw").disabled=(document.getElementById("picf").disabled || document.getElementById("picf").value=="" ? 1 : 0);
  307.     document.getElementById("pich").disabled=(document.getElementById("picf").disabled || document.getElementById("picf").value=="" ? 1 : 0);
  308.     document.getElementById("textl").disabled=(document.getElementById("picf").disabled || document.getElementById("picf").value=="" ? 1 : 0);
  309.  
  310.     if (document.getElementById("picf").value=="")
  311.     {
  312.         configList[cpos].picw=null;
  313.         configList[cpos].pich=null;
  314.         configList[cpos].textl=null;
  315.     
  316.         document.getElementById("picw").value=null;
  317.         document.getElementById("pich").value=null;
  318.         document.getElementById("textl").value=null;
  319.     }
  320.     else
  321.     {
  322.         document.getElementById("picw").value=configList[cpos].picw;
  323.         document.getElementById("pich").value=configList[cpos].pich;
  324.         document.getElementById("textl").value=configList[cpos].textl;
  325.     }
  326. }
  327.  
  328.  
  329. function ToggleGenUID(state)
  330. {
  331.     position="configwizard.js";
  332.     whatfunc="ToggleGenUID()";
  333.      
  334.     if (state)
  335.     {
  336.         document.getElementById("GenUIDShow").style.display='none';
  337.         document.getElementById("GenUIDHide").style.display='block';
  338.     }
  339.     else
  340.     {
  341.         document.getElementById("GenUIDShow").style.display='block';
  342.         document.getElementById("GenUIDHide").style.display='none';
  343.     }
  344. }
  345.  
  346.  
  347. function ToggleFileRequesters(state)
  348. {
  349.     position="configwizard.js";
  350.     whatfunc="ToggleFileRequesters()";
  351.      
  352.     if (state)
  353.     {
  354.         document.getElementById("regbShow").style.display='none';
  355.         document.getElementById("regbHide").style.display='block';
  356.         document.getElementById("cmd1Show").style.display='none';
  357.         document.getElementById("cmd1Hide").style.display='block';
  358.         document.getElementById("cmd2Show").style.display='none';
  359.         document.getElementById("cmd2Hide").style.display='block';
  360.         document.getElementById("cmd3Show").style.display='none';
  361.         document.getElementById("cmd3Hide").style.display='block';
  362.         document.getElementById("cmd4Show").style.display='none';
  363.         document.getElementById("cmd4Hide").style.display='block';
  364.         document.getElementById("cmd5Show").style.display='none';
  365.         document.getElementById("cmd5Hide").style.display='block';
  366.         document.getElementById("cmd6Show").style.display='none';
  367.         document.getElementById("cmd6Hide").style.display='block';
  368.         document.getElementById("cmd7Show").style.display='none';
  369.         document.getElementById("cmd7Hide").style.display='block';
  370.         document.getElementById("cmd8Show").style.display='none';
  371.         document.getElementById("cmd8Hide").style.display='block';
  372.         document.getElementById("cmd9Show").style.display='none';
  373.         document.getElementById("cmd9Hide").style.display='block';
  374.         document.getElementById("cmd10Show").style.display='none';
  375.         document.getElementById("cmd10Hide").style.display='block';
  376.         document.getElementById("regaShow").style.display='none';
  377.         document.getElementById("regaHide").style.display='block';
  378.         document.getElementById("picfShow").style.display='none';
  379.         document.getElementById("picfHide").style.display='block';
  380.     }
  381.     else
  382.     {
  383.         document.getElementById("regbShow").style.display='block';
  384.         document.getElementById("regbHide").style.display='none';
  385.         document.getElementById("cmd1Show").style.display='block';
  386.         document.getElementById("cmd1Hide").style.display='none';
  387.         document.getElementById("cmd2Show").style.display='block';
  388.         document.getElementById("cmd2Hide").style.display='none';
  389.         document.getElementById("cmd3Show").style.display='block';
  390.         document.getElementById("cmd3Hide").style.display='none';
  391.         document.getElementById("cmd4Show").style.display='block';
  392.         document.getElementById("cmd4Hide").style.display='none';
  393.         document.getElementById("cmd5Show").style.display='block';
  394.         document.getElementById("cmd5Hide").style.display='none';
  395.         document.getElementById("cmd6Show").style.display='block';
  396.         document.getElementById("cmd6Hide").style.display='none';
  397.         document.getElementById("cmd7Show").style.display='block';
  398.         document.getElementById("cmd7Hide").style.display='none';
  399.         document.getElementById("cmd8Show").style.display='block';
  400.         document.getElementById("cmd8Hide").style.display='none';
  401.         document.getElementById("cmd9Show").style.display='block';
  402.         document.getElementById("cmd9Hide").style.display='none';
  403.         document.getElementById("cmd10Show").style.display='block';
  404.         document.getElementById("cmd10Hide").style.display='none';
  405.         document.getElementById("regaShow").style.display='block';
  406.         document.getElementById("regaHide").style.display='none';
  407.         document.getElementById("picfShow").style.display='block';
  408.         document.getElementById("picfHide").style.display='none';
  409.     }
  410. }
  411.  
  412.  
  413. function ToggleUSSFs(state)
  414. {
  415.     position="configwizard.js";
  416.     whatfunc="ToggleUSSFs()";
  417.      
  418.     if (state)
  419.     {
  420.         document.getElementById("USSF1Show").style.display='none';
  421.         document.getElementById("USSF1Hide").style.display='block';
  422.         document.getElementById("USSF2Show").style.display='none';
  423.         document.getElementById("USSF2Hide").style.display='block';
  424.         document.getElementById("USSF3Show").style.display='none';
  425.         document.getElementById("USSF3Hide").style.display='block';
  426.         document.getElementById("USSF4Show").style.display='none';
  427.         document.getElementById("USSF4Hide").style.display='block';
  428.         document.getElementById("USSF5Show").style.display='none';
  429.         document.getElementById("USSF5Hide").style.display='block';
  430.         document.getElementById("USSF6Show").style.display='none';
  431.         document.getElementById("USSF6Hide").style.display='block';
  432.         document.getElementById("USSF7Show").style.display='none';
  433.         document.getElementById("USSF7Hide").style.display='block';
  434.         document.getElementById("USSF8Show").style.display='none';
  435.         document.getElementById("USSF8Hide").style.display='block';
  436.         document.getElementById("USSF9Show").style.display='none';
  437.         document.getElementById("USSF9Hide").style.display='block';
  438.         document.getElementById("USSF10Show").style.display='none';
  439.         document.getElementById("USSF10Hide").style.display='block';
  440.     }
  441.     else
  442.     {
  443.         document.getElementById("USSF1Show").style.display='block';
  444.         document.getElementById("USSF1Hide").style.display='none';
  445.         document.getElementById("USSF2Show").style.display='block';
  446.         document.getElementById("USSF2Hide").style.display='none';
  447.         document.getElementById("USSF3Show").style.display='block';
  448.         document.getElementById("USSF3Hide").style.display='none';
  449.         document.getElementById("USSF4Show").style.display='block';
  450.         document.getElementById("USSF4Hide").style.display='none';
  451.         document.getElementById("USSF5Show").style.display='block';
  452.         document.getElementById("USSF5Hide").style.display='none';
  453.         document.getElementById("USSF6Show").style.display='block';
  454.         document.getElementById("USSF6Hide").style.display='none';
  455.         document.getElementById("USSF7Show").style.display='block';
  456.         document.getElementById("USSF7Hide").style.display='none';
  457.         document.getElementById("USSF8Show").style.display='block';
  458.         document.getElementById("USSF8Hide").style.display='none';
  459.         document.getElementById("USSF9Show").style.display='block';
  460.         document.getElementById("USSF9Hide").style.display='none';
  461.         document.getElementById("USSF10Show").style.display='block';
  462.         document.getElementById("USSF10Hide").style.display='none';
  463.     }
  464. }
  465.  
  466.  
  467. function ToggleDefaultImages(state)
  468. {
  469.     position="configwizard.js";
  470.     whatfunc="ToggleDefaultImages()";
  471.      
  472.     if (state)
  473.     {
  474.         document.getElementById("DefaultImageShow").style.display='none';
  475.         document.getElementById("DefaultImageHide").style.display='block';
  476.     }
  477.     else
  478.     {
  479.         document.getElementById("DefaultImageShow").style.display='block';
  480.         document.getElementById("DefaultImageHide").style.display='none';
  481.     }
  482. }
  483.  
  484.  
  485. function ToggleControlGadgets(state)
  486. {
  487.     position="configwizard.js";
  488.     whatfunc="ToggleControlGadgets()";
  489.      
  490.     document.getElementById("configFirst").disabled=state;
  491.     document.getElementById("configPrevious").disabled=state;
  492.     document.getElementById("configNext").disabled=state;
  493.     document.getElementById("configLast").disabled=state;
  494.     document.getElementById("configAdd").disabled=state;
  495.     document.getElementById("configDelete").disabled=state;
  496.     document.getElementById("configFile").disabled=state;
  497.     document.getElementById("configNewConfig").disabled=state;
  498.     document.getElementById("configRead").disabled=state;
  499.     document.getElementById("configSave").disabled=state;
  500.     document.getElementById("configSaveAs").disabled=state;
  501.     document.getElementById("configExit").disabled=state;
  502. }
  503.  
  504.  
  505. function FillInConfigFile()
  506. {
  507.     position="configwizard.js";
  508.     whatfunc="FillInConfigFile()";
  509.  
  510.     document.getElementById("configFile").value=configFile;
  511. }
  512.  
  513.  
  514. function JumpToEntry(pos)
  515. {
  516.     position="configwizard.js";
  517.     whatfunc="JumpToEntry()";
  518.  
  519.     CopyConfig(cpos);
  520.     cpos=pos;
  521.     FillInConfig(false,cpos);
  522. }
  523.  
  524.  
  525. function FirstEntry()
  526. {
  527.     position="configwizard.js";
  528.     whatfunc="FirstEntry()";
  529.      
  530.     CopyConfig(cpos);
  531.     cpos=0;
  532.     FillInConfig(false,cpos);
  533. }
  534.  
  535.  
  536. function PreviousEntry()
  537. {
  538.     position="configwizard.js";
  539.     whatfunc="PreviousEntry()";
  540.      
  541.     if (cpos>0)
  542.     {
  543.         CopyConfig(cpos);
  544.         cpos--;
  545.         FillInConfig(false,cpos);
  546.     }
  547. }
  548.  
  549.  
  550. function NextEntry()
  551. {
  552.     position="configwizard.js";
  553.     whatfunc="NextEntry()";
  554.      
  555.     if (cpos<configList.length-1)
  556.     {
  557.         CopyConfig(cpos);
  558.         cpos++;
  559.         FillInConfig(false,cpos);
  560.     }
  561. }
  562.  
  563.  
  564. function LastEntry()
  565. {
  566.     position="configwizard.js";
  567.     whatfunc="LastEntry()";
  568.      
  569.     CopyConfig(cpos);
  570.     cpos=configList.length-1;
  571.     FillInConfig(false,cpos);
  572. }
  573.  
  574.  
  575. function AddEntry()
  576. {
  577.     position="configwizard.js";
  578.     whatfunc="AddEntry()";
  579.      
  580.     CopyConfig(cpos);
  581.     cpos=configList.length-1;
  582.     cpos++;
  583.     configList[cpos]=new program(cpos);
  584.     clearProgram(configList[cpos]);
  585.     configList[cpos].prog="--- New ---";
  586.     FillInConfig(true,cpos);
  587.     ToggleAllGadgets(true);
  588.     if (SortWithinCats)
  589.         FirstEntry();
  590.     else
  591.         LastEntry();
  592.     document.getElementById("prog").focus();
  593. }
  594.  
  595.  
  596. function CloneEntry()
  597. {
  598.     position="configwizard.js";
  599.     whatfunc="CloneEntry()";
  600.      
  601.     var temp=cpos;
  602.  
  603.     CopyConfig(cpos);
  604.     cpos=configList.length-1;
  605.     cpos++;
  606.     configList[cpos]=new program(pn);
  607.     clearProgram(configList[cpos]);
  608.     CopyConfig(cpos);
  609.     configList[cpos].prog += "-2";
  610.     configList[cpos].ordr = "";
  611.     configList[cpos].uid += "-2";
  612.     cpos=temp;
  613.     FillInConfig(true,cpos);
  614.     if (SortWithinCats)
  615.         NextEntry();
  616.     else
  617.         LastEntry();
  618.     document.getElementById("prog").focus();
  619. }
  620.  
  621.  
  622. function DeleteEntry()
  623. {
  624.     position="configwizard.js";
  625.     whatfunc="DeleteEntry()";
  626.  
  627.     if (!confirm("Really delete '" + configList[cpos].prog + "' ?")) 
  628.         return;
  629.  
  630.     configList.splice(cpos,1);
  631.     if (cpos>configList.length-1)
  632.     {
  633.         cpos=configList.length-1;
  634.     }
  635.  
  636.     if (cpos==-1)
  637.     {
  638.         ConfigDefaults();
  639.  
  640.         return;
  641.     }
  642.  
  643.     FillInConfig(true,cpos);
  644. }
  645.  
  646.  
  647. function HandleNameChange()
  648. {
  649.     position="configwizard.js";
  650.     whatfunc="HandleNameChange()";
  651.  
  652.     CopyConfig(cpos); 
  653.     if (document.getElementById("uid").value=="")
  654.     {
  655.         GenUID(1);
  656.         ToggleAllGadgets(false);
  657.     }
  658.     else
  659.     {
  660.         GenUID(0);
  661.     }
  662.  
  663.     CreateNavigation(); 
  664.     FindEntry();
  665.     document.getElementById("ordr").focus();
  666. }
  667.  
  668.  
  669. function HandleInstallOrder()
  670. {
  671.     position="configwizard.js";
  672.     whatfunc="HandleInstallOrder()";
  673.  
  674.     CopyConfig(cpos);
  675.     CreateNavigation();
  676.     document.getElementById("desc").focus();
  677. }
  678.  
  679.  
  680. function GenUID(mode)
  681. {
  682.     position="configwizard.js";
  683.     whatfunc="GenUID()";
  684.  
  685.     var name=document.getElementById("prog").value;
  686.  
  687.     if (mode==0)
  688.     {
  689.         if (document.getElementById("uid").value != "" || document.getElementById("uid").value != null)
  690.             return;    
  691.     }
  692.     name=name.replace(/\W/g,"").toUpperCase().substr(0,25);
  693.     document.getElementById("uid").value=name;
  694.  
  695.     CopyConfig(cpos);
  696.     FindEntry();
  697.     ToggleAllGadgets(false);
  698.     document.getElementById("uid").focus();
  699. }
  700.  
  701.  
  702. function FillUID(currentprogram)
  703. {
  704.     position="configwizard.js";
  705.     whatfunc="FillUID()";
  706.  
  707.     document.getElementById("cboDeps").innerHTML = "";
  708.     document.getElementById("cboExcl").innerHTML = "";
  709.     
  710.     var opt = document.createElement("option");
  711.     opt.value = "blank";
  712.     opt.text = "";
  713.     document.getElementById("cboDeps").options.add(opt);
  714.  
  715.     var opt = document.createElement("option");
  716.     opt.value = "blank";
  717.     opt.text = "";
  718.     document.getElementById("cboExcl").options.add(opt);
  719.  
  720.     for (var i=0; i<configList.length && configList[i] != null; i++)
  721.     {
  722.         if (configList[i].uid != "" && configList[i].prog != currentprogram)
  723.         {
  724.             var opt = document.createElement("option");
  725.             opt.value = configList[i].uid;
  726.             opt.text = configList[i].prog;
  727.             document.getElementById("cboDeps").options.add(opt);
  728.  
  729.             var opt = document.createElement("option");
  730.             opt.value = configList[i].uid;
  731.             opt.text = configList[i].prog;
  732.             document.getElementById("cboExcl").options.add(opt);
  733.         }
  734.     }
  735. }
  736.  
  737.  
  738. function HandleDependentOf()
  739. {
  740.     position="configwizard.js";
  741.     whatfunc="HandleDependentOf()";
  742.     
  743.     var n = document.getElementById("cboDeps").selectedIndex;    // Which menu item is selected
  744.     var val = document.getElementById("cboDeps")[n].value;        // Return string value of menu item
  745.     var txt="";
  746.  
  747.     if (document.getElementById("cboDeps").value != "blank")
  748.     {
  749.         txt=document.getElementById("deps").value;
  750.         if (txt=="" && txt.indexOf(val) == -1)
  751.         {
  752.             txt += document.getElementById("cboDeps").value;
  753.             document.getElementById("deps").value=txt;
  754.         }
  755.         else if (txt != "" && txt.indexOf(val) == -1)
  756.         {
  757.             txt += ",";
  758.             txt += document.getElementById("cboDeps").value;
  759.             document.getElementById("deps").value=txt;
  760.         }
  761.     }
  762.  
  763.     document.getElementById("cboDeps").value="blank";
  764. }
  765.  
  766.  
  767. function HandleExcludes()
  768. {
  769.     position="configwizard.js";
  770.     whatfunc="HandleExcludes()";
  771.     
  772.     var n = document.getElementById("cboExcl").selectedIndex;    // Which menu item is selected
  773.     var val = document.getElementById("cboExcl")[n].value;        // Return string value of menu item
  774.     var txt="";
  775.  
  776.     if (document.getElementById("cboExcl").value != "blank")
  777.     {
  778.         txt=document.getElementById("excl").value;
  779.         if (txt=="" && txt.indexOf(val) == -1)
  780.         {
  781.             txt += document.getElementById("cboExcl").value;
  782.             document.getElementById("excl").value=txt;
  783.         }
  784.         else if (txt != "" && txt.indexOf(val) == -1)
  785.         {
  786.             txt += ",";
  787.             txt += document.getElementById("cboExcl").value;
  788.             document.getElementById("excl").value=txt;
  789.         }
  790.     }
  791.  
  792.     document.getElementById("cboExcl").value="blank";
  793. }
  794.  
  795.  
  796. function HandleConditionsSelection(which)
  797. {
  798.     position="configwizard.js";
  799.     whatfunc="HandleConditionsSelection()";
  800.  
  801.     var n = document.getElementById("cboConditions"+which).selectedIndex;
  802.     var val = document.getElementById("cboConditions"+which)[n].value;
  803.     var gad="", txt="";
  804.  
  805.     if (which==1)
  806.         gad="cond";
  807.     else
  808.         gad="gcond";
  809.  
  810.     if (document.getElementById("cboConditions"+which).value != "blank")
  811.     {
  812.         txt=document.getElementById(gad).value;
  813.         if (txt=="")
  814.         {
  815.             txt += document.getElementById("cboConditions"+which).value;
  816.             document.getElementById(gad).value=txt;
  817.         }
  818.         else
  819.         {
  820.             txt += " ";
  821.             txt += document.getElementById("cboConditions"+which).value;
  822.             document.getElementById(gad).value=txt;
  823.         }
  824.  
  825.         document.getElementById("cboConditions"+which).value="blank";
  826.         document.getElementById(gad).focus();
  827.     }
  828. }
  829.  
  830.  
  831. function HandleCommandsSelection(which)
  832. {
  833.     position="configwizard.js";
  834.     whatfunc="HandleCommandsSelection()";
  835.  
  836.     var n = document.getElementById("cboCommands"+which).selectedIndex;
  837.     var val = document.getElementById("cboCommands"+which)[n].value;
  838.     var txt="";
  839.  
  840.     if (document.getElementById("cboCommands"+which).value != "blank")
  841.     {
  842.         txt=document.getElementById("cmd"+which).value;
  843.         if (txt=="")
  844.         {
  845.             txt += document.getElementById("cboCommands"+which).value;
  846.             document.getElementById("cmd"+which).value=txt;
  847.         }
  848.         else
  849.         {
  850.             txt += " ";
  851.             txt += document.getElementById("cboCommands"+which).value;
  852.             document.getElementById("cmd"+which).value=txt;
  853.         }
  854.  
  855.         document.getElementById("cboCommands"+which).value="blank";
  856.         document.getElementById("cmd"+which).focus();
  857.     }
  858. }
  859.  
  860.  
  861. //Tony add to trim string from browse and added function call to each browse
  862. function trimString(str)
  863. {
  864.     position="configwizard.js";
  865.     whatfunc="trimString()";
  866.  
  867.     var trimpath;    
  868.     var trimpathvar;
  869.     
  870.     //Set up switch statements to check if str starts with an environmental path and replace i.e. c:\windows as %windir%
  871.     if (str.indexOf(wpipath) != -1)    
  872.     {
  873.         trimpath=wpipath;
  874.         trimpathvar="%wpipath%";    //Could have used %cdrom%
  875.     }
  876.     else if (str.indexOf(root) != -1)
  877.     {
  878.         trimpath=root;
  879.         trimpathvar="%root%";
  880.     }
  881.     else if (str.indexOf(sysdir) != -1)
  882.     {
  883.         trimpath=sysdir;
  884.         trimpathvar="%sysdir%";
  885.     }
  886.     else if (str.indexOf(windir) != -1)
  887.     {
  888.         trimpath=windir;
  889.         trimpathvar="%windir%";
  890.     }
  891.     else if (str.indexOf(programfiles) != -1)
  892.     {
  893.         trimpath=programfiles;
  894.         trimpathvar="%programfiles%";
  895.     }
  896.     else if (str.indexOf(temp) != -1)
  897.     {
  898.         trimpath=temp;
  899.         trimpathvar="%temp%";
  900.     }    
  901.     else
  902.     {
  903.         //tempName="\"%wpipath%"+tempName.substring(theStart+1,tempName.length)+"\""; 
  904.         trimpath=sysdrv;
  905.         trimpathvar="%wpipath%";    //Default from before...Could have used %cdrom%
  906.     }
  907.     
  908.     str=str.replace(trimpath, '/\s'); //remove the trimpath
  909.     str = "\"" + trimpathvar +str.substring(theStart+1,str.length)+"\"";
  910.     return str;
  911. }
  912.  
  913.  
  914. function clearregbBrowse()
  915. {
  916.     position="configwizard.js";
  917.     whatfunc="clearregbBrowse()";
  918.  
  919.     document.getElementById("div_regbBrowse").innerHTML="";
  920.     document.getElementById("div_regbBrowse").innerHTML='<input id="regbBrowse" type="file" style="display:none;">';
  921. }
  922.  
  923.  
  924. function SetRegbPath()
  925. {
  926.     position="configwizard.js";
  927.     whatfunc="SetRegbPath()";
  928.      
  929.     if (document.getElementById("regbBrowse").value != "")
  930.     {
  931.         tempName=document.getElementById("regbBrowse").value;
  932.         if (theStart=tempName.indexOf(":") != -1)            
  933.             tempName = trimString(tempName);            
  934.         document.getElementById("regb").value=tempName;
  935.     }
  936. }
  937.  
  938.  
  939. function clearcmd1Browse()
  940. {
  941.     position="configwizard.js";
  942.     whatfunc="clearcmd1Browse()";
  943.  
  944.     document.getElementById("div_cmd1Browse").innerHTML="";
  945.     document.getElementById("div_cmd1Browse").innerHTML='<input id="cmd1Browse" type="file" style="display:none;">';
  946. }
  947.  
  948.  
  949. function SetCmd1Path()
  950. {
  951.     position="configwizard.js";
  952.     whatfunc="SetCmd1Path()";
  953.      
  954.     if (document.getElementById("cmd1Browse").value != "")
  955.     {
  956.         tempName=document.getElementById("cmd1Browse").value;
  957.         if (theStart=tempName.indexOf(":") != -1)        
  958.             tempName = trimString(tempName);
  959.         document.getElementById("cmd1").value=tempName;
  960.     }
  961. }
  962.  
  963.  
  964. function clearcmd2Browse()
  965. {
  966.     position="configwizard.js";
  967.     whatfunc="clearcmd2Browse()";
  968.  
  969.     document.getElementById("div_cmd2Browse").innerHTML="";
  970.     document.getElementById("div_cmd2Browse").innerHTML='<input id="cmd2Browse" type="file" style="display:none;">';
  971. }
  972.  
  973.  
  974. function SetCmd2Path()
  975. {
  976.     position="configwizard.js";
  977.     whatfunc="SetCmd2Path()";
  978.  
  979.     if (document.getElementById("cmd2Browse").value != "")
  980.     {
  981.         tempName=document.getElementById("cmd2Browse").value;
  982.         if (theStart=tempName.indexOf(":") != -1)        
  983.             tempName = trimString(tempName);
  984.         document.getElementById("cmd2").value=tempName;
  985.     }
  986. }
  987.  
  988.  
  989. function clearcmd3Browse()
  990. {
  991.     position="configwizard.js";
  992.     whatfunc="clearcmd3Browse()";
  993.  
  994.     document.getElementById("div_cmd3Browse").innerHTML="";
  995.     document.getElementById("div_cmd3Browse").innerHTML='<input id="cmd3Browse" type="file" style="display:none;">';
  996. }
  997.  
  998.  
  999. function SetCmd3Path()
  1000. {
  1001.     position="configwizard.js";
  1002.     whatfunc="SetCmd3Path()";
  1003.      
  1004.     if (document.getElementById("cmd3Browse").value != "")
  1005.     {
  1006.         tempName=document.getElementById("cmd3Browse").value;
  1007.         if (theStart=tempName.indexOf(":") != -1)
  1008.             tempName = trimString(tempName);
  1009.         document.getElementById("cmd3").value=tempName;
  1010.     }
  1011. }
  1012.  
  1013.  
  1014. function clearcmd4Browse()
  1015. {
  1016.     position="configwizard.js";
  1017.     whatfunc="clearcmd4Browse()";
  1018.  
  1019.     document.getElementById("div_cmd4Browse").innerHTML="";
  1020.     document.getElementById("div_cmd4Browse").innerHTML='<input id="cmd4Browse" type="file" style="display:none;">';
  1021. }
  1022.  
  1023.  
  1024. function SetCmd4Path()
  1025. {
  1026.     position="configwizard.js";
  1027.     whatfunc="SetCmd4Path()";
  1028.      
  1029.     if (document.getElementById("cmd4Browse").value != "")
  1030.     {
  1031.         tempName=document.getElementById("cmd4Browse").value;
  1032.         if (theStart=tempName.indexOf(":") != -1)    
  1033.             tempName = trimString(tempName);
  1034.  
  1035.         document.getElementById("cmd4").value=tempName;
  1036.     }
  1037. }
  1038.  
  1039.  
  1040. function clearcmd5Browse()
  1041. {
  1042.     position="configwizard.js";
  1043.     whatfunc="clearcmd5Browse()";
  1044.  
  1045.     document.getElementById("div_cmd5Browse").innerHTML="";
  1046.     document.getElementById("div_cmd5Browse").innerHTML='<input id="cmd5Browse" type="file" style="display:none;">';
  1047. }
  1048.  
  1049.  
  1050. function SetCmd5Path()
  1051. {
  1052.     position="configwizard.js";
  1053.     whatfunc="SetCmd5Path()";
  1054.      
  1055.     if (document.getElementById("cmd5Browse").value != "")
  1056.     {
  1057.         tempName=document.getElementById("cmd5Browse").value;
  1058.         if (theStart=tempName.indexOf(":") != -1)    
  1059.             tempName = trimString(tempName);
  1060.         document.getElementById("cmd5").value=tempName;
  1061.     }
  1062. }
  1063.  
  1064.  
  1065. function clearcmd6Browse()
  1066. {
  1067.     position="configwizard.js";
  1068.     whatfunc="clearcmd6Browse()";
  1069.  
  1070.     document.getElementById("div_cmd6Browse").innerHTML="";
  1071.     document.getElementById("div_cmd6Browse").innerHTML='<input id="cmd6Browse" type="file" style="display:none;">';
  1072. }
  1073.  
  1074.  
  1075. function SetCmd6Path()
  1076. {
  1077.     position="configwizard.js";
  1078.     whatfunc="SetCmd6Path()";
  1079.      
  1080.     if (document.getElementById("cmd6Browse").value != "")
  1081.     {
  1082.         tempName=document.getElementById("cmd6Browse").value;
  1083.         if (theStart=tempName.indexOf(":") != -1)        
  1084.             tempName = trimString(tempName);
  1085.         document.getElementById("cmd6").value=tempName;
  1086.     }
  1087. }
  1088.  
  1089. function clearcmd7Browse()
  1090. {
  1091.     position="configwizard.js";
  1092.     whatfunc="clearcmd7Browse()";
  1093.  
  1094.     document.getElementById("div_cmd7Browse").innerHTML="";
  1095.     document.getElementById("div_cmd7Browse").innerHTML='<input id="cmd7Browse" type="file" style="display:none;">';
  1096. }
  1097.  
  1098.  
  1099. function SetCmd7Path()
  1100. {
  1101.     position="configwizard.js";
  1102.     whatfunc="SetCmd7Path()";
  1103.      
  1104.     if (document.getElementById("cmd7Browse").value != "")
  1105.     {
  1106.         tempName=document.getElementById("cmd7Browse").value;
  1107.         if (theStart=tempName.indexOf(":") != -1)        
  1108.             tempName = trimString(tempName);
  1109.  
  1110.         document.getElementById("cmd7").value=tempName;
  1111.     }
  1112. }
  1113.  
  1114. function clearcmd8Browse()
  1115. {
  1116.     position="configwizard.js";
  1117.     whatfunc="clearcmd8Browse()";
  1118.  
  1119.     document.getElementById("div_cmd8Browse").innerHTML="";
  1120.     document.getElementById("div_cmd8Browse").innerHTML='<input id="cmd8Browse" type="file" style="display:none;">';
  1121. }
  1122.  
  1123.  
  1124. function SetCmd8Path()
  1125. {
  1126.     position="configwizard.js";
  1127.     whatfunc="SetCmd8Path()";
  1128.      
  1129.     if (document.getElementById("cmd8Browse").value != "")
  1130.     {
  1131.         tempName=document.getElementById("cmd8Browse").value;
  1132.         if (theStart=tempName.indexOf(":") != -1)        
  1133.             tempName = trimString(tempName);
  1134.  
  1135.         document.getElementById("cmd8").value=tempName;
  1136.     }
  1137. }
  1138.  
  1139. function clearcmd9Browse()
  1140. {
  1141.     position="configwizard.js";
  1142.     whatfunc="clearcmd9Browse()";
  1143.  
  1144.     document.getElementById("div_cmd9Browse").innerHTML="";
  1145.     document.getElementById("div_cmd9Browse").innerHTML='<input id="cmd9Browse" type="file" style="display:none;">';
  1146. }
  1147.  
  1148.  
  1149. function SetCmd9Path()
  1150. {
  1151.     position="configwizard.js";
  1152.     whatfunc="SetCmd9Path()";
  1153.      
  1154.     if (document.getElementById("cmd9Browse").value != "")
  1155.     {
  1156.         tempName=document.getElementById("cmd9Browse").value;
  1157.         if (theStart=tempName.indexOf(":") != -1)        
  1158.             tempName = trimString(tempName);
  1159.  
  1160.         document.getElementById("cmd9").value=tempName;
  1161.     }
  1162. }
  1163.  
  1164. function clearcmd10Browse()
  1165. {
  1166.     position="configwizard.js";
  1167.     whatfunc="clearcmd10Browse()";
  1168.  
  1169.     document.getElementById("div_cmd10Browse").innerHTML="";
  1170.     document.getElementById("div_cmd10Browse").innerHTML='<input id="cmd10Browse" type="file" style="display:none;">';
  1171. }
  1172.  
  1173.  
  1174. function SetCmd10Path()
  1175. {
  1176.     position="configwizard.js";
  1177.     whatfunc="SetCmd10Path()";
  1178.      
  1179.     if (document.getElementById("cmd10Browse").value != "")
  1180.     {
  1181.         tempName=document.getElementById("cmd10Browse").value;
  1182.         if (theStart=tempName.indexOf(":") != -1)        
  1183.             tempName = trimString(tempName);
  1184.  
  1185.         document.getElementById("cmd10").value=tempName;
  1186.     }
  1187. }
  1188. function HandleUSSF(cmd)
  1189. {
  1190.     position="configwizard.js";
  1191.     whatfunc="HandleUSSF()";
  1192.  
  1193.     var path, temp;
  1194.  
  1195.     if (document.getElementById("cmd" + cmd).value != "")
  1196.     {
  1197.         path=document.getElementById("cmd" + cmd).value;
  1198.         path=path.replace(/\"/g,"");
  1199.         temp=document.getElementById ("cmd" + cmd).value;
  1200.         temp=temp.replace(/\"/g,"");
  1201.         temp=ReplacePath(temp);
  1202.  
  1203.         if (FileExists(temp))
  1204.         {
  1205.             try
  1206.             {
  1207.                 interval = window.setInterval("USSFCheck()",200);
  1208. // For silent usage for parsing entire folder: 0 - GUI, 1 - small box, 2 - silent
  1209.                 WshShell.Run('"' + USSFcmd + '" "' + temp + '" "' + path + '" ' + cmd + (USSFSilentMode ? ' 2' : ' 0') , 1, true);
  1210.                 Pause(0,300);
  1211.                 window.clearInterval(interval);
  1212.             } 
  1213.             catch (ex)
  1214.             {
  1215.                 window.clearInterval(interval);
  1216.                 alert(getText(txtUSSFfailure));
  1217.             }
  1218.         }
  1219.         else
  1220.             alert(getText(errCouldNotOpenFile)+"\n'"+temp+"'."); 
  1221.     }
  1222. }
  1223.  
  1224.  
  1225. function USSFCheck()
  1226. {
  1227.     position="configwizard.js";
  1228.     whatfunc="USSFCheck()";
  1229.  
  1230.     try
  1231.     {
  1232.         var aux;
  1233.  
  1234.         for (var x = 1; x <= 6; x++)
  1235.         {
  1236.              aux = WshShell.RegRead('HKEY_CURRENT_USER\\Software\\WPI\\USSF_cmd' + x);
  1237.              if (aux != 'default')
  1238.                  document.getElementById('cmd' + x).value = aux;
  1239.         }
  1240.     } 
  1241.     catch (ex)
  1242.     {
  1243.         alert(getText(txtUSSFfailure));
  1244.     }
  1245. }
  1246.  
  1247.  
  1248. function clearregaBrowse()
  1249. {
  1250.     position="configwizard.js";
  1251.     whatfunc="clearregaBrowse()";
  1252.  
  1253.     document.getElementById("div_regaBrowse").innerHTML="";
  1254.     document.getElementById("div_regaBrowse").innerHTML='<input id="regaBrowse" type="file" style="display:none;">';
  1255. }
  1256.  
  1257.  
  1258. function SetRegaPath()
  1259. {
  1260.     position="configwizard.js";
  1261.     whatfunc="SetRegaPath()";
  1262.      
  1263.     if (document.getElementById("regaBrowse").value != "")
  1264.     {
  1265.         tempName=document.getElementById("regaBrowse").value;
  1266.         if (theStart=tempName.indexOf(":") != -1)
  1267.             //tempName="\"%wpipath%"+tempName.substring(theStart+1,tempName.length)+"\"";  //Tony add - Commented out original code            
  1268.             tempName = trimString(tempName);    //Tony add - trimString is a new function that will trim the relative path properly.
  1269.  
  1270.         document.getElementById("rega").value=tempName;
  1271.     }
  1272. }
  1273.  
  1274.  
  1275. function clearpicfBrowse()
  1276. {
  1277.     position="configwizard.js";
  1278.     whatfunc="clearpicfBrowse()";
  1279.  
  1280.     document.getElementById("div_picfBrowse").innerHTML="";
  1281.     document.getElementById("div_picfBrowse").innerHTML='<input id="picfBrowse" type="file" style="display:none;">';
  1282. }
  1283.  
  1284.  
  1285. function GetPictureName()
  1286. {
  1287.     position="configwizard.js";
  1288.     whatfunc="GetPictureName()";
  1289.  
  1290.     var lastSlash, tempName;
  1291.  
  1292.     tempName=document.getElementById("picfBrowse").value;
  1293.     lastSlash=tempName.lastIndexOf("\\");
  1294.  
  1295.     BrowseName=tempName.substring(lastSlash+1,tempName.length);
  1296. }
  1297.  
  1298.  
  1299. function SetPicturePath()
  1300. {
  1301.     position="configwizard.js";
  1302.     whatfunc="SetPicturePath()";
  1303.      
  1304.     if (document.getElementById("picfBrowse").value != "")
  1305.     {
  1306.         GetPictureName();
  1307.         document.getElementById("picf").value=BrowseName;
  1308.  
  1309.         configList[cpos].picw=128;
  1310.         configList[cpos].pich=128;
  1311.         configList[cpos].textl='Top';
  1312.  
  1313.         document.getElementById("picw").value=128;
  1314.         document.getElementById("pich").value=128;
  1315.         document.getElementById("textl").value='Top';
  1316.     }
  1317. }
  1318.  
  1319.  
  1320. function HandleDefaultImage()
  1321. {
  1322.     position="configwizard.js";
  1323.     whatfunc="HandleDefaultImage()";
  1324.  
  1325.     configList[cpos].picf="InstallPackage.png";
  1326.     configList[cpos].picw=128;
  1327.     configList[cpos].pich=128;
  1328.     configList[cpos].textl="Bottom";
  1329.         
  1330.     document.getElementById("picf").value=configList[cpos].picf;
  1331.     document.getElementById("picw").value=configList[cpos].picw;
  1332.     document.getElementById("pich").value=configList[cpos].pich;
  1333.     document.getElementById("textl").value=configList[cpos].textl;
  1334.  
  1335.     TogglePictureGadgets();
  1336. }
  1337.  
  1338.  
  1339. function FindEntry()
  1340. {
  1341.     position="configwizard.js";
  1342.     whatfunc="FindEntry()";
  1343.  
  1344.     for (var i=0; i<configList.length && configList[i] != null; i++)
  1345.     {
  1346.         if (configList[i].uid==document.getElementById("uid").value)
  1347.         {
  1348.             cpos=i;
  1349.             FillInConfig(false,cpos);
  1350.             break;
  1351.         }
  1352.     }    
  1353. }
  1354.  
  1355.  
  1356. function HandleCatSelection()
  1357. {
  1358.     position="configwizard.js";
  1359.     whatfunc="HandleCatSelection()";
  1360.  
  1361.     if (document.getElementById("cbocats").value=="other")
  1362.     {
  1363.         document.getElementById("cat").style.visibility="visible";
  1364.         document.getElementById("cat").value="--- New ---";
  1365.         document.getElementById("cat").focus();
  1366.     }
  1367.     else
  1368.         document.getElementById("cat").style.visibility="hidden";
  1369.     if (document.getElementById("cbocats").value=="---")
  1370.     {
  1371.         alert(getText(errSelectACategory));
  1372.         document.getElementById("cbocats").value=configList[cpos].cat;
  1373.     }
  1374. }
  1375.  
  1376.  
  1377. function HandleNewCat()
  1378. {
  1379.     position="configwizard.js";
  1380.     whatfunc="HandleNewCat()";
  1381.  
  1382.     var opt = document.createElement("option");
  1383.  
  1384.     opt.value = document.getElementById("cat").value;
  1385.     opt.text = noTags(opt.value);
  1386.     document.getElementById("cbocats").options.add(opt);
  1387.     Pause(0, 50);
  1388.     document.getElementById("cbocats").selectedIndex = document.getElementById("cbocats").length - 1;
  1389. }
  1390.  
  1391.  
  1392. function HandleConfigSelection()
  1393. {
  1394.     position="configwizard.js";
  1395.     whatfunc="HandleConfigSelection()";
  1396.  
  1397.     var txt="";
  1398.  
  1399.     if (document.getElementById("SelectConfigs").value != "blank")
  1400.     {
  1401.         txt=document.getElementById("configs").value;
  1402.         if (txt != "")
  1403.             txt += ",";
  1404.         txt += document.getElementById("SelectConfigs").value;
  1405.         document.getElementById("configs").value=txt;
  1406.     }
  1407.  
  1408.     document.getElementById("SelectConfigs").value="blank";
  1409. }
  1410.  
  1411.  
  1412. function ConfigTemplateIntoTextlines()
  1413. {
  1414.     position="configwizard.js";
  1415.     whatfunc="ConfigTemplateIntoTextLines()";
  1416.  
  1417.     var txt=new String();    
  1418.     var line=new String();    
  1419.     var textline=0;
  1420.  
  1421.     ConfigRowTextLines.push('');
  1422.     strFile=wpipath + "\\Common\\configwizardtemplate_config.htm";
  1423.     if (!FileExists(strFile))
  1424.     {
  1425.         alert(getText(errCouldNotOpenFile)+" '"+strFile+"'.");
  1426.         ExitWPI();
  1427.     }
  1428.     try 
  1429.     {
  1430.         tf=fso.OpenTextFile(strFile, 1);
  1431.         txt="";        
  1432.         while (!tf.AtEndOfStream)
  1433.         {
  1434.             line=tf.ReadLine();
  1435.             txt=(line + "\n");
  1436.             txt=ConfigRowTextLines[textline] + txt;
  1437.             ConfigRowTextLines[textline]=txt;
  1438.         }
  1439.     }
  1440.     catch (ex) 
  1441.     { ; }
  1442.     finally 
  1443.     {    
  1444.         tf.Close(); 
  1445.     }
  1446. }
  1447.  
  1448.  
  1449. function CreateConfigRow()
  1450. {
  1451.     position="configwizard.js";
  1452.     whatfunc="CreateConfigRow()";
  1453.  
  1454.     var txt=new String(); txt="";
  1455.  
  1456.     if (ConfigRowTextLines.length<=0) 
  1457.         ConfigTemplateIntoTextlines();
  1458.  
  1459.     for (var i=0; i<ConfigRowTextLines.length-1; i++)
  1460.         txt += ConfigRowTextLines[i];
  1461.     txt += ConfigRowTextLines[ConfigRowTextLines.length-1];
  1462.  
  1463.     return txt;
  1464. }
  1465.  
  1466.  
  1467. function InsertCatsValues()
  1468. {
  1469.     position="configwizard.js";
  1470.     whatfunc="InsertCatsValues()";
  1471.  
  1472.     var cats = GetCats();
  1473.  
  1474.     for (var i=0; i<cats.length; i++)
  1475.     {
  1476.         if (cats[i] != "Applications" && cats[i] != "Drivers" && cats[i] != "Games" && cats[i] != "MultiMedia" && cats[i] != "Office" && cats[i] != "Registry Tweaks" && cats[i] != "System" && cats[i] != "Utilities" && cats[i])
  1477.         {
  1478.             var opt = document.createElement("option");
  1479.  
  1480.             opt.value = cats[i];
  1481.             opt.text = noTags(cats[i]);
  1482.             document.getElementById("cbocats").options.add(opt);
  1483.         }
  1484.     }
  1485. }
  1486.  
  1487.  
  1488. function InsertConfigsValues()
  1489. {
  1490.     position="configwizard.js";
  1491.     whatfunc="InsertConfigsValues()";
  1492.      
  1493.     for (var i=0; i<Configurations.length; i++)
  1494.     {
  1495.         var opt=document.createElement("option");
  1496.  
  1497.         opt.value=Configurations[i];
  1498.         opt.text=noTags(Configurations[i]);
  1499.         document.getElementById("SelectConfigs").options.add(opt);
  1500.     }
  1501. }
  1502.  
  1503.  
  1504. function GetConfigValue(inVal, isNum)
  1505. {
  1506.     position="configwizard.js";
  1507.     whatfunc="GetConfigValue()";
  1508.  
  1509.     var txt=new String(); 
  1510.  
  1511.     txt=inVal;
  1512.     txt=txt.replace(/\\/g,"\\\\");
  1513.  
  1514.     if (!isNum && txt != "")
  1515.     {
  1516.         txt=txt.replace(/'/g,"\\'");
  1517.         txt=("'" + txt + "'");
  1518.     }
  1519.  
  1520.     return txt;
  1521. }
  1522.  
  1523.  
  1524. function WriteConfigValue(tf, fName, inVal, isNum)
  1525. {
  1526.     position="configwizard.js";
  1527.     whatfunc="WriteConfigValue()";
  1528.  
  1529.     if (inVal==null || inVal=="") 
  1530.         return;
  1531.  
  1532.     var txt=new String();
  1533.  
  1534.     txt=(fName + "[pn]=[" + GetConfigValue(inVal, isNum) + "];");
  1535.     txt=txt.replace(/''/g,"'");
  1536.     tf.WriteLine(txt);
  1537. }
  1538.  
  1539.  
  1540. function byOrder(a, b)
  1541. {
  1542.     position="configwizard.js";
  1543.     whatfunc="byOrder()";
  1544.  
  1545.     return(a.prog.value - b.prog.value);
  1546. }
  1547.  
  1548.  
  1549. function byName(a, b)
  1550. {
  1551.     position="configwizard.js";
  1552.     whatfunc="byName()";
  1553.  
  1554.     var x=a.prog.toLowerCase();
  1555.     var y=b.prog.toLowerCase();
  1556.  
  1557.     return ((x < y) ? -1 : ((x > y) ? 1 : 0));
  1558. }
  1559.  
  1560.  
  1561. function ConfigDefaults()
  1562. {
  1563.     position="configwizard.js";
  1564.     whatfunc="ConfigDefaults()";
  1565.  
  1566.     pn=1;
  1567.     cpos=0;
  1568.     configList[0]=new program(pn);
  1569.     clearProgram(configList[0]);
  1570.     ToggleAllGadgets(true);
  1571.     configList[cpos].prog="--- New ---";
  1572.     FillInConfig(true,cpos);
  1573.     FirstEntry();
  1574.     document.getElementById("prog").focus();
  1575. }
  1576.  
  1577.  
  1578. function NewConfig()
  1579. {
  1580.     position="configwizard.js";
  1581.     whatfunc="NewConfig()";
  1582.  
  1583.     var temp;
  1584.  
  1585.     temp=prompt(getText(txtSaveConfigAs),configFile);
  1586.     if (temp != null)
  1587.     {
  1588.         configFile=temp;
  1589.         SetConfigPath(true); 
  1590.         configList=[];
  1591.         cpos=0;
  1592.         configList[cpos]=new program(pn);
  1593.         clearProgram(configList[cpos]);
  1594.         ToggleAllGadgets(true);
  1595.         configList[cpos].prog="--- New ---";
  1596.         FillInConfig(true,cpos);    
  1597.  
  1598.         SaveConfig();
  1599.  
  1600.         ReadConfig();
  1601.     }
  1602. }
  1603.  
  1604.  
  1605. function configClearReadBrowse()
  1606. {
  1607.     position="configwizard.js";
  1608.     whatfunc="configClearReadBrowse()";
  1609.  
  1610.     document.getElementById("div_configReadBrowse").innerHTML="";
  1611.     document.getElementById("div_configReadBrowse").innerHTML='<input id="configReadBrowse" type="file" style="display:none;">';
  1612. }
  1613.  
  1614.  
  1615. function HandleReadConfig()
  1616. {
  1617.     position="configwizard.js";
  1618.     whatfunc="HandleReadConfig()";
  1619.  
  1620.     if (document.getElementById("configReadBrowse").value != "")
  1621.     {
  1622.         SetConfigPath(false); 
  1623.         ReadConfig();
  1624.     }
  1625. }
  1626.  
  1627.  
  1628. function SetConfigPath(mode)
  1629. {
  1630.     position="configwizard.js";
  1631.     whatfunc="SetConfigPath()";
  1632.  
  1633.     var i, txt;
  1634.  
  1635.     if (!mode)
  1636.     {
  1637.         configFile=document.getElementById("configReadBrowse").value;
  1638.  
  1639.         i=configFile.indexOf('\\WPI\\WPIScripts\\');
  1640.         if (i != -1)
  1641.         {
  1642.             txt="./WPIScripts/"+configFile.substr(i+16,configFile.length);
  1643.             configFile=txt;
  1644.         }
  1645.     }
  1646.     else
  1647.     {
  1648.         // Nothing for Save As... right now
  1649.     }
  1650. }
  1651.  
  1652.  
  1653. function GetConfigPath()
  1654. {
  1655.     position="configwizard.js";
  1656.     whatfunc="GetConfigPath()";
  1657.  
  1658.     var temp;
  1659.  
  1660.     temp=prompt(getText(txtSaveConfigAs),configFile);
  1661.     if (temp != null)
  1662.     {
  1663.         configFile=temp;
  1664.         SetConfigPath(true); 
  1665.         SaveConfig();
  1666.     }
  1667. }
  1668.  
  1669.  
  1670. function ReadConfig()
  1671. {
  1672.     position="configwizard.js";
  1673.     whatfunc="ReadConfig()";
  1674.  
  1675.     var line=new String();
  1676.     var opt=new String();
  1677.     var val=new String();
  1678.      var i, txt;
  1679.  
  1680.     pn=1;
  1681.     strFile=configFile;
  1682.     if (FileExists(strFile))
  1683.     {
  1684.         configList=[];
  1685.         try 
  1686.         {
  1687.             tf=fso.OpenTextFile(strFile, 1);
  1688.             while (!tf.AtEndOfStream)
  1689.             {
  1690.                    line=tf.ReadLine();
  1691.                 if (line.search("^ *$")==0)
  1692.                     continue;  // empty line
  1693.                 if (line.search("^ *//")==0)
  1694.                     continue; // comments
  1695.                 if (line.search("^ *pn")==0)
  1696.                     continue; // pn++
  1697.                 line=line.replace(/^var /g,"");
  1698.                 line=line.replace(/^ */g,"");
  1699.  
  1700.                 opt=line.substring(0,line.indexOf("["));
  1701.                 val=line.substring(line.indexOf("=")+1, line.length);
  1702.                 val=val.replace(/^ *\[ */,"").replace(/^ *' */,"");
  1703.                 val=val.replace(/ *] *$/,"").replace(/ *' *$/,"");
  1704.                 val=val.replace(/ *]; *$/,"").replace(/ *' *$/,"");
  1705.                 val=val.replace(/\\\\/g,"\\");
  1706.                 val=val.replace(/\\'/g,"'");
  1707.                 switch (opt)
  1708.                 {
  1709.                     case "prog":
  1710.                         configList[pn-1]=new program(pn);
  1711.                         clearProgram(configList[pn-1]);
  1712.                         configList[pn-1].prog=val;
  1713.                         pn++;
  1714.                         break;
  1715.  
  1716.                     case "ordr":
  1717.                         configList[pn-2].ordr=val;
  1718.                         break;
  1719.  
  1720.                     case "desc":
  1721.                         configList[pn-2].desc=val;
  1722.                         break;
  1723.  
  1724.                     case "uid":
  1725.                         configList[pn-2].uid=val;
  1726.                         break;
  1727.  
  1728.                     case "dflt":
  1729.                         configList[pn-2].dflt=val;
  1730.                         break;
  1731.  
  1732.                     case "cat":
  1733.                         configList[pn-2].cat=val;
  1734.                         break;
  1735.  
  1736.                     case "forc":
  1737.                         configList[pn-2].forc=val;
  1738.                         break;
  1739.  
  1740.                     case "configs":
  1741.                         configList[pn-2].configs=val;
  1742.                         break;
  1743.  
  1744.                     case "deps":
  1745.                         val=val.replace (/ *' *, *' */gi,",");
  1746.                         configList[pn-2].deps=val;
  1747.                         break;
  1748.  
  1749.                     case "excl":
  1750.                         val=val.replace (/ *' *, *' */gi,",");
  1751.                         configList[pn-2].excl=val;
  1752.                         break;
  1753.  
  1754.                     case "cond":
  1755.                         configList[pn-2].cond=val;
  1756.                         break;
  1757.  
  1758.                     case "gcond":
  1759.                         configList[pn-2].gcond=val;
  1760.                         break;
  1761.  
  1762.                     case "regb":
  1763.                         configList[pn-2].regb=val;
  1764.                         break;
  1765.  
  1766.                     case "cmd1":
  1767.                         configList[pn-2].cmd1=val;
  1768.                         break;
  1769.  
  1770.                     case "cmd2":
  1771.                         configList[pn-2].cmd2=val;
  1772.                         break;
  1773.  
  1774.                     case "cmd3":
  1775.                         configList[pn-2].cmd3=val;
  1776.                         break;
  1777.  
  1778.                     case "cmd4":
  1779.                         configList[pn-2].cmd4=val;
  1780.                         break;
  1781.  
  1782.                     case "cmd5":
  1783.                         configList[pn-2].cmd5=val;
  1784.                         break;
  1785.  
  1786.                     case "cmd6":
  1787.                         configList[pn-2].cmd6=val;
  1788.                         break;
  1789.  
  1790.                     case "cmd7":
  1791.                         configList[pn-2].cmd7=val;
  1792.                         break;
  1793.  
  1794.                     case "cmd8":
  1795.                         configList[pn-2].cmd8=val;
  1796.                         break;
  1797.  
  1798.                     case "cmd9":
  1799.                         configList[pn-2].cmd9=val;
  1800.                         break;
  1801.  
  1802.                     case "cmd10":
  1803.                         configList[pn-2].cmd10=val;
  1804.                         break;
  1805.  
  1806.                     case "rega":
  1807.                         configList[pn-2].rega=val;
  1808.                         break;
  1809.  
  1810.                     case "picf":
  1811.                         configList[pn-2].picf=val;
  1812.                         break;
  1813.  
  1814.                     case "picw":
  1815.                         if (configList[pn-2].picf)
  1816.                             configList[pn-2].picw=val;
  1817.                         break;
  1818.  
  1819.                     case "pich":
  1820.                         if (configList[pn-2].picf)
  1821.                             configList[pn-2].pich=val;
  1822.                         break;
  1823.  
  1824.                     case "textl":
  1825.                         if (configList[pn-2].picf)
  1826.                             configList[pn-2].textl=val;
  1827.                         break;
  1828.                 }
  1829.             }
  1830.         }
  1831.         catch (ex) 
  1832.         { ;    }
  1833.         finally 
  1834.         { 
  1835.             tf.Close(); 
  1836.         }
  1837.     }
  1838.     else
  1839.     {
  1840.         CreateControls();
  1841.         CreateNavigation();
  1842.  
  1843.         document.getElementById("configGuts").innerHTML=CreateConfigRow();
  1844.         document.getElementById("configTemplateBG").style.backgroundImage='url('+wpipath+'\\Themes\\'+Theme+'\\OptionsBg.gif)';
  1845.  
  1846.         ConfigDefaults();
  1847.  
  1848.         LocalizeConfigTexts();
  1849.  
  1850.         InsertCatsValues();
  1851.         InsertConfigsValues();
  1852.  
  1853.         pn=1;
  1854.         cpos=0;
  1855.         FillInConfig(true,cpos);
  1856.  
  1857.         return;
  1858.     }
  1859.  
  1860.     if (SortWithinCats)
  1861.         configList.sort(byName);
  1862.  
  1863.     CreateControls();
  1864.     CreateNavigation();
  1865.     FillInConfigFile();
  1866.  
  1867.     document.getElementById("configGuts").innerHTML=CreateConfigRow();
  1868.     document.getElementById("configTemplateBG").style.backgroundImage='url('+wpipath+'\\Themes\\'+Theme+'\\OptionsBg.gif)';
  1869.  
  1870.     LocalizeConfigTexts();
  1871.  
  1872.     InsertCatsValues();
  1873.     InsertConfigsValues();
  1874.  
  1875.     cpos=0;
  1876. //    FillInConfig(true,cpos);
  1877.     FillInConfig(false,cpos);
  1878. }
  1879.  
  1880.  
  1881. function SaveConfig()
  1882. {
  1883.     position="configwizard.js";
  1884.     whatfunc="SaveConfig()";
  1885.  
  1886.     var form, txt;
  1887.  
  1888.     strFile=configFile;
  1889.  
  1890.     try 
  1891.     {
  1892.         tf=fso.CreateTextFile(strFile, true);
  1893.  
  1894.         ToggleControlGadgets(true);
  1895.         document.getElementById("layerconfig").style.cursor='wait';
  1896.  
  1897.         tf.WriteLine("//---------------------------------------------------------------------------------------------");
  1898.         tf.WriteLine("// Reference ... prog[0] won't be used. It's just an example.");
  1899.         tf.WriteLine("// Look in program.js to see explanation of these properties.");
  1900.         tf.WriteLine("//---------------------------------------------------------------------------------------------  ");
  1901.         tf.WriteLine("// pn=0;    // start value for prog numbering");
  1902.         tf.WriteLine("// prog[pn]=['ProgramName'];");
  1903.         tf.WriteLine("// ordr[pn]=[0];");
  1904.         tf.WriteLine("// desc[pn]=['Description'];");
  1905.         tf.WriteLine("// uid[pn]=['APP1'];");
  1906.         tf.WriteLine("// dflt[pn]=['no'];");
  1907.         tf.WriteLine("// cat[pn]=['Application Category'];");
  1908.         tf.WriteLine("// forc[pn]=['false'];");
  1909.         tf.WriteLine("// configs[pn]=['List of configs to be auto checked. Comma seperated'];");
  1910.         tf.WriteLine("// deps[pn]=[];");
  1911.         tf.WriteLine("// excl[pn]=[];");
  1912.         tf.WriteLine("// cond[pn]=['Javascript Conditional Statement'];");
  1913.         tf.WriteLine("// gcond[pn]=['Javascript Conditional Statement to gray item'];");
  1914.         tf.WriteLine("// regb[pn]=['Registry Key Path'];");
  1915.         tf.WriteLine("// cmd1[pn]=['CommandLine 1'];");
  1916.         tf.WriteLine("// cmd2[pn]=['CommandLine 2'];");
  1917.         tf.WriteLine("// cmd3[pn]=['CommandLine 3'];");
  1918.         tf.WriteLine("// cmd4[pn]=['CommandLine 4'];");
  1919.         tf.WriteLine("// cmd5[pn]=['CommandLine 5'];");
  1920.         tf.WriteLine("// cmd6[pn]=['CommandLine 6'];");
  1921.         tf.WriteLine("// cmd7[pn]=['CommandLine 7'];");
  1922.         tf.WriteLine("// cmd8[pn]=['CommandLine 8'];");
  1923.         tf.WriteLine("// cmd9[pn]=['CommandLine 9'];");
  1924.         tf.WriteLine("// cmd10[pn]=['CommandLine 10'];");
  1925.         tf.WriteLine("// rega[pn]=['Registry Key Path'];");
  1926.         tf.WriteLine("// picf[pn]=['Picture File'];");
  1927.         tf.WriteLine("// picw[pn]=['Width'];");
  1928.         tf.WriteLine("// pich[pn]=['Height'];");
  1929.         tf.WriteLine("// textl[pn]=['Text Location'];");
  1930.         tf.WriteLine("// pn++;");
  1931.         tf.WriteLine("");
  1932.         tf.WriteLine("//---------------------------------------------------------------------------------------------");
  1933.         tf.WriteLine("// Your programs here ...");
  1934.         tf.WriteLine("//---------------------------------------------------------------------------------------------");
  1935.         tf.WriteLine("pn=1;");
  1936.         
  1937.         CopyConfig(cpos);
  1938.         if (SortWithinCats)
  1939.             configList.sort(byName);
  1940.  
  1941.         for (var i=0; i<configList.length && configList[i] != null; i++)
  1942.         {
  1943.             WriteConfigValue(tf, "prog",configList[i].prog);
  1944.             WriteConfigValue(tf, "ordr", configList[i].ordr,1);
  1945.             WriteConfigValue(tf, "desc", configList[i].desc);
  1946.  
  1947.             txt=GetConfigValue(configList[i].uid);
  1948.             txt=txt.replace(/ */g,"");
  1949.             WriteConfigValue(tf, "uid", txt, 1);
  1950.  
  1951.             WriteConfigValue(tf, "dflt", configList[i].dflt);
  1952.             WriteConfigValue(tf, "cat", configList[i].cat);
  1953.             WriteConfigValue(tf, "forc", configList[i].forc);
  1954.             WriteConfigValue(tf, "configs", configList[i].configs);
  1955.  
  1956.             txt=GetConfigValue(configList[i].deps);
  1957.             txt=txt.replace(/ */g,"");
  1958.             txt=txt.replace(/'/g,",");
  1959.             txt=txt.replace(/,,/g,",");
  1960.             txt=txt.replace(/,/g,"','");
  1961.             txt=txt.replace(/^',/,"").replace(/,'$/,"");
  1962.             WriteConfigValue(tf, "deps", txt, 1);
  1963.  
  1964.             txt=GetConfigValue(configList[i].excl);
  1965.             txt=txt.replace(/ */g,"");
  1966.             txt=txt.replace(/'/g,",");
  1967.             txt=txt.replace(/,,/g,",");
  1968.             txt=txt.replace(/,/g,"','");
  1969.             txt=txt.replace(/^',/,"").replace(/,'$/,"");
  1970.             WriteConfigValue(tf, "excl", txt, 1);
  1971.  
  1972.             WriteConfigValue(tf, "cond", configList[i].cond);
  1973.             if (configList[i].gcond != "FileExists('%programfiles%\')")
  1974.                 WriteConfigValue(tf, "gcond",configList[i].gcond);
  1975.             WriteConfigValue(tf, "regb", configList[i].regb);
  1976.             WriteConfigValue(tf, "cmd1", configList[i].cmd1);
  1977.             WriteConfigValue(tf, "cmd2", configList[i].cmd2);
  1978.             WriteConfigValue(tf, "cmd3", configList[i].cmd3);
  1979.             WriteConfigValue(tf, "cmd4", configList[i].cmd4);
  1980.             WriteConfigValue(tf, "cmd5", configList[i].cmd5);
  1981.             WriteConfigValue(tf, "cmd6", configList[i].cmd6);
  1982.             WriteConfigValue(tf, "cmd7", configList[i].cmd7);
  1983.             WriteConfigValue(tf, "cmd8", configList[i].cmd8);
  1984.             WriteConfigValue(tf, "cmd9", configList[i].cmd9);
  1985.             WriteConfigValue(tf, "cmd10", configList[i].cmd10);
  1986.             WriteConfigValue(tf, "rega", configList[i].rega);
  1987.             WriteConfigValue(tf, "picf", configList[i].picf);
  1988.             WriteConfigValue(tf, "picw", configList[i].picw);
  1989.             WriteConfigValue(tf, "pich", configList[i].pich);
  1990.             WriteConfigValue(tf, "textl", configList[i].textl);
  1991.  
  1992.             tf.WriteLine("pn++;");
  1993.             tf.WriteLine("");
  1994.         }
  1995.         tf.WriteLine("//---------------------------------------------------------------------------------------------");
  1996.         tf.WriteLine("// End of program definitions ...");
  1997.         tf.WriteLine("//---------------------------------------------------------------------------------------------");
  1998.     }
  1999.     catch (ex) 
  2000.     { 
  2001.         alert(getText(errCouldNotSaveFile)+"\n"+strFile);
  2002.  
  2003.         return;
  2004.     }
  2005.     tf.Close();
  2006.  
  2007. //    alert(getText(txtConfigFileSaved));
  2008.     Pause(0,500);
  2009.     document.getElementById("layerconfig").style.cursor='default';
  2010.  
  2011.     ToggleControlGadgets(false);
  2012. }
  2013.  
  2014.  
  2015. function ShowConfig()
  2016. {
  2017.     position="configwizard.js";
  2018.     whatfunc="ShowConfig()";
  2019.  
  2020.     ManualSection="Config";
  2021.     HideLayers();
  2022.     document.getElementById("InstallButton").style.visibility='hidden';
  2023.     document.getElementById("layerconfig").style.display='block';
  2024.  
  2025.     ReadConfig();
  2026. }
  2027.  
  2028.  
  2029. function HideConfig()
  2030. {
  2031.     position="configwizard.js";
  2032.     whatfunc="HideConfig()";
  2033.  
  2034.     WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\WPI\\ConfigFile",configFile);
  2035.  
  2036.     document.location.reload();
  2037. }
  2038.  
  2039.  
  2040. function ToggleConfig()
  2041. {
  2042.     position="configwizard.js";
  2043.     whatfunc="ToggleConfig()";
  2044.  
  2045.     if (document.getElementById("layerconfig").style.display == 'none')
  2046.         ShowConfig();
  2047.     else
  2048.         HideConfig();
  2049. }
  2050.