liuhaotian
2015-04-24 13:46:41 +08:00
var rates={10:"99-99",9:"94-98",8:"89-94",7:"77-88",6:"65-76",5:"37-64",4:"25-36",3:"13-24",2:"7-12",1:"1-6",0:"0-0"};function fGetRates(rightNum){var rate=rates[rightNum];if(rate){var index=rate.indexOf("-");var begin=rate.substring(0,index);var end=rate.substring(index+1,rate.length);return fRandom(+begin,+end);}
return 0;};function fRandom(begin,end){var diff=end-begin+1;return Math.floor(Math.random()*diff+begin);};function randomString(length){var chars='0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');if(!length){length=Math.floor(Math.random()*chars.length);}
var str='';for(var i=0;i<length;i++){str+=chars[Math.floor(Math.random()*chars.length)];}
return str;}