home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / CHIP_CD_2005-06.iso / test / fruity / flstudio502_install.exe / FD.chm / html / _casecommon2.js < prev    next >
Encoding:
Text File  |  2004-11-08  |  23.4 KB  |  441 lines

  1. // shared decoding and rendering routines
  2.  
  3. // global objects
  4. if (!doDebug) params=new Array();
  5. userData=new Array();
  6.  
  7. // --------------------------------------
  8. // registration information
  9. // --------------------------------------
  10. xxlCodes = [31020, 37040, 33110, 37020, 37030, 37040, 33000, 37050]; // codes required to qualify XXL owner
  11. isXXL = false; //detected later
  12.  
  13. regInfo=[];
  14. regInfo[0] ={code:31020,name:'FL Studio Producer Edition',registered:false,needed:false}; // FL
  15. regInfo[1] ={code:31010,name:'FL Studio FruityLoops Edition',registered:false,needed:false};
  16. regInfo[2] ={code:31000,name:'FL Studio Express Edition',registered:false,needed:false};
  17. regInfo[3] ={code:37040,name:'Sytrus',registered:false,needed:false, isPlug:true};    
  18. regInfo[4] ={code:37030,name:'Fruity Soundfont Player',registered:false,needed:false, isPlug:true}; // Plugins
  19. regInfo[5] ={code:37020,name:'Fruity DX10',registered:false,needed:false, isPlug:true};
  20. regInfo[6] ={code:33300,name:'Wasp',registered:false,needed:false, isPlug:true};
  21. regInfo[7] ={code:33110,name:'SimSynth',registered:false,needed:false, isPlug:true};
  22. regInfo[8] ={code:33000,name:'Fruity DrumSynth Live',registered:false,needed:false, isPlug:true};
  23. regInfo[9] ={code:37050,name:'Fruity Video Player',registered:false,needed:false, isPlug:true};
  24. regInfo[10]={code:33400,name:'DreamStation DXi',registered:false,needed:false, isPlug:true};
  25. regInfo[11]={code:22100,name:'SimSynth (standalone)',registered:false,needed:false, isPlug:false};
  26. regInfo[12]={code:22250,name:'EZ-Editor',registered:false,needed:false, isPlug:false};
  27. regInfo[13]={code:22220,name:'BeatSlicer',registered:false,needed:false, isPlug:false};
  28. regInfo[14]={code:0,name:'EZ-Generator',registered:false,needed:false, isPlug:false};
  29. //    {code:37021,name:'DX10 VSTi/DXi',registered:false,needed:false, isPlug:true};  
  30. //    {code:37310,name:'WASP VSTi/DXi',registered:false,needed:false, isPlug:true}; 
  31. //    {code:37110,name:'SimSynth Live VSTi/DXi',registered:false,needed:false, isPlug:true};  
  32. //    {code:33400,name:'DreamStation DXi',registered:false,needed:false, isPlug:true};
  33.         
  34. // object with product text info (matches the index from the previous one)
  35. productText=[];
  36. // **** PRODUCER **** <<START>>
  37. productText[0] ='<div align="center"><img src="img_glob/_fllogo_producer.gif"xxlText></div>';
  38. productText[0]+='<span class="fl-emph">Producer Edition contains: </span>';
  39. productText[0]+='<ul><li class="fl-text">All <span class="fl-emph">Fruityloops Edition</span> features and…</li>';
  40. productText[0]+='<li class="fl-text"> New Mixer Window (64 channels, track rerouting, ASIO track recording, integrated EQ and more).</li>';
  41. productText[0]+='<li class="fl-text"> Audio tracks with waveform preview & support for cue points.</li>';
  42. productText[0]+='<li class="fl-text"> Automation clips with spline-based envelopes and an LFO unit.</li>';
  43. productText[0]+='<li class="fl-text"> Direct-to-disk recording & offline rendering of mixer tracks. </li>';
  44. productText[0]+='<li class="fl-text"> Integrated Wave Editor.</li>';
  45. productText[0]+='<li class="fl-text"> Life Time Free Updates to this edition.</li>';
  46. // **** PRODUCER **** <<END>>
  47. // **** FRUITYLOOPS **** <<START>>
  48. productText[1] ='<div align="center"><img src="img_glob/_fllogo_fl.gif"xxlText></div>';
  49. productText[1]+='<span class="fl-emph">Fruityloops Edition contains:</span>';
  50. productText[1]+='<ul><li class="fl-text">All <span class="fl-emph">Express Edition</span> features and…</li>';
  51. productText[1]+='<li class="fl-text">Piano roll allowing chords.</li>';
  52. productText[1]+='<li class="fl-text">Full automation of all wheels.</li>';
  53. productText[1]+='<li class="fl-text">ASIO support (allowing 2ms latency!).</li>';
  54. productText[1]+='<li class="fl-text">Internal controllers.</li>';
  55. productText[1]+='<li class="fl-text">Can be used as VSTi client in hosts like Cubase, Sonar, Logic, Orion, ...</li>';
  56. productText[1]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';
  57. // **** FRUITYLOOPS **** <<END>>
  58. // **** EXPRESS **** <<START>>
  59. productText[2] ='<div align="center"><img src="img_glob/_fllogo_express.gif"xxlText></div>';
  60. productText[2]+='<span class="fl-emph">Express Edition contains:</span>';
  61. productText[2]+='<ul><li class="fl-text">External generators.</li>';
  62. productText[2]+='<li class="fl-text">16Bit 44KHz stereo.</li>';
  63. productText[2]+='<li class="fl-text">External midi control</li>';
  64. productText[2]+='<li class="fl-text">Unlimited number of channels</li>';
  65. productText[2]+='<li class="fl-text">4 to 64 notes in a pattern sequencer.</li>';
  66. productText[2]+='<li class="fl-text">Integrated TS-404 bassline.</li>';
  67. productText[2]+='<li class="fl-text">Support for VSTi & DXi.</li>';
  68. productText[2]+='<li class="fl-text">Export to wav, MP3 & MIDI.</li>';
  69. productText[2]+='<li class="fl-text">Playlist.</li>';
  70. productText[2]+='<li class="fl-text">Piano keyboard.</li>';
  71. productText[2]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';
  72. // **** EXPRESS **** <<END>>
  73. // **** XXL ****
  74. xxlText ='<div align="center"><img src="img_glob/_fllogo_xxl.gif"xxlText></div>';
  75. xxlText+='<span class="fl-emph">XXL Edition contains:</span>';
  76. xxlText+='<ul><li class="fl-text">All <span class="fl-emph">Producer Edition</span> features and…</li>';
  77. xxlText+='<li class="fl-text">Sytrus Generator Plugin</li>';
  78. xxlText+='<li class="fl-text">SimSynth Live Generator Plugin</li>';
  79. xxlText+='<li class="fl-text">DX10 FMSynth Generator Plugin</li>';
  80. xxlText+='<li class="fl-text">SoundFont Player Generator Plugin</li>';
  81. xxlText+='<li class="fl-text">DrumSynth Live Generator Plugin</li>';
  82. xxlText+='<li class="fl-text">SimSynth Live Generator Plugin</li>';
  83. xxlText+='<li class="fl-text">Video Player Plugin</li>';
  84. // **** XXL **** <<END>>
  85. productText[3] ='Sytrus is a versatile synthesizer combining Frequency Modulation (FM), Ring Modulation (RM), plucked string modeling and subtracting synthesis, and featuring a powerful envelope editor.<br>The synth includes a powerful editable unison mode and a comprehensive effects section.';
  86. productText[4] ='Fruity Soundfont Player is an FL Studio add-on that gives you the power to load, play and render soundfonts (.sf2 files).';
  87. productText[5] ='This DX10 FM synth is an FL Studio add-on that recreates the classic FM sound by using a harmonically rich modulating oscillator. Intuitive interface!';
  88. productText[6] ='The WASP is the FL Studio generator version of the WASP, a complex subtractor using 2 oscillators. You get both the Fruity as the VSTi version.';
  89. productText[7] ='SimSynth Live is the FL Studio generator version of SimSynth. This is a <b>realtime</b> version of the standalone version of SimSynth that can be run INSIDE FL Studio.';
  90. productText[8] ='Gives you the power of Live drums in your FL Studio productions. Tweak your drums until they are just perfect!';
  91. productText[9] ='Video Player will play videos together with your project. This allows you to create, adjust and synchronize your audio project with a video track of your choice.';
  92. productText[10]='Dreamstation DXi is a versatile DirectX instrument creating "analog synth" quality sounds that works inside all DXi compatible hosts like FL Studio and Sonar.';
  93. productText[11]='SimSynth Standalone is the original version of SimSynth. It has more advanced settings and can produce a wider variety of sounds but can not run in FL Studio. However, FL Studio can use its presets and riffs as regular samples!';
  94. productText[12]='EZ Editor is the ideal companion for all your sample handling. Recording of WAV, set loop points, create custom shapes (formula editor), extract SoundFonts, ... ';
  95. productText[13]='BeatSlicer is an application that allows you to "slice" drumbreaks or other loops into its individual parts, rearrange them and use them inside FL Studio.';
  96. productText[14]='Super Easy but powerful web site building tool (all of our own websites are built with this tool)! Buying it also gives you free access to +2000 customizable web template variations and to our Stock Images Library.';
  97. // --------------------------------------
  98.  
  99. // boxed edition codes
  100. boxCodes=[31431,31441,31402,31401,31400,31541,31511,31449,31620,31630,31610];
  101.  
  102. // --------------------------------------
  103. // this section contains routines to decode
  104. // the parameters
  105. // --------------------------------------
  106. function arrBase16_dec() { // decode info an array
  107.     if (doDebug) return; // DEBUG - do not decode params (they are already decoded for debug)
  108.     
  109.     var source=((paramsSource).slice(1)).toUpperCase(); // dump "G" at start & capitalize
  110.     var i=0,j=0;
  111.     var base16='0123456789ABCDEF';
  112.     var buffer=new Array();
  113.     buffer=source.split('G');
  114.     // init  (in case FL doesn't pass anything)
  115.     params[0]='';    params[1]='';    params[2]='';    params[3]='';    params[4]='';    
  116.     // parse
  117.     for (i=0;i<buffer.length;i++) {
  118.         params[i]='';
  119.         for (j=0;j<buffer[i].length;j+=2) {
  120.              params[i]+=String.fromCharCode(16*base16.indexOf(buffer[i].charAt(j))+base16.indexOf(buffer[i].charAt(j+1)));
  121.         }
  122.     }
  123. }
  124. function user_dec() { // decodes the user data elements
  125.     // init  (in case FL doesn't pass anything)
  126.     userData[0]='';userData[1]='';userData[2]='';userData[3]='';
  127.     // parse
  128.     userData[0]=params[1].substring(0,params[1].indexOf(':'));
  129.     userData[1]=params[1].substring(params[1].indexOf(':')+1,params[1].lastIndexOf(':'));
  130.     userData[2]=params[1].substring(params[1].indexOf('[')+1,params[1].indexOf(']'));
  131.     userData[3]=params[1].substring(params[1].indexOf('|')+1,params[1].lastIndexOf('|')).slice('|');    
  132.     // DEBUG
  133.     //userData[3]='[]';
  134.     // END DEBUG    
  135. }
  136. function scanRegInfo() { // scans ID-s and pluglist and updates regInfo
  137.     var i,j;
  138.     
  139.     // scan codes
  140.     var codes=userData[3].split('|');
  141.  
  142.     for (i=0;i<codes.length;i++) {
  143.         // check if the code means boxed version
  144.         for (j=0;j<boxCodes.length;j++) {
  145.             if (boxCodes[j]==Number(codes[i])) isBoxed=true;
  146.         }
  147.             
  148.         // detect is it Creative version
  149.         if (codes[i]=='21020' || codes[i]=='21420' || codes[i]=='21000' || codes[i]=='21010') {
  150.             if (codes[i]=='21020' || codes[i]=='21420') {
  151.                 isCreative=true;
  152.                 regInfo[2].name='FL Studio Creative Edition';
  153.                 // patch the regInfo/productText (temporal fix)            
  154.                 productText[1]='<div align="center"><img src="img_glob/_fllogo_fl.gif"></div>';
  155.                 productText[1]+='<span class="fl-emph">FL Studio Fruityloops Edition contains:</span>';
  156.                 productText[1]+='<ul><li class="fl-text">All <span class="fl-emph">Creative Edition</span> features and…</li>';
  157.                 productText[1]+='<li class="fl-text">Piano roll allowing chords.</li>';
  158.                 productText[1]+='<li class="fl-text">Full automation of all wheels.</li>';
  159.                 productText[1]+='<li class="fl-text">ASIO support (allowing 2ms latency!).</li>';
  160.                 productText[1]+='<li class="fl-text">Internal controllers.</li>';
  161.                 productText[1]+='<li class="fl-text">Can be used as VSTi client in hosts like Cubase, Sonar, Logic, Orion, ...</li>';
  162.                 productText[1]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';
  163.             }
  164.             if (codes[i]=='21000' || codes[i]=='21010') {
  165.                 isBasic=true;
  166.                 productText[2] ='<div align="center"><img src="img_glob/_fllogo_express.gif"xxlText></div>';
  167.                 productText[2]+='<span class="fl-emph">Express Edition contains:</span>';
  168.                 productText[2]+='<ul><li class="fl-text">All <span class="fl-emph">Basic / XP Edition</span> features and…</li>';                
  169.                 productText[2]+='<li class="fl-text">External generators.</li>';
  170.                 productText[2]+='<li class="fl-text">16Bit 44KHz stereo.</li>';
  171.                 productText[2]+='<li class="fl-text">External midi control</li>';
  172.                 productText[2]+='<li class="fl-text">Unlimited number of channels</li>';
  173.                 productText[2]+='<li class="fl-text">4 to 64 notes in a pattern sequencer.</li>';
  174.                 productText[2]+='<li class="fl-text">Integrated TS-404 bassline.</li>';
  175.                 productText[2]+='<li class="fl-text">Support for VSTi & DXi.</li>';
  176.                 productText[2]+='<li class="fl-text">Export to wav, MP3 & MIDI.</li>';
  177.                 productText[2]+='<li class="fl-text">Advanced Playlist.</li>';
  178.                 productText[2]+='<li class="fl-text">Piano keyboard.</li>';
  179.                 productText[2]+='<li class="fl-text">Life Time Free Updates to this edition.</li>';                
  180.             }
  181.         }    
  182.         
  183.         // set a product registered if a code is found
  184.         for (j=0;j<regInfo.length;j++) {
  185.             if (regInfo[j].code==Number(codes[i])) {
  186.                 regInfo[j].registered=true;
  187.             }
  188.         }
  189.     }
  190.     // scan pluglist
  191.     var pluglist=params[4].split(':');
  192.     for (i=0;i<pluglist.length;i++) {
  193.         for (j=0;j<regInfo.length;j++) {
  194.             if (regInfo[j].name.toUpperCase()==pluglist[i].toUpperCase()) {
  195.                 regInfo[j].needed=true;
  196.             }
  197.         }
  198.     }
  199.     // detect XXL installation
  200.     var hits = 0;
  201.     for (i=0;i<xxlCodes.length;i++) {
  202.         for (j=0;j<regInfo.length;j++) {
  203.             if (regInfo[j].code==xxlCodes[i] && regInfo[j].registered) {
  204.                 hits++;
  205.             }        
  206.         }
  207.     }    
  208.     if (hits == xxlCodes.length) isXXL = true;
  209. }
  210. // --------------------------------------
  211.  
  212. // --------------------------------------
  213. // to pass parameters as an URL
  214. // --------------------------------------
  215. function escape2(source) {
  216.     var i,c;
  217.     var result='';
  218.     for (i=0;i<source.length;i++) {
  219.         c=source.charAt(i);
  220.         switch (true) {
  221.              case (c==' '):
  222.                 result+='+'; break;
  223.             case ((c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='.' || c=='/' || c=='\\'):
  224.                 result+=c; break;
  225.             default:
  226.                 result+='%'+(Number(source.charCodeAt(i)).toString(16)).toUpperCase();
  227.         }    
  228.   }
  229.     return result;
  230. }
  231. // --------------------------------------
  232.  
  233. // --------------------------------------
  234. // procedures for managing the expanding tables
  235. // --------------------------------------
  236. function switchDTable(name) { // switches the body DIV of the table
  237.     var tableBody=eval(name+'body');
  238.   var tableGadget=eval(name+'gadget');
  239.     if (tableBody.style.display=='none' || tableBody.style.display=='') {
  240.         tableBody.style.display='block';
  241.         tableGadget.src='img_glob/_dyntbl_topleft2.gif';
  242.     }    else {
  243.         tableBody.style.display='none';
  244.         tableGadget.src='img_glob/_dyntbl_topleft1.gif';
  245.     }    
  246. }
  247. var countDTable=1; // this variable is used to give tables unique names (next function)
  248. function makeDTable(title, contents, isOpened) { // renders a dynamic table
  249.     // header
  250.     document.write('<p><table class="table-header" onClick="switchDTable(\''); // >>> table header
  251.     document.write('table'+(++countDTable)); // increase counter & write caller name
  252.     document.write('\');" width="100%" border="0" cellspacing="0" cellpadding="0">');
  253.     document.write('<tr>');
  254.     document.write('<td width="22" height="22" align="left" background="img_glob/_dyntbl_top.gif">'); // >>> top left edge
  255.     if (isOpened) document.write('<img src="img_glob/_dyntbl_topleft2.gif" name="');
  256.     else document.write('<img src="img_glob/_dyntbl_topleft1.gif" name="');
  257.     document.write('table'+countDTable+'gadget'); // write image name
  258.     document.write('" width="22" height="22"></td>'); 
  259.     document.write('<td height="22" align="left" background="img_glob/_dyntbl_top.gif">'); // >>> top (title)
  260.     document.write('<nobr><span class="table-title">'+title+'</span> <span class="table-titlenote">(click here for more information)</span></nobr></td>'); // write title
  261.     document.write('<td width="22" height="22" align="right" background="img_glob/_dyntbl_top.gif"><img src="img_glob/_dyntbl_topright.gif" width="23" height="22"></td></tr></table>'); // >>> top right edge
  262.     if (isOpened) document.write('<div class="table-body" style="display: block" id="table'+countDTable+'body">'+contents+'</div>'); // >>> write table body name (opened) & contents
  263.     else document.write('<div class="table-body" style="display: none" id="table'+countDTable+'body">'+contents+'</div>'); // >>> write table body name (closed) & contents    
  264.     document.write('<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>'); // >>> bottom section
  265.     document.write('<td width="22" height="22" align="left" background="img_glob/_dyntbl_bottom.gif"><img src="img_glob/_dyntbl_bottomleft.gif" width="23" height="22"></td>'); // >>> bottom left edge
  266.     document.write('<td height="22" background="img_glob/_dyntbl_bottom.gif"> </td>'); // >>> bottom side
  267.     document.write('<td width="22" height="22" align="right" background="img_glob/_dyntbl_bottom.gif"><img src="img_glob/_dyntbl_bottomright.gif" width="23" height="22"></td>'); // >>> bottom right edge
  268.     document.write('</tr></table></p>');
  269. }
  270. function makePlugDTable(i) { // makes a plugin/add-on dynamic table (based on the regInfo index)
  271.   var contents='';
  272.     contents+='<table border="0" cellspacing="0" cellpadding="0"><tr>';
  273.     contents+='<td><img src="img_glob/Register '+regInfo[i].name+'.gif" width="130" height="130" align="left">';
  274.     contents+=productText[i]+'</td></tr></table>';
  275.     contents+='<br><br>Click '+returnBuyLink(regInfo[i].code)+'here</a> to order.';
  276.     if (regInfo[i].name=='SimSynth') {
  277.         makeDTable('SimSynth Live',contents, false);
  278.     } else {
  279.         makeDTable(regInfo[i].name,contents, false);
  280.     }
  281.         
  282. }
  283.  
  284. function makeFLDTable(i) { // makes a "FL info" dynamic table (based on the regInfo index)
  285.     // i=-1 - demo; 2, 1, 0, 999 = baic, fruityloops, producer no xxl, producer and xxl
  286.     
  287.     var titleEnd; // modifies the table title
  288.   var contents='<table style="width:97.2%" border="0" cellpadding="5" cellspacing="5">';
  289.     contents+='<tr valign="top">';
  290.     var cellSpan; // how many percent spans each table cell
  291.     if (i==-1) cellSpan='25%';
  292.     if (i==2) cellSpan='33%';
  293.     if (i==1) cellSpan='50%';
  294.     if (i==0) cellSpan='100%';    
  295.     if (i==999) cellSpan='';    
  296.  
  297.     if (i==999) {    // user has registered Producer Edition (no upgrades, or only Lifetime Upd. upgrade for boxed)
  298.         // if the edition is boxed, it means the user can buy Lifetime updates
  299.         if (isBoxed) {
  300.             document.write('<p>'+returnBuyLink(31080)+'You can purchase <span style="font-weight:bold;">Lifetime Free Updates</span> for FL Studio XXL Edition ($29).</a></p><br><br>');
  301.         } else { // user has all
  302.             document.write('<p>No FL-Studio upgrades are available for your registration.</p>');
  303.         }
  304.     } else { // write the tables..
  305.         if (i==-1) { // demo: buy express
  306.             titleEnd="purchases";
  307.             contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  308.             contents+=productText[2];
  309.             if (i==-1) {
  310.                 if (isBasic) {
  311.                     contents+='<p><strong>Upgrade price: $39 USD</strong></p>'+
  312.                                         '<p>'+returnBuyLink(31060)+'Click here to order</a></p>';
  313.                 } else {
  314.                     contents+='<p><strong>Product price: $49 USD</strong></p>'+
  315.                                         '<p>'+returnBuyLink(31000)+'Click here to order</a></p>';
  316.                     
  317.                 }
  318.             }                
  319.             contents+='</td>';            
  320.         } else {
  321.             titleEnd="upgrades";
  322.         }
  323.         if (i==2 || i==-1) { // demo or express
  324.             contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  325.             contents+=productText[1];
  326.             if (i==-1) {    // demo: buy fruityloops
  327.                 if (isBasic) {
  328.                     contents+='<p><strong>Upgrade price: $79 USD</strong></p><p>'+returnBuyLink(31070)+'Click here to order</a></p>';
  329.                 } else {
  330.                     contents+='<p><strong>Product price: $99 USD</strong></p><p>'+returnBuyLink(31010)+'Click here to order</a></p>';                    
  331.                 }
  332.             }        
  333.             if (i==2) { // express: upgrade to fruityloops (from express)
  334.                 if (isCreative) {
  335.                     contents+='<p><strong>Upgrade price: $69 USD</strong></p>'+
  336.                                         '<p>'+returnBuyLink(31075)+'Click here to upgrade</a></p>';                    
  337.                 } else {
  338.                         contents+='<p><strong>Product price: $59 USD</strong></p>'+
  339.                                             '<p>'+returnBuyLink(31050)+'Click here to upgrade</a></p>';
  340.                 }
  341.             }                
  342.             contents+='</td>';
  343.         }
  344.         if (i!=0) { // demo, express, fl options for producer
  345.             contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  346.             contents+=productText[0];
  347.             if (i==-1) {    // demo: buy producer
  348.                 if (isBasic) {
  349.                     contents+=    '<p><strong>Upgrade price: $129 USD</strong></p>'+
  350.                                             '<p>'+returnBuyLink(31071)+'Click here to order</a></p>';    
  351.                 } else {
  352.                     contents+=    '<p><strong>Product price: $149 USD</strong></p>'+
  353.                                             '<p>'+returnBuyLink(31020)+'Click here to order</a></p>';    
  354.                 }
  355.             }            
  356.             if (i==1) { // fl edition: upgrade to producer from fruityloops
  357.                 if (isBoxed) {
  358.                     contents+='<p><strong>Upgrade price (boxed): $79 USD</strong></p>'+
  359.                                         '<p><strong>Upgrade price (online): $69 USD</strong></p>'+
  360.                                         '<p>'+returnBuyLink(31081)+'Click here to upgrade</a></p>';
  361.                 }    else {
  362.                     contents+='<p><strong>Upgrade price: $59 USD</strong></p>'+
  363.                                         '<p>'+returnBuyLink(31040)+'Click here to upgrade</a></p>';
  364.                 }
  365.             }    
  366.             if (i==2) { // express: upgrade to producer from express (express can't be boxed)
  367.                 if (isCreative) {
  368.                     contents+='<p><strong>Upgrade price: $119 USD</strong></p>'+
  369.                                         '<p>'+returnBuyLink(31076)+'Click here to upgrade</a></p>';                    
  370.                 } else {
  371.                     contents+='<p><strong>Upgrade price: $99 USD</strong></p>'+
  372.                                         '<p>'+returnBuyLink(31051)+'Click here to upgrade</a></p>';
  373.                     
  374.                 }
  375.             }                    
  376.             contents+='</td>';
  377.         }            
  378.         
  379.         // XXL
  380.         contents+='<td width="'+cellSpan+'" class="fl-tbl">';
  381.         contents+=xxlText;
  382.         if (isBoxed) {
  383.             if (i==1) { // from fruityloops
  384.                 contents+='<p><strong>Upgrade price (boxed): $269 USD</strong></p>'+
  385.                                     '<p><strong>Upgrade price (online): click the link for more info (no DVD included)</strong></p>'+
  386.                                     '<p>'+returnBuyLink('')+'Click here to upgrade</a></p>';
  387.             } else if (i==0) { // from producer
  388.                 contents+='<p><strong>Upgrade price (boxed): $199 USD</strong></p>'+
  389.                                     '<p><strong>Upgrade price (online): click the link for more info (no DVD included)</strong></p>'+
  390.                                     '<p>'+returnBuyLink('')+'Click here to upgrade</a></p>';
  391.             } else {
  392.                 contents+='<p><strong>Upgrade price: click the link for more info</strong></p>'+
  393.                     '<p>'+returnBuyLink('')+'Click here to upgrade</a></p>';
  394.             }
  395.         } else {
  396.             if (i==-1) { // buy
  397.                 if (isBasic) {
  398.                     contents+='<p><strong>Upgrade price: click the link for more info</strong></p>'+
  399.                                         '<p>'+returnBuyLink('')+'Click here to upgrade</a></p>';
  400.                 } else {
  401.                     contents+='<p><strong>Product price (boxed): $399 USD</strong></p>'+
  402.                                         '<p><strong>Product price (online): $299 USD (no DVD included)</strong></p>'+
  403.                                         '<p>'+returnBuyLink('')+'Click here to upgrade</a></p>';            
  404.                 }
  405.             } else { // upgrade (from any online version)
  406.                 contents+='<p><strong>Upgrade price: click the link for more info</strong></p>'+
  407.                                     '<p>'+returnBuyLink('')+'Click here to upgrade</a></p>';
  408.             }
  409.         }
  410.         contents+='</td>';
  411.         
  412.         
  413.         contents+='</tr></table>';
  414.         makeDTable('Available FL-Studio '+titleEnd,contents, true);
  415.     }
  416. }
  417. // --------------------------------------
  418.  
  419. // --------------------------------------
  420. // procedures for writing the links
  421. // --------------------------------------
  422. function returnLink(action, productID) { // returns link for the product/action specified
  423.     var linkContent='';
  424.     linkContent+='<a href="http://flredirect.e-officedirect.com/flredirect.exe?forumname=flstudio';
  425.     linkContent+='&action='+action;
  426.     linkContent+='&username='+escape2(userData[0]);
  427.     // linkContent+='&applicationID='+escape2(params[2])+'; appID not needed
  428.     if (action=='buy') linkContent+='&P_code='+productID; // product code only in buy/upgrade links
  429.     linkContent+='" target="_blank" class="link-common">';
  430.     return linkContent;
  431. }
  432. function returnSupportLink() { // support request link (reg problems)    
  433.     return returnLink('supportrequest',0);
  434. }
  435. function returnRegisterLink() { // code request/register link    
  436.     return returnLink('register',0);
  437. }
  438. function returnBuyLink(productID) { // product buy/upgrade    
  439.     return returnLink('buy',productID);
  440. }
  441. // --------------------------------------