document.write("<script type='text/template'>");
        document.write("<div id='common/smiley-control.tpl'>&lt;div class=&quot;pnz ui-dialog ui-widget ui-widget-content ui-corner-all transparent smiles-select&quot; style=&quot;width: auto;&quot;&gt; &lt;div class=&quot;smiles-list&quot;&gt; &lt;% var flag = false; var i = 0; var result = _.reduce(Pnz.Smileys, function (memo, s) { i++; var str = &#39;&lt;img class=&quot;emoticon&quot; title=&quot;{0}&quot; alt=&quot;{0}&quot; src=&quot;{1}&quot; style=&quot;margin: 4px; cursor: pointer&quot; /&gt;&#39;.format(s, Pnz.Smileys.template.format(i)); if (flag) { memo.even = memo.even + str; } else { memo.odd = memo.odd + str; } flag = !flag; return memo; }, {even: &#39;&#39;, odd: &#39;&#39;}) %&gt; &lt;div style=&quot;white-space: pre&quot;&gt;&lt;%= result.even %&gt;&lt;/div&gt; &lt;div style=&quot;white-space: pre&quot;&gt;&lt;%= result.odd %&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</div>");
        document.write("</script>");document.write("<script type='text/template'>");
        document.write("<div id='payment/crystal-packs-selector.tpl'>&lt;% var tabindex = 0; %&gt; &lt;table id=&quot;payment-dialog&quot; class=&quot;payment-dialog&quot; data-exchange-rate=&quot;&lt;%= data.exchangeRate %&gt;&quot;&gt; &lt;% if(data.emailEnabled) { %&gt; &lt;tr class=&quot;email-cell&quot;&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td colspan=&quot;3&quot;&gt; &lt;span&gt;E-mail:&lt;/span&gt; &lt;input name=&quot;email&quot; type=&quot;email&quot; autocomplete=&quot;on&quot; tabindex=&quot;&lt;%= ++tabindex %&gt;&quot; class=&quot;email ui-corner-all input&quot; value=&quot;&lt;%= data.email %&gt;&quot; maxlength=&quot;255&quot; /&gt; &lt;div class=&quot;error-message&quot;&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr class=&quot;separator&quot;&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td colspan=&quot;3&quot;&gt; &lt;div class=&quot;horizontal-line-separator&quot;&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; &lt;% var from = [249, 252, 204]; var to = [255, 178, 27]; var pairs = _.zip(from, to); var i = 0; var colorsCount = data.packs.length + 1; var avg = function (index) { return _.map(pairs, function(pair) { return Math.floor((pair[0] * (colorsCount - index) + pair[1] * index) / colorsCount); }); }; _.each(data.packs, function(pack) { var color = avg(i); i++; %&gt; &lt;tr class=&quot;&lt;%= pack.isBest ? &quot;best-row&quot; : &quot;&quot; %&gt;&quot;&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td class=&quot;crystals&quot;&gt;&lt;%= pack.amount %&gt;&lt;/td&gt; &lt;td class=&quot;price&quot; style=&quot;color: &lt;%= &#39;rgb({0},{1},{2})&#39;.format(color[0], color[1], color[2]) %&gt;&quot;&gt; &lt;%= data.currency.format(pack.price) %&gt; &lt;/td&gt; &lt;td class=&quot;buy&quot;&gt; &lt;button class=&quot;button blue buy predefined-amount&quot; tabindex=&quot;&lt;%= ++tabindex %&gt;&quot; data-amount=&quot;&lt;%= pack.amount %&gt;&quot;&gt;&lt;%= $L.buy %&gt;&lt;/button&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% }); %&gt; &lt;% if(data.packs.length &gt; 0) { %&gt; &lt;tr class=&quot;separator&quot;&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td colspan=&quot;3&quot;&gt; &lt;div class=&quot;horizontal-line-separator&quot;&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;% } %&gt; &lt;tr class=&quot;separator info&quot;&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td colspan=&quot;3&quot;&gt;&lt;%= data.packs.length &gt; 0 ? $L.customAmountPrompt.format(data.minCrystalsPurchase) : $L.crystalsAmountPrompt.format(data.minCrystalsPurchase) %&gt;&lt;/td&gt; &lt;/tr&gt; &lt;% var color = avg(data.packs.length); %&gt; &lt;tr&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td class=&quot;crystals&quot;&gt; &lt;input type=&quot;text&quot; class=&quot;crystal-count ui-corner-all input&quot; tabindex=&quot;&lt;%= ++tabindex %&gt;&quot; maxlength=&quot;10&quot; /&gt; &lt;/td&gt; &lt;td class=&quot;price&quot; style=&quot;color: &lt;%= &#39;rgb({0},{1},{2})&#39;.format(color[0], color[1], color[2]) %&gt;&quot;&gt; &lt;%= data.currency.format(&#39;&lt;span class=&quot;price-value&quot;&gt;0&lt;/span&gt;&#39;) %&gt; &lt;/td&gt; &lt;td class=&quot;buy&quot;&gt; &lt;button class=&quot;button blue buy custom-amount&quot; tabindex=&quot;&lt;%= ++tabindex %&gt;&quot;&gt;&lt;%= $L.buy %&gt;&lt;/button&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr class=&quot;error-panel&quot; style=&quot;display: none;&quot;&gt; &lt;td class=&quot;best&quot;&gt;&lt;/td&gt; &lt;td colspan=&quot;3&quot;&gt;&lt;div class=&quot;error-message&quot;&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</div>");
        document.write("</script>");document.write("<script type='text/template'>");
        document.write("<div id='payment/crystal-packs-dialog.tpl'>&lt;div id=&quot;&lt;%= id %&gt;&quot; dialog-title=&quot;&lt;%= $L.paymentTitle %&gt;&quot;&gt; &lt;div class=&quot;dialog&quot;&gt; &lt;div id=&quot;&lt;%= id %&gt;-content&quot;&gt; &lt;/div&gt; &lt;div class=&quot;dialog-button-container&quot;&gt; &lt;button type=&quot;button&quot; tabindex=&quot;100&quot; class=&quot;close-button ui-button button blue&quot;&gt;&lt;%= $L.close %&gt;&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</div>");
        document.write("</script>");document.write("<script type='text/template'>");
        document.write("<div id='common/standard-dialog.tpl'>&lt;div class=&quot;dialod-image &lt;%= type %&gt;&quot;&gt;&lt;/div&gt; &lt;div class=&quot;dialog-text gold-text dialog-content&quot;&gt;&lt;%= content %&gt;&lt;/div&gt; &lt;div class=&quot;dialog-button-container&quot;&gt; &lt;% _.each(buttons, function(button) { %&gt; &lt;button type=&quot;button&quot; class=&quot;ui-button button &lt;%= button.cssClass %&gt;&quot; data-id=&quot;&lt;%= button.id %&gt;&quot; data-success=&quot;&lt;%= button.success %&gt;&quot;&gt;&lt;%= button.text %&gt;&lt;/button&gt; &lt;% }) %&gt; &lt;/div&gt;</div>");
        document.write("</script>");