;!function(win){"use strict";var doc=win.document;var config={modules:{},status:{},timeout:10,event:{}};var Mbui=function(){this.v='1.0.1'};var GLOBAL=win.GLOBAL||{};var getPath=function(){var jsPath=doc.currentScript?doc.currentScript.src:function(){var js=doc.scripts;var last=js.length-1;var src;for(var i=last;i>0;i--){if(js[i].readyState==='interactive'){src=js[i].src;break}}return src||js[last].src}();return config.dir=GLOBAL.dir||jsPath.substring(0,jsPath.lastIndexOf('/')+1)}();var error=function(msg,type){type=type||'log';win.console&&console[type]&&console[type]('mbui error hint: '+msg)};var isOpera=typeof opera!=='undefined'&&opera.toString()==='[object Opera]';var modules={};Mbui.prototype.cache=config;Mbui.prototype.define=function(deps,factory){var that=this;var type=typeof deps==='function';var callback=function(){var setApp=function(app,exports){mbui[app]=exports;config.status[app]=true};typeof factory==='function'&&factory(function(app,exports){setApp(app,exports);config.callback[app]=function(){factory(setApp)}});return this};type&&(factory=deps,deps=[]);that.use(deps,callback,null,'define');return that};Mbui.prototype.use=function(apps,callback,exports,from){var that=this;var dir=config.dir=config.dir?config.dir:getPath;var head=doc.getElementsByTagName('head')[0];apps=function(){if(typeof apps==='string'){return[apps]}else if(typeof apps==='function'){callback=apps;return['all']}return apps}();var item=apps[0];var timeout=0;exports=exports||[];config.host=config.host||(dir.match(/\/\/([\s\S]+?)\//)||['//'+location.host+'/'])[0];function onScriptLoad(e,url){var readyRegExp=navigator.platform==='PLaySTATION 3'?/^complete$/:/^(complete|loaded)$/;if(e.type==='load'||(readyRegExp.test((e.currentTarget||e.srcElement).readyState))){config.modules[item]=url;head.removeChild(node);(function poll(){if(++timeout>config.timeout*1000/4){return error(item+' is not a valid module','error')}config.status[item]?onCallback():setTimeout(poll,4)}())}}function onCallback(){exports.push(mbui[item]);apps.length>1?that.use(apps.slice(1),callback,exports,from):(typeof callback==='function'&&function(){callback.apply(mbui,exports)}())}if(apps.length===0||(modules[item])){return onCallback(),that}var url=(modules[item]?(dir+'modules/'):(/^\{\/\}/.test(that.modules[item])?'':(config.base||'')))+(that.modules[item]||item)+'.js';url=url.replace(/^\{\/\}/,'');if(!config.modules[item]&&mbui[item]){config.modules[item]=url}if(!config.modules[item]){var node=doc.createElement('script');node.async=true;node.charset='utf-8';node.src=url+function(){var version=config.version===true?(config.v||(new Date()).getTime()):(config.version||'');return version?('?v='+version):''}();head.appendChild(node);if(node.attachEvent&&!(node.attachEvent.toString&&node.attachEvent.toString().indexOf('[native code')<0)&&!isOpera){node.attachEvent('onreadystatechange',function(e){onScriptLoad(e,url)})}else{node.addEventListener('load',function(e){onScriptLoad(e,url)},false)}config.modules[item]=url}else{(function poll(){if(++timeout>config.timeout*1000/4){return error(item+' is not a valid module','error')}(typeof config.modules[item]==='string'&&config.status[item])?onCallback():setTimeout(poll,4)}())}return that};Mbui.prototype.disuse=function(apps){var that=this;apps=that.isArray(apps)?apps:[apps];that.each(apps,function(index,item){if(!config.status[item]){}delete that[item];delete modules[item];delete that.modules[item];delete config.status[item];delete config.modules[item]});return that};Mbui.prototype.getStyle=function(node,name){var style=node.currentStyle?node.currentStyle:win.getComputedStyle(node,null);return style[style.getPropertyValue?'getPropertyValue':'getAttribute'](name)};Mbui.prototype.link=function(href,fn,cssname){var that=this;var head=doc.getElementsByTagName('head')[0];var link=doc.createElement('link');if(typeof fn==='string')cssname=fn;var app=(cssname||href).replace(/\.|\//g,'');var id='mbuicss-'+app;var STAUTS_NAME='creating';var timeout=0;link.href=href+(config.debug?'?v='+new Date().getTime():'');link.rel='stylesheet';link.id=id;link.media='all';if(!doc.getElementById(id)){head.appendChild(link)}if(typeof fn!=='function')return that;(function poll(status){var delay=100;var getLinkElem=doc.getElementById(id);if(++timeout>config.timeout*1000/delay){return error(href+' timeout')}if(parseInt(that.getStyle(getLinkElem,'width'))===1989){if(status===STAUTS_NAME)getLinkElem.removeAttribute('load-status');getLinkElem.getAttribute('load-status')===STAUTS_NAME?setTimeout(poll,delay):fn()}else{getLinkElem.setAttribute('load-status',STAUTS_NAME);setTimeout(function(){poll(STAUTS_NAME)},delay)}}());return that};Mbui.prototype.addcss=function(firename,fn,cssname){return mbui.link(config.dir+'css/'+firename,fn,cssname)};config.callback={};Mbui.prototype.factory=function(modName){if(mbui[modName]){return typeof config.callback[modName]==='function'?config.callback[modName]:null}};Mbui.prototype.config=function(options){options=options||{};for(var key in options){config[key]=options[key]}return this};Mbui.prototype.modules=function(){var clone={};for(var o in modules){clone[o]=modules[o]}return clone}();Mbui.prototype.extend=function(options){var that=this;options=options||{};for(var o in options){if(that[o]||that.modules[o]){error(o+' Module already exists','error')}else{that.modules[o]=options[o]}}return that};Mbui.prototype.router=Mbui.prototype.hash=function(hash){var that=this;var hash=hash||location.hash;var data={path:[],search:{},hash:(hash.match(/[^#](#.*$)/)||[])[1]||''};if(!/^#\//.test(hash))return data;hash=hash.replace(/^#\//,'');data.href='/'+hash;hash=hash.replace(/([^#])(#.*$)/,'$1').split('/')||[];that.each(hash,function(index,item){/^\w+=/.test(item)?function(){item=item.split('=');data.search[item[0]]=item[1]}():data.path.push(item)});return data};Mbui.prototype.url=function(href){var that=this;var data={pathname:function(){var pathname=href?function(){var str=(href.match(/\.[^.]+?\/.+/)||[])[0]||'';return str.replace(/^[^\/]+/,'').replace(/\?.+/,'')}():location.pathname;return pathname.replace(/^\//,'').split('/')}(),search:function(){var obj={};var search=(href?function(){var str=(href.match(/\?.+/)||[])[0]||'';return str.replace(/\#.+/,'')}():location.search).replace(/^\?+/,'').split('&');that.each(search,function(index,item){var _index=item.indexOf('='),key=function(){if(_index<0){return item.substr(0,item.length)}else if(_index===0){return false}else{return item.substr(0,_index)}}();if(key){obj[key]=_index>0?item.substr(_index+1):null}});return obj}(),hash:that.router(function(){return href?((href.match(/#.+/)||[])[0]||'/'):location.hash}())};return data};Mbui.prototype.each=function(obj,fn){var key;var that=this;var callFn=function(key,obj){return fn.call(obj[key],key,obj[key])};if(typeof fn!=='function')return that;obj=obj||[];if(that.isArray(obj)){for(key=0;key0?setTimeout(function(){location.reload()},e):location.reload()},replace:function(e,t){t&&t>0?setTimeout(function(){window.location.replace(e)},t):window.location.replace(e)},countdown:function(e){e=$.extend(!0,{date:new Date,now:new Date},e);var t=arguments;t.length>1&&(e.date=new Date(t[0]),e.now=new Date(t[1]),e.clock=t[2]);var n={options:e,clear:function(){clearTimeout(n.timer)},reload:function(e){this.clear(),$.extend(!0,this.options,{now:new Date},e),r()}};"function"==typeof e.ready&&e.ready();var r=function t(){var o,a=new Date(e.date),i=new Date(e.now),u=(o=a.getTime()-i.getTime())>0?o:0,c={d:Math.floor(u/864e5),h:Math.floor(u/36e5)%24,m:Math.floor(u/6e4)%60,s:Math.floor(u/1e3)%60};return n.timer=setTimeout(function(){i.setTime(i.getTime()+1e3),e.now=i,r()},1e3),"function"==typeof e.clock&&e.clock(c,n),u<=0&&(clearTimeout(n.timer),"function"==typeof e.done&&e.done(c,n)),t}();return n},timeAgo:function(e,t){var n=[[],[]],r=(new Date).getTime()-new Date(e).getTime();return r>26784e5?(r=new Date(e),n[0][0]=this.digit(r.getFullYear(),4),n[0][1]=this.digit(r.getMonth()+1),n[0][2]=this.digit(r.getDate()),t||(n[1][0]=this.digit(r.getHours()),n[1][1]=this.digit(r.getMinutes()),n[1][2]=this.digit(r.getSeconds())),n[0].join("-")+" "+n[1].join(":")):r>=864e5?(r/1e3/60/60/24|0)+" 天前":r>=36e5?(r/1e3/60/60|0)+" 小时前":r>=18e4?(r/1e3/60|0)+" 分钟前":r<0?"未来":"刚刚"},toDateString:function(e,t,n){if(null===e||""===e)return"";var r=this,o=new Date(function(){if(e)return isNaN(e)?e:"string"==typeof e?parseInt(e):e}()||new Date);if(!o.getDate())return console.log('Invalid millisecond for "tool.toDateString(millisecond)"');var a=o.getFullYear(),i=o.getMonth(),u=o.getDate(),c=o.getHours(),s=o.getMinutes(),f=o.getSeconds(),l=o.getMilliseconds(),d=n&&n.customMeridiem||function(e,t){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1100?"上午":n<1300?"中午":n<1800?"下午":"晚上"},g={yy:function(){return String(a).slice(-2)},yyyy:function(){return r.digit(a,4)},M:function(){return String(i+1)},MM:function(){return r.digit(i+1)},d:function(){return String(u)},dd:function(){return r.digit(u)},H:function(){return String(c)},HH:function(){return r.digit(c)},h:function(){return String(c%12||12)},hh:function(){return r.digit(c%12||12)},A:function(){return d(c,s)},m:function(){return String(s)},mm:function(){return r.digit(s)},s:function(){return String(f)},ss:function(){return r.digit(f)},SSS:function(){return r.digit(l,3)}};return(t=t||"yyyy-MM-dd HH:mm:ss").replace(/\[([^\]]+)]|y{1,4}|M{1,2}|d{1,2}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|SSS/g,function(e,t){return t||g[e]&&g[e]()||e})},time:function(){return Math.floor((new Date).getTime()/1e3)},date:function(e,t){var n,r,o=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],a=/\\?(.?)/gi,i=function(e,t){return r[e]?r[e]():t},u=function(e,t){for(e=String(e);e.length9?-1:0)},Y:function(){return n.getFullYear()},y:function(){return r.Y().toString().slice(-2)},a:function(){return n.getHours()>11?"pm":"am"},A:function(){return r.a().toUpperCase()},B:function(){var e=3600*n.getUTCHours(),t=60*n.getUTCMinutes(),r=n.getUTCSeconds();return u(Math.floor((e+t+r+3600)/86.4)%1e3,3)},g:function(){return r.G()%12||12},G:function(){return n.getHours()},h:function(){return u(r.g(),2)},H:function(){return u(r.G(),2)},i:function(){return u(n.getMinutes(),2)},s:function(){return u(n.getSeconds(),2)},u:function(){return u(1e3*n.getMilliseconds(),6)},e:function(){throw new Error("Not supported (see source code of date() for timezone on how to add support)")},I:function(){return new Date(r.Y(),0)-Date.UTC(r.Y(),0)!=new Date(r.Y(),6)-Date.UTC(r.Y(),6)?1:0},O:function(){var e=n.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+u(100*Math.floor(t/60)+t%60,4)},P:function(){var e=r.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-n.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(a,i)},r:function(){return"D, d M Y H:i:s O".replace(a,i)},U:function(){return n/1e3|0}},function(e,t){return n=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),e.replace(a,i)}(e,t)},strtotime:function(e,t){var n,r,o,a,i,u,c,s,f,l;if(!e)return!1;if((r=(e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase()).match(/^(\d{1,4})([\-\.\/\:])(\d{1,2})([\-\.\/\:])(\d{1,4})(?:\s(\d{1,2}):(\d{2})?:?(\d{2})?)?(?:\s([A-Z]+)?)?$/))&&r[2]===r[4])if(r[1]>1901)switch(r[2]){case"-":return!(r[3]>12||r[5]>31)&&new Date(r[1],parseInt(r[3],10)-1,r[5],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3;case".":return!1;case"/":return!(r[3]>12||r[5]>31)&&new Date(r[1],parseInt(r[3],10)-1,r[5],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3}else if(r[5]>1901)switch(r[2]){case"-":case".":return!(r[3]>12||r[1]>31)&&new Date(r[5],parseInt(r[3],10)-1,r[1],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3;case"/":return!(r[1]>12||r[3]>31)&&new Date(r[5],parseInt(r[1],10)-1,r[3],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3}else switch(r[2]){case"-":return!(r[3]>12||r[5]>31||r[1]<70&&r[1]>38)&&(a=r[1]>=0&&r[1]<=38?+r[1]+2e3:r[1],new Date(a,parseInt(r[3],10)-1,r[5],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3);case".":return r[5]>=70?!(r[3]>12||r[1]>31)&&new Date(r[5],parseInt(r[3],10)-1,r[1],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3:r[5]<60&&!r[6]&&(!(r[1]>23||r[3]>59)&&(o=new Date,new Date(o.getFullYear(),o.getMonth(),o.getDate(),r[1]||0,r[3]||0,r[5]||0,r[9]||0)/1e3));case"/":return!(r[1]>12||r[3]>31||r[5]<70&&r[5]>38)&&(a=r[5]>=0&&r[5]<=38?+r[5]+2e3:r[5],new Date(a,parseInt(r[1],10)-1,r[3],r[6]||0,r[7]||0,r[8]||0,r[9]||0)/1e3);case":":return!(r[1]>23||r[3]>59||r[5]>59)&&(o=new Date,new Date(o.getFullYear(),o.getMonth(),o.getDate(),r[1]||0,r[3]||0,r[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3|0:0|t;if(!isNaN(n=Date.parse(e)))return n/1e3|0;function d(e){var t=e.split(" "),n=t[0],r=t[1].substring(0,3),o=/\d+/.test(n),a=("last"===n?-1:1)*("ago"===t[2]?-1:1);if(o&&(a*=parseInt(n,10)),c.hasOwnProperty(r)&&!t[1].match(/^mon(day|\.)?$/i))return i["set"+c[r]](i["get"+c[r]]()+a);if("wee"===r)return i.setDate(i.getDate()+7*a);if("next"===n||"last"===n)!function(e,t,n){var r,o=u[t];void 0!==o&&(0==(r=o-i.getDay())?r=7*n:r>0&&"last"===e?r-=7:r<0&&"next"===e&&(r+=7),i.setDate(i.getDate()+r))}(n,r,a);else if(!o)return!1;return!0}if(i=t?new Date(1e3*t):new Date,u={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},c={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},"([+-]?\\d+\\s"+(f="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)")+"|(last|next)\\s"+f+")(\\sago)?",!(r=e.match(new RegExp("([+-]?\\d+\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)|(last|next)\\s(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?))(\\sago)?","gi"))))return!1;for(l=0,s=r.length;l=0},timeline:function(e){var t=new Date,n=new Date(1e3*e),r=t.getTime()-n.getTime();return r<=0&&(r=1e3),r<6e4?Math.floor(r/1e3)+"秒前":r<36e5?Math.floor(r/6e4)+"分钟前":r<864e5?Math.floor(r/36e5)+"小时前":r<6048e5?Math.floor(r/864e5)+"天前":r<338688e5?Math.floor(r/6048e5)+"周前":Math.floor(r/314496e5)+"年前"},getFirstNowLastDay:function(e){var t=e?new Date(e):new Date,n=t.getFullYear(),r=t.getMonth()+1,o=t.getDate();r>=1&&r<=9&&(r="0"+r),o>=1&&o<=9&&(o="0"+o);var a=n+"-"+r;return[n+"-"+r+"-01",n+"-"+r+"-"+o,n+"-"+r+"-"+this.getLastDay(n,r),a]},getLastDay:function(e,t){var n=e,r=t++;return t>12&&(r-=12,n++),new Date(n,r,0).getDate()},array_keys:function(e,t,n){var r=void 0!==t,o=[],a=!!n,i=!0,u="";for(u in e)e.hasOwnProperty(u)&&(i=!0,r&&(a&&e[u]!==t?i=!1:e[u]!==t&&(i=!1)),i&&(o[o.length]=u));return o},array_values:function(e){var t=[],n="";for(n in e)t[t.length]=e[n];return t},array_unique:function(e){var t="",n={},r="";for(t in e)e.hasOwnProperty(t)&&(!1===function(e,t){var n="";for(n in t)if(t.hasOwnProperty(n)&&t[n]+""==e+"")return n;return!1}(r=e[t],n)&&(n[t]=r));return n},array_slice:function(e,t,n,r){var o="";if("[object Array]"!==Object.prototype.toString.call(e)||r&&0!==t){var a=0,i={};for(o in e)a+=1,i[o]=e[o];e=i,t=t<0?a+t:t,n=void 0===n?a:n<0?a+n-t:n;var u={},c=!1,s=-1,f=0,l=0;for(o in e){if(++s,f>=n)break;s===t&&(c=!0),c&&(++f,is_int(o)&&!r?u[l++]=e[o]:u[o]=e[o])}return u}return void 0===n?e.slice(t):n>=0?e.slice(t,t+n):e.slice(t,n)},array_search:function(e,t,n){var r=!!n,o="";if("object"==typeof e&&e.exec){if(!r){var a="i"+(e.global?"g":"")+(e.multiline?"m":"")+(e.sticky?"y":"");e=new RegExp(e.source,a)}for(o in t)if(t.hasOwnProperty(o)&&e.test(t[o]))return o;return!1}for(o in t)if(t.hasOwnProperty(o)&&(r&&t[o]===e||!r&&t[o]==e))return o;return!1},is_array:function(e){if(!e||"object"!=typeof e)return!1;if(function(e){if(!e||"object"!=typeof e||"number"!=typeof e.length)return!1;var t=e.length;return e[e.length]="bogus",t!==e.length?(e.length-=1,!0):(delete e[e.length],!1)}(e))return!0;var t=Object.prototype.toString.call(e),n=function(e){var t=/\W*function\s+([\w$]+)\s*\(/.exec(e);return t?t[1]:"(Anonymous)"}(e.constructor);return"[object Object]"===t&&"Object"===n},in_array:function(e,t,n){var r="";if(n){for(r in t)if(t[r]===e)return!0}else for(r in t)if(t[r]==e)return!0;return!1},sort:function(e,t,n=!0){var r=[],o="",a=0,i=!1,u=[];switch(t){case"SORT_STRING":i=function(e,t){return strnatcmp(e,t)};break;case"SORT_NUMERIC":i=function(e,t){return e-t};break;default:i=function(e,t){var n=parseFloat(e),r=parseFloat(t),o=n+""===e,a=r+""===t;return o&&a?n>r?1:nt?1:ee.length&&error("Error","Invalid"),o.push(a),a=e.slice(t+(r-1),t+r),r+=1;return[o.length,o.join("")]},read_chrs=function(e,t,r){var o,a,i;for(i=[],o=0;oe.length?Array(t-e.length+1).join("0")+e:e},o="undefined"!=typeof window?window:global;o.$locutus=o.$locutus||{};var a=o.$locutus;return a.php=a.php||{},a.php.uniqidSeed||(a.php.uniqidSeed=Math.floor(123456789*Math.random())),a.php.uniqidSeed++,n=e,n+=r(parseInt((new Date).getTime()/1e3,10),8),n+=r(a.php.uniqidSeed,5),t&&(n+=(10*Math.random()).toFixed(8).toString()),n},intval:function(e,t){var n,r,o=typeof e;return"boolean"===o?+e:"string"===o?(0===t&&(t=(r=e.match(/^\s*0(x?)/i))?r[1]?16:8:10),n=parseInt(e,t||10),isNaN(n)||!isFinite(n)?0:n):"number"===o&&isFinite(e)?e<0?Math.ceil(e):Math.floor(e):0},floatval:function(e){return parseFloat(e)||0},log:function(e){console.log(e)},trim:function(e,t){var n=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","​","\u2028","\u2029"," "].join(""),r=0,o=0;for(e+="",t&&(n=(t+"").replace(/([[\]().?\/*{}+$^:])/g,"$1")),r=e.length,o=0;o=0;o--)if(-1===n.indexOf(e.charAt(o))){e=e.substring(0,o+1);break}return-1===n.indexOf(e.charAt(0))?e:""},rtrim:function(e,t){return t=t?(t+"").replace(/([[\]().?\/*{}+$^:])/g,"\\$1"):" \\s ",(e+"").replace(new RegExp("["+t+"]+$","g"),"")},ltrim:function(e,t){return t=t?(t+"").replace(/([[\]().?\/*{}+$^:])/g,"$1"):" \\s ",(e+"").replace(new RegExp("^["+t+"]+","g"),"")},strtrim:function(e){return e.replace(/\s+/g," ")},str_replace:function(e,t,n,r){var o,a=0,i=0,u="",c="",s=0,f=[].concat(e),l=[].concat(t),d=n,g="[object Array]"===Object.prototype.toString.call(l),p="[object Array]"===Object.prototype.toString.call(d);d=[].concat(d);var h="undefined"!=typeof window?window:global;h.$locutus=h.$locutus||{};var w=h.$locutus;if(w.php=w.php||{},"object"==typeof e&&"string"==typeof t){for(u=t,t=[],a=0;a/g)||[]).join("");return e.replace(/|<\?(?:php)?[\s\S]*?\?>/gi,"").replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""})},ucfirst:function(e){return(e+="").charAt(0).toUpperCase()+e.substr(1)},htmlencode:function(e){return function(e,t,n,r){var o=0,a=0,i=!1;null==t&&(t=2),e=e.toString(),!1!==r&&(e=e.replace(/&/g,"&")),e=e.replace(//g,">");var u={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(i=!0),"number"!=typeof t){for(t=[].concat(t),a=0;a");var a={ENT_NOQUOTES:0,ENT_HTML_QUOTE_SINGLE:1,ENT_HTML_QUOTE_DOUBLE:2,ENT_COMPAT:2,ENT_QUOTES:3,ENT_IGNORE:4};if(0===t&&(o=!0),"number"!=typeof t){for(t=[].concat(t),r=0;r]|&(?=#[a-zA-Z0-9]+)/g.test(e+="")?e.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,"""):e},unescape:function(e){return null==e&&(e=""),(e+="").replace(/\&/g,"&").replace(/\</g,"<").replace(/\>/g,">").replace(/\'/g,"'").replace(/\"/g,'"')},base64_decode:function(e){var t=function(e){return decodeURIComponent(e.split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))};if("undefined"==typeof window)return new Buffer(e,"base64").toString("utf-8");if(void 0!==window.atob)return t(window.atob(e));var n,r,o,a,i,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,f=0,l=[];if(!e)return e;e+="";do{n=(u=c.indexOf(e.charAt(s++))<<18|c.indexOf(e.charAt(s++))<<12|(a=c.indexOf(e.charAt(s++)))<<6|(i=c.indexOf(e.charAt(s++))))>>16&255,r=u>>8&255,o=255&u,l[f++]=64===a?String.fromCharCode(n):64===i?String.fromCharCode(n,r):String.fromCharCode(n,r,o)}while(s>18&63,r=i>>12&63,o=i>>6&63,a=63&i,l[s++]=u.charAt(n)+u.charAt(r)+u.charAt(o)+u.charAt(a)}while(c1&&void 0!==arguments[1]&&arguments[1])){for(var t=[],n=0;n255&&++o;return n=n||"",(o-t==1?e.substr(0,r-1):e.substr(0,r))+n},strfind:function(e,t){return!(-1===e.indexOf(t))},is_num:function(e){return new RegExp("^[0-9]*$").test(e)},is_mobile:function(e){return/^1\d{10}$/.test(e)},is_qq:function(e){return/^[1-utf8_decode]{1}\d{4,11}$/.test(e)},is_email:function(e){return/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(e)},is_chinese:function(e){return/[\u4e00-\u9fa5]/g.test(e)},is_reg:function(e){return/^([a-zA-z_]{1})([\w]*)$/g.test(e)},is_tel:function(e){return/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/.test(e)},is_ip:function(e){if(isNull(e))return!1;return!!(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g.test(e)&&RegExp.$1<256&&RegExp.$2<256&&RegExp.$3<256&&RegExp.$4<256)},is_zipcode:function(e){return/^(\d){6}$/.test(e)},is_english:function(e){return/^[A-Za-z]+$/.test(e)},is_url:function(e){return new RegExp(/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/).test(e)},is_http:function(e){return-1!==e.indexOf("http://")||-1!==e.indexOf("https://")},is_money:function(e){return!!/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(e)},is_CardNumber:function(e){return e.toString().replace(/\s/g,"").replace(/(.{4})/g,"$1 ")},is_IDCard:function(e){for(var t=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],n=e+"",r=e[17],o=n.substring(0,17).split(""),a=o.length,i=0,u=0;uparseInt(n))))},in_float:function(e,t,n){return!!isFinite(e)&&(!(null!=t&&parseFloat(e)parseFloat(n)))},number_format:function(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,i=void 0===r?",":r,u=void 0===n?".":n,c="";return(c=(a?function(e,t){if(-1===(""+e).indexOf("e"))return+(Math.round(e+"e+"+t)+"e-"+t);var n=(""+e).split("e"),r="";return+n[1]+t>0&&(r="+"),(+(Math.round(+n[0]+"e"+r+(+n[1]+t))+"e-"+t)).toFixed(t)}(o,a).toString():""+Math.round(o)).split("."))[0].length>3&&(c[0]=c[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(c[1]||"").length0;i++){for(var c="",s=0;s0;s++)c=r[e%10]+o[1][s]+c,e=Math.floor(e/10);u=c.replace(/(零.)*零$/,"").replace(/^$/,"零")+o[0][i]+u}return 1==t?a+u.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零").replace(/^整$/,"零元整"):u.replace(/(零.)*零元/,"元").replace(/(零.)+/g,"零").replace(/^整$/,"零元整")},hidebank:function(e="6217995510035399947"){return e.replace(/^(\d{8})\d+(\d{4})$/,"$1*******$2")},hidemobile:function(e="18291447788"){return e.replace(/^(\d{3})\d+(\d{4})$/,"$1****$2")},addcss:function(e){var t=document.createElement("style"),n=document.head||document.getElementsByTagName("head")[0];if(t.type="text/css",t.styleSheet){var r=function(){try{t.styleSheet.cssText=e}catch(e){}};t.styleSheet.disabled?setTimeout(r,10):r()}else{var o=document.createTextNode(e);t.appendChild(o)}n.appendChild(t)},addjs:function(e){var t=document.createElement("script");t.type="text/javascript";try{t.appendChild(document.createTextNode(e))}catch(n){t.text=e}document.head.appendChild(t)},loadjs:function(e,t){var n=document.createElement("script");n.src=e,n.onload=function(){var e=n.readyState&&"complete"!=n.readyState&&"loaded"!=n.readyState;t&&t(!e)},document.head.appendChild(n)},loadcss:function(e,t){var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onerror=function(){t(!1)},n.onload=function(){t(!0)},n.href=e,document.head.appendChild(n)},gethost:function(){return window.location.protocol+"//"+window.location.host},distance:function(e,t){var n=e.lat*Math.PI/180,r=t.lat*Math.PI/180,o=n-r,a=e.lng*Math.PI/180-t.lng*Math.PI/180,i=2*Math.asin(Math.sqrt(Math.pow(Math.sin(o/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(a/2),2)));return i*=6378.137,(i=Math.round(1e4*i)/1e4).toFixed(2)},setCookie:function(e,t,n){var r=new Date;r.setDate(r.getDate()+n),document.cookie=e+"="+t+";expires="+r},getCookie:function(e){for(var t=document.cookie.split("; "),n=0;n