/* DESTOON Copyright (C)2008-2099 www.destoon.com This is NOT a freeware,Use is subject to license.txt */ function Mshow(k) { if($('#t_'+k).attr('class') == 'on') return; for(var i = 0; i < 3; i++) { if(i == k) { $('#t_'+i).attr('class', 'on'); $('#c_'+i).show(); if(k == 1) comment_load(0); } else { $('#t_'+i).attr('class', ''); $('#c_'+i).hide(); } } } function addE(i) { $('#p'+i+' li').click(function() { $('#p'+i+' li')[s_s[i]].className = 'nv_1'; this.className = 'nv_2'; s_s[i] = $(this).index(); if(mallmode == 1) { if(i == 1) { var prices = $('#p1').data('prices').split('|'); $('#mall-price').html(prices[s_s[i]]); } } else if(mallmode == 3) { var key = s_s[1]+'-'+s_s[2]+'-'+s_s[3]; var obj = typeof mallstocks[key] == 'undefined' ? '' : mallstocks[key]; var pic = $('#album-item-'+js_pageid+' img:first').attr('src'); if(obj) { $('#mall-price').html(obj.price); $('#mall-amount').html(obj.amount); $('#album-ul-'+js_pageid+' img:first').attr('src', obj.thumb.replace('.thumb.', '.middle.')); $('.btn-buy,.btn-cart').attr('disabled', obj.amount > 0 ? false : true); } else { $('#mall-price').html($('#mall-price').data('price')); $('#mall-amount').html('0'); $('#album-ul-'+js_pageid+' img:first').attr('src', pic.replace('.thumb.', '.middle.')); $('.btn-buy,.btn-cart').attr('disabled', true); } } }); } function BuyNow() { Go(mallurl+'buy.php?mid='+mallmid+'&itemid='+mallid+'&s1='+s_s[1]+'&s2='+s_s[2]+'&s3='+s_s[3]+'&a='+Dd('amount').value); } function AddCart() { Go(mallurl+'cart.php?mid='+mallmid+'&itemid='+mallid+'&s1='+s_s[1]+'&s2='+s_s[2]+'&s3='+s_s[3]+'&a='+Dd('amount').value); } function Malter(t, min) { var max = parseInt($('#mall-amount').html()); var a = parseInt($('#amount').val()); if(t == '+') { if(a >= max) { Dd('amount').value = max; } else { Dd('amount').value = a + 1; } } else if(t == '-') { if(Dd('amount').value <= min) { Dd('amount').value = min; } else { Dd('amount').value = a - 1; } } else { if(a > max) Dd('amount').value = max; if(a < min) Dd('amount').value = min; } if(mallmode == 2) { var a3 = $('#data-step').data('a3'); if(a3 > 1 && a > a3) { $('#mall-price').html($('#data-step').data('p3')); return; } var a2 = $('#data-step').data('a2'); if(a2 > 1 && a > a2) { $('#mall-price').html($('#data-step').data('p2')); return; } $('#mall-price').html($('#data-step').data('p1')); } } function comment_load(p) { if(n_c == 0) { Dd('c_1').innerHTML = '