var util={trim:function(e,r){if(!e)return"";if(r)return e.replace(/\s/g,"");return e.replace(/(^\s*)|(\s*$)/g,"")},getParamByName:function(e){var r=location.search.substring(1);var n="";if(r){var t=r.split("&");for(var a=0;a<t.length;a++){var o=t[a].indexOf("=");var i=t[a].substring(0,o);var c=t[a].substring(o+1);if(i===e){n=c;break}}}return n},jsonToString:function(e){var r=this;switch(typeof e){case"string":return'"'+e.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+e.map(r.jsonToString).join(",")+"]";case"object":if(e instanceof Array){var n=[];var t=e.length;for(var a=0;a<t;a++){n.push(r.jsonToString(e[a]))}return"["+n.join(",")+"]"}else if(e===null){return"null"}else{var o=[];for(var i in e)o.push(r.jsonToString(i)+":"+r.jsonToString(e[i]));return"{"+o.join(",")+"}"}case"number":return e;case false:return e}},stringToJSON:function(obj){obj=eval("("+obj+")");return obj},jsonFilter:function(e){e=e.replace(/\r\n|\n|\r|\t/g,"");e=e.replace(/<\/?[^>]*>/g,"");e=e.replace(/[ | ]*\n/g,"\n");e=e.replace(/\n[\s| | ]*\r/g,"\n");e=e.replace(/&nbsp;/gi,"");e=e.replace(/&quot;/gi,'"');return e},inputFilter:function(e){e=e.replace(/&/g,"&amp;");e=e.replace(/\"/gi,"&quot;");e=e.replace(/>/g,"&gt;");e=e.replace(/</g,"&lt;");e=e.replace(/ /g,"&nbsp;");return e},urlFilter:function(e){e=e.replace(/%/g,"%25");e=e.replace(/\+/g,"%20");e=e.replace(/\//g,"%2F");e=e.replace(/\?/g,"%3F");e=e.replace(/#/g,"%23");e=e.replace(/&/g,"%26");return e},setCookie:function(e,r){var n=new Date;n.setTime(n.getTime()+365*24*60*60*1e3);document.cookie=e+"="+encodeURI(r)+";expires="+n.toGMTString()+"path=/"},addCookie:function(e,r,n){var t=new Date;t.setTime(t.getTime()+1e3*60*n);document.cookie=e+"="+encodeURI(r)+";expires="+t.toGMTString()+"path=/"},getCookie:function(e){var r,n=new RegExp("(^| )"+e+"=([^;]*)(;|$)");r=document.cookie.match(n);if(r[2])return decodeURI(r[2]);else return null},delCookie:function(e){var r=new Date;r.setTime(r.getTime()-1e4);document.cookie=e+"=a;path=/;expires="+r.toGMTString()},stopEventBubble:function(e){var r=e||window.event;if(r&&r.stopPropagation){r.stopPropagation()}else{r.cancelBubble=true}},backTop:function(){$("body,html").animate({scrollTop:0},500)},removeMask:function(){$("#loading").remove()},showMask:function(e){var r='<div id="loading" style="position: fixed;'+"background: black url(img/loading.gif) no-repeat center center;"+"left: 0;top: 0;width: 100%;height: 100%;opacity: 0.8;z-index: 99999;"+'text-align: center;color:dodgerblue;font-size:40px;">'+(e?e:"")+"</div>";$(document.body).append($(r))},onlyNumber:function(e){var r=e.value.charAt(0);e.value=e.value.replace(/[^\d\.]/g,"");e.value=e.value.replace(/^\./g,"");e.value=e.value.replace(/\.{2, }/g,".");e.value=e.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".")}};