function showMsg(e,t){"add"==e?swal("Added!",t,"success"):"update"==e?swal("Updated!",t,"success"):"deleted"==e?swal("Deleted!",t,"success"):"success"==e?swal({title:"Success!",text:t,html:!0,type:"success"}):swal({title:"Error!",text:t,html:!0,type:"error"})}function ajaxRequest(e,t,r,o,i){jQuery.ajax({url:baseURL+e,type:t,dataType:r,data:o}).done(function(e){i(e)}).fail(function(e){var e=JSON.parse(e.responseText),t="",showMsg("error",t)}).always(function(){})}function getDetailsByAttr(e,t,r){var o=[];for(var i in e)e.hasOwnProperty(i)&&("object"==typeof e[i]?o=o.concat(getDetailsByAttr(e[i],t,r)):i==t&&e[t]==r&&o.push(e));return o}function validateForm(e){e.validate({errorElement:"span",errorClass:"help-inline",focusInvalid:!1,rules:{},messages:{}})}function uniqId(e){return e+Math.round((new Date).getTime()+1e13*Math.random())}function sort_value_layer(e,t){return e.ordert.order?1:0}function isGoogle(){return"undefined"!=typeof map&&92==map.id||1==googleMapsDefault}!function(e){e.fn.extend({slimScroll:function(r){var o=e.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},r);return this.each(function(){function i(t){if(u){t=t||window.event;var r=0;t.wheelDelta&&(r=-t.wheelDelta/120),t.detail&&(r=t.detail/3),e(t.target||t.srcTarget||t.srcElement).closest("."+o.wrapperClass).is(y.parent())&&n(r,!0),t.preventDefault&&!b&&t.preventDefault(),b||(t.returnValue=!1)}}function n(e,t,r){b=!1;var i=y.outerHeight()-m.outerHeight();t&&(t=parseInt(m.css("top"))+e*parseInt(o.wheelStep)/100*m.outerHeight(),t=Math.min(Math.max(t,0),i),t=0=y.outerHeight()?b=!0:(m.stop(!0,!0).fadeIn("fast"),o.railVisible&&x.stop(!0,!0).fadeIn("fast"))}function l(){o.alwaysVisible||(f=setTimeout(function(){o.disableFadeOut&&u||c||p||(m.fadeOut("slow"),x.fadeOut("slow"))},1e3))}var u,c,p,f,h,d,g,v,b=!1,y=e(this);if(y.parent().hasClass(o.wrapperClass)){var w=y.scrollTop(),m=y.siblings("."+o.barClass),x=y.siblings("."+o.railClass);if(a(),e.isPlainObject(r)){if("height"in r&&"auto"==r.height){y.parent().css("height","auto"),y.css("height","auto");var S=y.parent().parent().height();y.parent().css("height",S),y.css("height",S)}else"height"in r&&(S=r.height,y.parent().css("height",S),y.css("height",S));if("scrollTo"in r)w=parseInt(o.scrollTo);else if("scrollBy"in r)w+=parseInt(o.scrollBy);else if("destroy"in r)return m.remove(),x.remove(),void y.unwrap();n(w,!1,!0)}}else if(!(e.isPlainObject(r)&&"destroy"in r)){o.height="auto"==o.height?y.parent().height():o.height,w=e("
").addClass(o.wrapperClass).css({position:"relative",overflow:"hidden",width:o.width,height:o.height}),y.css({overflow:"hidden",width:o.width,height:o.height});var x=e("
").addClass(o.railClass).css({width:o.size,height:"100%",position:"absolute",top:0,display:o.alwaysVisible&&o.railVisible?"block":"none","border-radius":o.railBorderRadius,background:o.railColor,opacity:o.railOpacity,zIndex:90}),m=e("
").addClass(o.barClass).css({background:o.color,width:o.size,position:"absolute",top:0,opacity:o.opacity,display:o.alwaysVisible?"block":"none","border-radius":o.borderRadius,BorderRadius:o.borderRadius,MozBorderRadius:o.borderRadius,WebkitBorderRadius:o.borderRadius,zIndex:99}),S="right"==o.position?{right:o.distance}:{left:o.distance};x.css(S),m.css(S),y.wrap(w),y.parent().append(m),y.parent().append(x),o.railDraggable&&m.bind("mousedown",function(r){var o=e(document);return p=!0,t=parseFloat(m.css("top")),pageY=r.pageY,o.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,m.css("top",currTop),n(0,m.position().top,!1)}),o.bind("mouseup.slimscroll",function(e){p=!1,l(),o.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(e){return e.stopPropagation(),e.preventDefault(),!1}),x.hover(function(){s()},function(){l()}),m.hover(function(){c=!0},function(){c=!1}),y.hover(function(){u=!0,s(),l()},function(){u=!1,l()}),y.bind("touchstart",function(e,t){e.originalEvent.touches.length&&(h=e.originalEvent.touches[0].pageY)}),y.bind("touchmove",function(e){b||e.originalEvent.preventDefault(),e.originalEvent.touches.length&&(n((h-e.originalEvent.touches[0].pageY)/o.touchScrollStep,!0),h=e.originalEvent.touches[0].pageY)}),a(),"bottom"===o.start?(m.css({top:y.outerHeight()-m.outerHeight()}),n(0,!0)):"top"!==o.start&&(n(e(o.start).position().top,null,!0),o.alwaysVisible||m.hide()),window.addEventListener?(this.addEventListener("DOMMouseScroll",i,!1),this.addEventListener("mousewheel",i,!1)):document.attachEvent("onmousewheel",i)}}),this}}),e.fn.extend({slimscroll:e.fn.slimScroll})}(jQuery),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function this_value(){return this.valueOf()}function quote(e){return rx_escapable.lastIndex=0,rx_escapable.test(e)?'"'+e.replace(rx_escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var r,o,i,n,a,s=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(n=l.length,r=0;r