var haoutil=haoutil||{};haoutil.version="2.3",haoutil.name="通用常用js方法类库",haoutil.author=" https://github.com/muyao1987/haoutil",haoutil.msg=function(t){window.toastr?toastr.info(t):window.layer?layer.msg(t):alert(t)},haoutil.tip=haoutil.msg,haoutil.onemsg=function(t,e){haoutil.storage.get(e)||(haoutil.msg(t),haoutil.storage.add(e,!0))},haoutil.alert=function(t,e){window.layer?layer.alert(t,{title:e||"提示",skin:"layui-layer-lan layer-mars-dialog",closebtn:0,anim:0}):alert(t)},haoutil.loading={index:-1,show:function(t){this.close(),window.nprogress?(t=t||{},t.color?t.template='
':t.template='
',nprogress.configure(t),nprogress.start()):window.layer&&(this.index=layer.load(2,{shade:[.3,"#000000"]}))},hide:function(){this.close()},close:function(){window.nprogress?nprogress.done(!0):window.layer&&(this.index!=-1&&layer.close(this.index),this.index=-1)}},window.noarrayprototype||(array.prototype.indexof=array.prototype.indexof||function(t){for(var e=0;e1?regexp.$1.length>2?"星期":"周":"")+n[this.getday()+""]));for(var r in e)new regexp("("+r+")").test(t)&&(t=t.replace(regexp.$1,1==regexp.$1.length?e[r]:("00"+e[r]).substr((""+e[r]).length)));return t},haoutil.color=function(){function t(){return"#"+function(t){return(t+="0123456789abcdef"[math.floor(16*math.random())])&&6==t.length?t:arguments.callee(t)}("")}return{random:t}}(),haoutil.cookie=function(){function t(t){o=t}function e(t,e,n){var r;n>0?(r=new date,r.settime(r.gettime+24*n*60*60*1e3)):r=new date(2147483647e3);var i=t+"="+escape(e)+"; expires="+r.togmtstring();o&&null!=window.plus?plus.navigator.setcookie(t,i):document.cookie=i}function n(t){var e;if(o&&null!=window.plus){if(e=plus.navigator.getcookie(t),null==e)return null}else e=document.cookie;for(var n=e.split("; "),r=0;r=60&&t<3600?math.floor(t/60)+"分钟"+math.floor(t%60)+"秒":(t=math.floor(t/60),math.floor(t/60)+"小时"+math.floor(t%60)+"分钟")}function o(t){for(var e="",n=t.length%6,r=t.substr(0,t.length-n),o=t.substr(t.length-n,n),i=0;i=0){var e=number(t.match(/msie ([\d]+)/)[1]);return{type:"ie",version:e}}if(t.indexof("firefox")>=0){var e=number(t.match(/firefox\/([\d]+)/)[1]);return{type:"firefox",version:e}}if(t.indexof("chrome")>=0){var e=number(t.match(/chrome\/([\d]+)/)[1]);return{type:"chrome",version:e}}if(t.indexof("opera")>=0){var e=number(t.match(/opera.([\d]+)/)[1]);return{type:"opera",version:e}}if(t.indexof("safari")>=0){var e=number(t.match(/version\/([\d]+)/)[1]);return{type:"safari",version:e}}return{type:t,version:-1}}function o(){var t=navigator.useragent.tolowercase(),e="ipad"==t.match(/ipad/i),n="iphone"==t.match(/iphone/i),r="midp"==t.match(/midp/i),o="rv:1.2.3.4"==t.match(/rv:1.2.3.4/i),i="ucweb"==t.match(/ucweb/i),a="android"==t.match(/android/i),u="windows ce"==t.match(/windows ce/i),s="windows mobile"==t.match(/windows mobile/i);return!(e||n||r||o||i||a||u||s)}function i(t){if(null==t||"object"!=typeof t)return t;if(t instanceof date){var e=new date;return e.settime(t.gettime()),e}if(t instanceof array){for(var e=[],n=0,r=t.length;n