var GlobalConfig = [ ];
function t(){
var sid = $('#plserver').val();
var pid = $('#plpower').val();
if (sid==0 || pid==0){
$('#lvs,#lve').empty();$('#price').html('0');
return false;
}
$.getJSON( '/ajax.php?act=getPLConfig&gid=28&sid='+sid+'&pid='+pid, null, function(data){
if (data['configprice']=='') {
alert('no product!');
$('#lvs').empty();
$('#lve').empty();
$('#price').attr('usdprice',0).html('0.00 USD');
return false;
}
GlobalConfig.priceList = data['configprice'].split(',');
GlobalConfig.timesList = data['configtimes'].split(',');
GlobalConfig.MinPrice = data['minprice'];
GlobalConfig.MinTimes = data['mintimes'];
$('#lvs').empty().append( setLevel(data['powerlevel'],false) );
$('#lve').empty().append( setLevel(data['powerlevel'],true) );
lvcount();
});
}
function setLevel(level,isReverse){
var str = '';
if(isReverse){
for(var i=level;i>=0;i--)
str = str + '
';
} else {
for(var i=0;i<=level;i++)
str = str + '
';
}
return str;
}
Array.prototype._add = function(start,end){
if (start>=end) return false;
if (end>this.length) return false;
var result = 0;
for (var i=start;i
=GlobalConfig.MinPrice ? Number(usdPrice) : Number(GlobalConfig.MinPrice);
$('#price').attr('usdprice',usdPrice.toFixed(2)).html(usdPrice.toFixed(2) + ' USD');
if(userank!=1){
$('#price').addClass('osum');
var sum = (usdPrice*userank).toFixed(2);
$('#price').after(' '+sum+' USD');
}
var currency = getCookie('currencyCode');
$('.currency:contains('+currency+')').first().click();
var needTime = GlobalConfig.timesList._add(lv1,lv2);
needTime = needTime>=GlobalConfig.MinPrice ? needTime : GlobalConfig.MinPrice;
var tmptime = Math.floor(needTime/24);
$('#times').html(tmptime+' - '+(tmptime+1));
}