var lhc={nayin:["金","金","火","火","木","木","土","土","金","金","火","火","水","水","土","土","金","金","木","木","水","水","土","土","火","火","木","木","水","水","金","金","火","火","木","木","土","土","金","金","火","火","水","水","土","土","金","金","木","木","水","水","土","土","火","火","木","木","水","水"],zodiac:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],red:{1:true,2:true,7:true,8:true,12:true,13:true,18:true,19:true,23:true,24:true,29:true,30:true,34:true,35:true,40:true,45:true,46:true},blue:{3:true,4:true,9:true,10:true,14:true,15:true,20:true,25:true,26:true,31:true,36:true,37:true,41:true,42:true,47:true,48:true},green:{5:true,6:true,11:true,16:true,17:true,21:true,22:true,27:true,28:true,32:true,33:true,38:true,39:true,43:true,44:true,49:true},getZodiac:function(year,num){return this.getZodiacList(year)[(Number(num)-1)%12];},getZodiacNum:function(year,sx){var result=[];var list=this.getZodiacList(year);for(var i=0;i<list.length;i++){if(list[i]===sx){for(x=i+1;x<50;x=x+12){result.push(x);}}}
return result;},getZodiacList:function(year){var startYear=1924;var index=(year-startYear)%12;var a=this.zodiac.slice(0,index+1).reverse();var b=this.zodiac.slice(index+1).reverse();return a.concat(b);},getFive:function(year,num){return this.getWuhang(year,num);},getWuhang:function(year,num){if(this.isLotteryNum(num)){var list=new Array();for(var i=1;i<=49;i++){var index=year-1922-i-1;list[i]=this.nayin[index%60];}
return list[Number(num)];}
return "";},getBose:function(num){num=Number(num);if(this.red[num]){return 'red';}else if(this.blue[num]){return 'blue';}else if(this.green[num]){return 'green';}
return "";},getYeshouJiaqin:function(year,num){var cate={"鼠,虎,兔,龙,蛇,猴,":"野兽","牛,马,羊,鸡,狗,猪,":"家禽"};if(Number(num)===49){return "<span>和</span>";}
for(var i in cate){if(i.indexOf(this.getZodiac(year,num))>-1){return cate[i]==="野兽"?this.showTag(cate[i],"color:red"):this.showTag(cate[i],"color:blue");}}
return "";},getSum:function(array){var sum=0;$.each(array,function(a,b){sum+=Number(b);});return sum;},getSumDanShuang:function(sum){return sum%2===0?this.showTag("总双","color:red"):this.showTag("总单","color:blue");},getWeekday:function(date){var week=["日","一","二","三","四","五","六"];return week[date.getDay()];},dateFormat:function(date,pattern){var e=["日","一","二","三","四","五","六"],o={"M+":date.getMonth()+1,"d+":date.getDate(),"h+":date.getHours(),"w+":"星期"+e[date.getDay()],"m+":date.getMinutes(),"s+":date.getSeconds(),"q+":Math.floor((date.getMonth()+3)/3),S:date.getMilliseconds()};/(y+)/.test(pattern)&&(pattern=pattern.replace(RegExp.$1,(date.getFullYear()+"").substr(4-RegExp.$1.length)));for(var n in o)new RegExp("("+n+")").test(pattern)&&(pattern=pattern.replace(RegExp.$1,1==RegExp.$1.length?o[n]:("00"+o[n]).substr((""+o[n]).length)));return pattern;},dateConvert:function(time){if(time.indexOf("-")>-1){return new Date(time.replace(/-/g,'/'));}
return new Date(time);},addZero:function(num){if(String(num).length>2){return num;}
return(Array(2).join('0')+num).slice(-2);},isLotteryNum:function(num){num=Number(num);if(this.red[num]){return true;}else if(this.blue[num]){return true;}else if(this.green[num]){return true;}
return false;},isRealNum:function(val){if(val===""||val==null){return false;}
return!isNaN(val)?true:false;},showTag:function(txt,style){if(style===undefined){return '<span>'+txt+'</span>';}else{return "<span style='"+style+";'>"+txt+"</span>";}}};