<?php
/* Smarty version 3.1.29, created on 2016-08-14 17:32:40
  from "/var/www/user179/data/www/evomu.ru/views/templates/evomu/user/shop.tpl" */

if ($_smarty_tpl->smarty->ext->_validateCompiled->decodeProperties($_smarty_tpl, array (
  'has_nocache_code' => false,
  'version' => '3.1.29',
  'unifunc' => 'content_57b0810816b1a0_74163978',
  'file_dependency' => 
  array (
    '5bc5f2b4d2ab62e3ed2efe9a1861d14b7fd36a1f' => 
    array (
      0 => '/var/www/user179/data/www/evomu.ru/views/templates/evomu/user/shop.tpl',
      1 => 1471185142,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_57b0810816b1a0_74163978 ($_smarty_tpl) {
echo '<script'; ?>
>
    function getCategoryName(cat){
        switch (cat) {
            case "0":   return 'Swords'; break;
            case "1":   return 'Axes'; break;
            case "2":   return 'Scepters'; break;
            case "3":   return 'Spears'; break;
            case "4":   return 'Bows'; break;
            case "5":   return 'Staffs'; break;
            case "6":   return 'Shields'; break;
            case "7":   return 'Helms'; break;
            case "8":   return 'Armors'; break;
            case "9":   return 'Pants'; break;
            case "10": return 'Gloves'; break;
            case "11": return 'Boots'; break;
            case "12": return 'Wings/Сapes'; break;
            case "13": return 'Capes/Rings/Pedants'; break;
            case "14": return 'Jewels'; break;
            case "15": return 'Skills'; break;
            default: return 'Unknown';break;
        }
    }
    function GetImageChar(Class)
    {
        var classnum = '';
        switch (Class) {
            case "0":
                classnum = "/web/templates/default/images/Characters/sm.png";
                break;

            case "1":
                classnum = "/web/templates/default/images/Characters/bk.png";
                break;
            case "2":
                classnum = "/web/templates/default/images/Characters/me.png";
                break;
            case "3":
                classnum = "/web/templates/default/images/Characters/su.png";
                break;
            case "4":
                classnum = "/web/templates/default/images/Characters/mg.png";
                break;
            case "5":
                classnum = "/web/templates/default/images/Characters/dl.png";
                break;
            case "6":
                classnum = "/web/templates/default/images/Characters/rf.png";
                break;
            case "7":
                classnum = "/web/templates/default/images/Characters/su.png";
                break;


        }
        return classnum;
    }
    function GetClassChar(Class)
    {
        var classnum = '';
        switch (Class) {
            case "0": classnum = "Dark Wizard"; break;
            case "1": classnum = "Dark Knight"; break;
            case "2": classnum = "Fairy Elf"; break;
            case "3": classnum = "Summoner"; break;
            case "4": classnum = "Magic Gladiator"; break;
            case "5": classnum = "Dark Lord"; break;
            case "6": classnum = "Rage Fighter"; break;
            case "7": classnum = "Other Items"; break;
        }
        return classnum;
    }

    $(document).ready(function(){
        var Classes = $('.nice-button');
        var Categoryes = <?php echo json_encode($_smarty_tpl->tpl_vars['Categoryes']->value);?>
;
        var Items = <?php echo json_encode($_smarty_tpl->tpl_vars['CategoryesItems']->value);?>
;
        var Class = 0;
        var Type = 0;

       
        $('.character_classes a').click(function(){
            Class = $(this).attr('data-class');
            $('#shop-class-image').attr('src',GetImageChar(Class));
            $('#text-shop-class-image').html(GetClassChar(Class));
            $('.class_items_sub_groups').html(' ');
            var i = 0;
            Categoryes[$(this).attr('data-class')].sort(); // сортируем массив
            for (var i = Categoryes[$(this).attr('data-class')].length - 1; i > 0; i--) {
                if (Categoryes[$(this).attr('data-class')][i] == Categoryes[$(this).attr('data-class')][i - 1]) Categoryes[$(this).attr('data-class')].splice( i, 1);
            }
            
            Categoryes[$(this).attr('data-class')].sort(); // сортируем массив
            for (var key in Categoryes[$(this).attr('data-class')]) {
                var val = Categoryes[$(this).attr('data-class')][key];
                if (i == 0)
                    $('.class_items_sub_groups').append('<a data-cat="'+val+'" class="nice-button active">'+getCategoryName(val)+'</a>');
                else
                    $('.class_items_sub_groups').append('<a data-cat="'+val+'" class="nice-button">'+getCategoryName(val)+'</a>');
                i++;
            }

        });
        $(document).on("click",'.class_items_sub_groups a',function(){
            $('.items_list').html(' ');
            Type = $(this).attr('data-cat');
            for (var key in Items[Class][Type]) {
                var val = Items[Class][Type][key];
                $('.items_list').append('<a data-item-id="'+val['ID']+'" href="/user/shop/'+val['ID']+'" class="">'+val['Name']+'</a>');
                //$('.class_items_sub_groups').append('<a data-cat="'+key+'" class="nice-button">'+getCategoryName(key)+'</a>');
            }

        });
    });
<?php echo '</script'; ?>
>
<link rel="stylesheet" href="/web/templates/default/css/shop.css">
<h1>Магазин</h1>
<a href="/user" class="back-to-user-menu">Back to user menu</a>
<div class="ncontent">

        <div class="smithy">

           <div class="return">
             <span><?php echo $_smarty_tpl->tpl_vars['Valutes']->value[$_smarty_tpl->tpl_vars['Config']->value['MainValute']]['Name'];?>
: <?php echo $_smarty_tpl->tpl_vars['CharacterValutes']->value[$_smarty_tpl->tpl_vars['Config']->value['MainValute']]['Count'];?>
</span>
            <!--  <a href="/user/shop/return" class="nice-button">Return Item</a> -->
         </div>
          
            <div class="spacer_2px"></div>

            <div class="character_classes">
                <?php
$_from = $_smarty_tpl->tpl_vars['Classes']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_class_0_saved_item = isset($_smarty_tpl->tpl_vars['class']) ? $_smarty_tpl->tpl_vars['class'] : false;
$__foreach_class_0_saved_key = isset($_smarty_tpl->tpl_vars['i']) ? $_smarty_tpl->tpl_vars['i'] : false;
$_smarty_tpl->tpl_vars['class'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['i'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['class']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['i']->value => $_smarty_tpl->tpl_vars['class']->value) {
$_smarty_tpl->tpl_vars['class']->_loop = true;
$__foreach_class_0_saved_local_item = $_smarty_tpl->tpl_vars['class'];
?>
                    <?php if ('i' == 0) {?>
                        <a data-class="<?php echo $_smarty_tpl->tpl_vars['class']->value;?>
" class="nice-button active"><?php echo Shop::ClassesNames($_smarty_tpl->tpl_vars['class']->value);?>
</a>
                    <?php } else { ?>
                        <a data-class="<?php echo $_smarty_tpl->tpl_vars['class']->value;?>
" class="nice-button"><?php echo Shop::ClassesNames($_smarty_tpl->tpl_vars['class']->value);?>
</a>
                    <?php }?>
                <?php
$_smarty_tpl->tpl_vars['class'] = $__foreach_class_0_saved_local_item;
}
if ($__foreach_class_0_saved_item) {
$_smarty_tpl->tpl_vars['class'] = $__foreach_class_0_saved_item;
}
if ($__foreach_class_0_saved_key) {
$_smarty_tpl->tpl_vars['i'] = $__foreach_class_0_saved_key;
}
?>
            </div>

            <div class="smithy_wrapper">
                <div class="smithy-class">
                    <img id="shop-class-image" width="86px" src="<?php echo Shop::GetImageChar(0);?>
" alt="">
                    <span id="text-shop-class-image"><?php echo Shop::GetClassChar(0);?>
</span>
                </div>

                <div class="class_items_sub_groups">


                </div>

                <div class="items_list">


                </div>
            </div>

            <div class="spacer_2px"></div>
            <?php if (!empty($_smarty_tpl->tpl_vars['SelectedItem']->value)) {?>
            <form action="/user/shop" method="post" name="stats_start">
            <table width="100%" class="selected_item">
                <tbody><tr>
                    <td>
                        <div class="item_image">
                            <img src="/web/templates/default/images/items/<?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['Type'];?>
-<?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['Index'];?>
.gif">
                        </div>
                        <div class="selected_item_name"><?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['Name'];?>
</div>
                        <div class="selected_item_price">Price: <span id="ItemPrice"><?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['StartPrice'];?>
</span> <?php echo $_smarty_tpl->tpl_vars['Valutes']->value[$_smarty_tpl->tpl_vars['Config']->value['MainValute']]['Name'];?>
</div>
                        <button name="buy" value="<?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['ID'];?>
" class="selected_item_buy_button">Buy</button>
                    </td>
                    <td class="item_options">
                            <input type="hidden" name="buy_item">
                            <div class="row">
                                <select onchange="SetPrice();" name="level" id="select_level">
                                    <?php
$_smarty_tpl->tpl_vars['level'] = new Smarty_Variable;$_smarty_tpl->tpl_vars['level']->step = 1;$_smarty_tpl->tpl_vars['level']->total = (int) ceil(($_smarty_tpl->tpl_vars['level']->step > 0 ? $_smarty_tpl->tpl_vars['SelectedItem']->value['MaxLevel']+1 - (0) : 0-($_smarty_tpl->tpl_vars['SelectedItem']->value['MaxLevel'])+1)/abs($_smarty_tpl->tpl_vars['level']->step));
if ($_smarty_tpl->tpl_vars['level']->total > 0) {
for ($_smarty_tpl->tpl_vars['level']->value = 0, $_smarty_tpl->tpl_vars['level']->iteration = 1;$_smarty_tpl->tpl_vars['level']->iteration <= $_smarty_tpl->tpl_vars['level']->total;$_smarty_tpl->tpl_vars['level']->value += $_smarty_tpl->tpl_vars['level']->step, $_smarty_tpl->tpl_vars['level']->iteration++) {
$_smarty_tpl->tpl_vars['level']->first = $_smarty_tpl->tpl_vars['level']->iteration == 1;$_smarty_tpl->tpl_vars['level']->last = $_smarty_tpl->tpl_vars['level']->iteration == $_smarty_tpl->tpl_vars['level']->total;?>
                                        <option data-price="<?php echo $_smarty_tpl->tpl_vars['level']->value*$_smarty_tpl->tpl_vars['Config']->value['Price']['Level'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['level']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['Name'];?>
 +<?php echo $_smarty_tpl->tpl_vars['level']->value;?>
</option>
                                    <?php }
}
?>

                                </select>
                                <select onchange="SetPrice();" name="option" id="select_opt">
                                    <?php
$_smarty_tpl->tpl_vars['opt'] = new Smarty_Variable;$_smarty_tpl->tpl_vars['opt']->step = 1;$_smarty_tpl->tpl_vars['opt']->total = (int) ceil(($_smarty_tpl->tpl_vars['opt']->step > 0 ? $_smarty_tpl->tpl_vars['SelectedItem']->value['MaxAddition']+1 - (0) : 0-($_smarty_tpl->tpl_vars['SelectedItem']->value['MaxAddition'])+1)/abs($_smarty_tpl->tpl_vars['opt']->step));
if ($_smarty_tpl->tpl_vars['opt']->total > 0) {
for ($_smarty_tpl->tpl_vars['opt']->value = 0, $_smarty_tpl->tpl_vars['opt']->iteration = 1;$_smarty_tpl->tpl_vars['opt']->iteration <= $_smarty_tpl->tpl_vars['opt']->total;$_smarty_tpl->tpl_vars['opt']->value += $_smarty_tpl->tpl_vars['opt']->step, $_smarty_tpl->tpl_vars['opt']->iteration++) {
$_smarty_tpl->tpl_vars['opt']->first = $_smarty_tpl->tpl_vars['opt']->iteration == 1;$_smarty_tpl->tpl_vars['opt']->last = $_smarty_tpl->tpl_vars['opt']->iteration == $_smarty_tpl->tpl_vars['opt']->total;?>
                                        <option data-price="<?php echo $_smarty_tpl->tpl_vars['opt']->value*$_smarty_tpl->tpl_vars['Config']->value['Price']['Option'];?>
" value="<?php echo $_smarty_tpl->tpl_vars['opt']->value;?>
">Additional Damage +<?php echo $_smarty_tpl->tpl_vars['opt']->value*4;?>
</option>
                                    <?php }
}
?>

                                </select>
                            </div>

                            <div class="row">
                                <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['Luck']) {?>
                                <label class="luck"><input onclick="SetPrice();" type="checkbox" id="select_luck" name="luck" data-price="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Luck'];?>
"> -
                                    Luck</label>
                                <?php }?>
                                <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['Skill']) {?>
                                <label class="skill"><input onclick="SetPrice();" type="checkbox" id="select_skill" name="skill" data-price="<?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Skill'];?>
"> -
                                    Skill</label>
                                <?php }?>
                            </div>

                            <div class="row excellent">
            
                                <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['InClass'][6] != -1) {?>
                                    <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['InClass'][6] == 0) {?>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" id="exc1" name="exc1"> - Mana After Hunting Monsters +mana/8</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc2" id="exc2"> - Life After Hunting Monsters +life/8</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc3" id="exc3"> - Increase Attacking(Wizardy) speed +7</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc4" id="exc4"> - Increase Damage +2%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc5" id="exc5"> - Increase Damage +Level/20</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc6" id="exc6"> - Excellent Damage Rate +10%</label>
                                        </div>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['SelectedItem']->value['InClass'][6] == 1) {?>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" id="exc1" name="exc1"> - Increases acquisition rate of Zen after hunting monsters +30%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc2" id="exc2"> - Defense success rate +10%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc3" id="exc3"> - Reflect Damage +5%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc4" id="exc4"> - Damage Decrease +4%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc5" id="exc5"> - Increase Max Mana +4%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc6" id="exc6"> - Increase Max HP +4%</label>
                                        </div>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['SelectedItem']->value['InClass'][6] == 2) {?>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" id="exc1" name="exc1"> - HP +50 increased</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc2" id="exc2"> - Mana +50 increased</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc3" id="exc3"> - Ignor opponents defensive power by 3%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc4" id="exc4"> - Max AG +50 increased</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc5" id="exc5"> - Increase Attacking(Wizardry)speed +5</label>
                                        </div>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['SelectedItem']->value['InClass'][6] == 4) {?>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" id="exc1" name="exc1"> - Ingor opponents defensive power by 5%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc2" id="exc2"> - Returns the enemys attack power in 5%</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc3" id="exc3"> - Complete recovery of life in 5% rate</label>
                                        </div>
                                        <div>
                                            <label><input type="checkbox" onclick="SetPrice();" name="exc4" id="exc4"> - Complete recover of Mana in 5% rate</label>
                                        </div>
                                    <?php }?>
                                <?php }?>
                            </div>
                            <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['Ancient1'] || $_smarty_tpl->tpl_vars['SelectedItem']->value['Ancient2']) {?>
                            <div class="row ancient">
                                <table>
                                    <tr><td rowspan="2" style="vertical-align: middle;">Ancient:</td>
                                        <td>
                                            <select id="select_anc" style="width:250px;" name="select_anc" onchange="SetPrice();;">
                                                <option value="0">- Выберите анциент -</option>
                                                <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['Ancient1']) {?>
                                                    <option value="5">- <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['Ancient1'];?>
 -</option>
                                                <?php }?>
                                                <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['Ancient2']) {?>
                                                    <option value="10">- <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['Ancient2'];?>
 -</option>
                                                <?php }?>

                                            </select>
                                        </td>

                                    </tr>

                                </table>
                            </div>
                            <?php }?>
                            <?php if ($_smarty_tpl->tpl_vars['SelectedItem']->value['Type'] <= 13 && $_smarty_tpl->tpl_vars['SelectedItem']->value['Harmony']) {?>
                            <div class="row harmony">
                                <table>
                                    <tr>
                                        <td rowspan="2" style="vertical-align: middle;">Harmony:</td>
                                        <td>
                                            <select id="select_joh" style="width:250px;" name="select_joh" onchange="SetPrice(); HarmonyOptions(this.form.select_joh.value);">
                                                <option value="0">- Выберите опцию -</option>
                                                <?php
$_from = $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['HarmOpt'];
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
$__foreach_name_1_saved_item = isset($_smarty_tpl->tpl_vars['name']) ? $_smarty_tpl->tpl_vars['name'] : false;
$__foreach_name_1_saved_key = isset($_smarty_tpl->tpl_vars['id']) ? $_smarty_tpl->tpl_vars['id'] : false;
$_smarty_tpl->tpl_vars['name'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['id'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['name']->_loop = false;
foreach ($_from as $_smarty_tpl->tpl_vars['id']->value => $_smarty_tpl->tpl_vars['name']->value) {
$_smarty_tpl->tpl_vars['name']->_loop = true;
$__foreach_name_1_saved_local_item = $_smarty_tpl->tpl_vars['name'];
?>
                                                    <option value="<?php echo $_smarty_tpl->tpl_vars['id']->value;?>
"><?php echo $_smarty_tpl->tpl_vars['name']->value;?>
</option>
                                                <?php
$_smarty_tpl->tpl_vars['name'] = $__foreach_name_1_saved_local_item;
}
if ($__foreach_name_1_saved_item) {
$_smarty_tpl->tpl_vars['name'] = $__foreach_name_1_saved_item;
}
if ($__foreach_name_1_saved_key) {
$_smarty_tpl->tpl_vars['id'] = $__foreach_name_1_saved_key;
}
?>
                                            </select>
                                            <br><br>
                                            <select id="select_joh_value" style="width:250px;display:none;" name="select_joh_value" onchange="SetPrice();" onclick="SetPrice();">
                                                <option value="0">- Выберите значение -</option>
                                            </select>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                            <?php }?>

                    </td>
                </tr>
                </tbody></table>
            </form>
            <?php }?>
        </div>



        <?php echo '<script'; ?>
 type="text/javascript">
            function SetPrice() {
                var ItemPrice = <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['StartPrice'];?>
;
                ItemPrice = ItemPrice + document.getElementById('select_level').value * <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Level'];?>
;
                ItemPrice = ItemPrice + document.getElementById('select_opt').value * <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Option'];?>
;
                exc_type = 1;
                exc_opt_limit = <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['MaxExcellent'];?>
;

                ItemPrice += HarmonyPrice();

                if (document.getElementById('select_skill') != undefined) {
                    if (document.getElementById('select_skill').checked == 1) {
                        ItemPrice = ItemPrice + <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Skill'];?>
;
                    }
                }
                if (document.getElementById('select_luck') != undefined){
                    if (document.getElementById('select_luck').checked == 1) {
                        ItemPrice = ItemPrice + <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Luck'];?>
;
                    }
                }
                if (document.getElementById('select_anc') != undefined){
                    if (document.getElementById('select_anc').value == 5) {
                        ItemPrice = ItemPrice + <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Ancient'];?>

                    }
                }

                if (document.getElementById('select_anc') != undefined){
                    if (document.getElementById('select_anc').value == 10) {
                        ItemPrice = ItemPrice + <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Ancient'];?>

                    }
                }
                exc_opt_price = <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Excellent'];?>
;
                var selected_exc_opt_count = 0;
                if (document.getElementById('exc1') != undefined) {
                    if (document.getElementById('exc1').checked == true) {
                        ItemPrice = ItemPrice + exc_opt_price;
                        selected_exc_opt_count = selected_exc_opt_count + 1;
                    }
                }
                if (document.getElementById('exc2') != undefined) {
                    if (document.getElementById('exc2').checked == true) {
                        ItemPrice = ItemPrice + exc_opt_price;
                        selected_exc_opt_count = selected_exc_opt_count + 1;
                    }
                }
                if (document.getElementById('exc3') != undefined) {
                    if (document.getElementById('exc3').checked == true) {
                        ItemPrice = ItemPrice + exc_opt_price;
                        selected_exc_opt_count = selected_exc_opt_count + 1;
                    }
                }
                if (document.getElementById('exc4') != undefined) {
                    if (document.getElementById('exc4').checked == true) {
                        ItemPrice = ItemPrice + exc_opt_price;
                        selected_exc_opt_count = selected_exc_opt_count + 1;
                    }
                }
                if (document.getElementById('exc5') != undefined) {
                    if (document.getElementById('exc5').checked == true) {
                        ItemPrice = ItemPrice + exc_opt_price;
                        selected_exc_opt_count = selected_exc_opt_count + 1;
                    }
                }
                if (document.getElementById('exc6') != undefined) {
                    if (document.getElementById('exc6').checked == true) {
                        ItemPrice = ItemPrice + exc_opt_price;
                        selected_exc_opt_count = selected_exc_opt_count + 1;
                    }
                }
                if(selected_exc_opt_count >= exc_opt_limit){
                    if (document.getElementById('exc1') != undefined) {
                        if (document.getElementById('exc1').checked != true) {
                            document.getElementById('exc1').disabled = true;
                        }
                    }
                    if (document.getElementById('exc2') != undefined) {
                        if (document.getElementById('exc2').checked != true) {
                            document.getElementById('exc2').disabled = true;
                        }
                    }
                    if (document.getElementById('exc3') != undefined) {
                        if (document.getElementById('exc3').checked != true) {
                            document.getElementById('exc3').disabled = true;
                        }
                    }
                    if (document.getElementById('exc4') != undefined) {
                        if (document.getElementById('exc4').checked != true) {
                            document.getElementById('exc4').disabled = true;
                        }
                    }
                    if (document.getElementById('exc5') != undefined) {
                        if (document.getElementById('exc5').checked != true) {
                            document.getElementById('exc5').disabled = true;
                        }
                    }
                    if (document.getElementById('exc6') != undefined) {
                        if (document.getElementById('exc6').checked != true) {
                            document.getElementById('exc6').disabled = true;
                        }
                    }
                }
                else{
                    if (document.getElementById('exc1') != undefined) {
                        document.getElementById('exc1').disabled = false;
                    }
                    if (document.getElementById('exc2') != undefined) {
                        document.getElementById('exc2').disabled = false;
                    }
                    if (document.getElementById('exc3') != undefined) {
                        document.getElementById('exc3').disabled = false;
                    }
                    if (document.getElementById('exc4') != undefined) {
                        document.getElementById('exc4').disabled = false;
                    }
                    if (document.getElementById('exc5') != undefined) {
                        document.getElementById('exc5').disabled = false;
                    }
                    if (document.getElementById('exc6') != undefined) {
                        document.getElementById('exc6').disabled = false;
                    }
                }
                document.getElementById('ItemPrice').innerHTML=ItemPrice;
            }

            function HarmonyPrice() {
                var johType = document.getElementById('select_joh');
                if (!johType) return 0;

                var johValue = document.getElementById('select_joh_value');

                var optType = johType.options[johType.selectedIndex];
                if (optType.value == 0) return 0;

                var optValue = johValue.options[johValue.selectedIndex];

                return <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['Harmony'];?>
 + document.getElementById('select_joh_value').value * <?php echo $_smarty_tpl->tpl_vars['Config']->value['Price']['HarmonyLevel'];?>
;
            }

            function HarmonyOptions(Type) {
                $('#select_joh_value').html('<option value="0">- Выберите значение -</option>');
                document.getElementById("select_joh_value").style.display = "block";

                if(Type == 0){ document.getElementById("select_joh_value").style.display = "none"; }
                else if(Type == 1){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][1];?>
 }
                else if(Type == 2){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][2];?>
 }
                else if(Type == 3){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][3];?>
 }
                else if(Type == 4){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][4];?>
 }
                else if(Type == 5){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][5];?>
 }
                else if(Type == 6){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][6];?>
 }
                else if(Type == 7){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][7];?>
 }
                else if(Type == 8){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][8];?>
 }
                else if(Type == 9){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][9];?>
 }
                else if(Type == 10){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][10];?>
 }
                else if(Type == 11){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][11];?>
 }
                else if(Type == 12){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][12];?>
 }
                else if(Type == 13){ <?php echo $_smarty_tpl->tpl_vars['SelectedItem']->value['HarmonyList']['OptList'][13];?>
 }
                else{ top.location="shop"; }
            }
        <?php echo '</script'; ?>
>
    </form>
</div>




<?php }
}
