/*! layer-v1.9.3 弹层组件 License LGPL http://layer.layui.com/ By 贤心 */!function(m,n){var g,k,h={getPath:function(){var b=document.scripts,b=b[b.length-1],a=b.src;if(!b.getAttribute("merge"))return a.substring(0,a.lastIndexOf("/")+1)}(),config:{},end:{},btn:["\x26#x786E;\x26#x5B9A;","\x26#x53D6;\x26#x6D88;"],type:["dialog","page","iframe","loading","tips"]};m.layer={v:"1.9.3",ie6:!!m.ActiveXObject&&!m.XMLHttpRequest,index:0,path:h.getPath,config:function(b,a){var d=0;return b=b||{},layer.cache=h.config=g.extend(h.config,b),layer.path=h.config.path||layer.path,"string"==typeof b.extend&&(b.extend=[b.extend]),layer.use("skin/layer.css",b.extend&&0b;b++)a+='\x3ca class\x3d"'+e[6]+b+'"\x3e'+c.btn[b]+"\x3c/a\x3e";return'\x3cdiv class\x3d"'+e[6]+'"\x3e'+a+"\x3c/div\x3e"}():"")+"\x3c/div\x3e"],g),this};l.pt.creat=function(){var b=this,a=b.config,d=b.index,c=a.content,f="object"==typeof c;switch("string"==typeof a.area&&(a.area="auto"===a.area?["",""]:[a.area,""]),a.type){case 0:a.btn="btn"in a?a.btn:h.btn[0];layer.closeAll("dialog");break;case 2:c=a.content=f?a.content:[a.content||"http://sentsin.com?from\x3dlayer","auto"];a.content='\x3ciframe scrolling\x3d"'+(a.content[1]||"auto")+'" allowtransparency\x3d"true" id\x3d"'+e[4]+d+'" name\x3d"'+e[4]+d+'" onload\x3d"this.className\x3d\'\';" class\x3d"layui-layer-load" frameborder\x3d"0" src\x3d"'+a.content[0]+'"\x3e\x3c/iframe\x3e';break;case 3:a.title=!1;a.closeBtn=!1;-1===a.icon&&0===a.icon;layer.closeAll("loading");break;case 4:f||(a.content=[a.content,"body"]),a.follow=a.content[1],a.content=a.content[0]+'\x3ci class\x3d"layui-layer-TipsG"\x3e\x3c/i\x3e',a.title=!1,a.shade=!1,a.fix=!1,a.tips="object"==typeof a.tips?a.tips:[a.tips,!0],a.tipsMore||layer.closeAll("tips")}b.vessel(f,function(h,k){g("body").append(h[0]);f?2==a.type||4==a.type?g("body").append(h[1]):c.parents("."+e[0])[0]||(c.show().addClass("layui-layer-wrap").wrap(h[1]),g("#"+e[0]+d).find("."+e[5]).before(k)):g("body").append(h[1]);b.layero=g("#"+e[0]+d);a.scrollbar||e.html.css("overflow","hidden").attr("layer-full",d)}).auto(d);2==a.type&&layer.ie6&&b.layero.find("iframe").attr("src",c[0]);4==a.type?b.tips():b.offset();a.fix&&k.on("resize",function(){b.offset();(/^\d+%$/.test(a.area[0])||/^\d+%$/.test(a.area[1]))&&b.auto(d);4==a.type&&b.tips()});0>=a.time||setTimeout(function(){layer.close(b.index)},a.time);b.move().callback()};l.pt.auto=function(b){function a(a){a=c.find(a);a.height(f[1]-h-l-2*(0|parseFloat(a.css("padding"))))}var d=this.config,c=g("#"+e[0]+b);""===d.area[0]&&0d.maxWidth&&c.width(d.maxWidth));var f=[c.innerWidth(),c.innerHeight()],h=c.find(e[1]).outerHeight()||0,l=c.find("."+e[6]).outerHeight()||0;switch(d.type){case 2:a("iframe");break;default:""===d.area[1]?d.fix&&f[1]>k.height()&&(f[1]=k.height(),a("."+e[5])):a("."+e[5])}return this};l.pt.offset=function(){var b=this.config,a=this.layero,d=[a.outerWidth(),a.outerHeight()],c="object"==typeof b.offset;this.offsetTop=(k.height()-d[1])/2;this.offsetLeft=(k.width()-d[0])/2;c?(this.offsetTop=b.offset[0],this.offsetLeft=b.offset[1]||this.offsetLeft):"auto"!==b.offset&&(this.offsetTop=b.offset,"rb"===b.offset&&(this.offsetTop=k.height()-d[1],this.offsetLeft=k.width()-d[0]));b.fix||(this.offsetTop=/%$/.test(this.offsetTop)?k.height()*parseFloat(this.offsetTop)/100:parseFloat(this.offsetTop),this.offsetLeft=/%$/.test(this.offsetLeft)?k.width()*parseFloat(this.offsetLeft)/100:parseFloat(this.offsetLeft),this.offsetTop+=k.scrollTop(),this.offsetLeft+=k.scrollLeft());a.css({top:this.offsetTop,left:this.offsetLeft})};l.pt.tips=function(){var b=this.config,a=this.layero,d=[a.outerWidth(),a.outerHeight()],c=g(b.follow);c[0]||(c=g("body"));var f={width:c.outerWidth(),height:c.outerHeight(),top:c.offset().top,left:c.offset().left},h=a.find(".layui-layer-TipsG"),c=b.tips[0];b.tips[1]||h.remove();f.autoLeft=function(){0f.top-(k.scrollTop()+d[1]+16)&&f.where[2]():2===c?0d&&(d=0);d>c&&(d=c);g>e&&(e=g);e>k.height()-a.move.outerHeight()+a.setY&&(e=k.height()-a.move.outerHeight()+a.setY)}a.move.css({left:d,top:e});b.moveType&&a.moveLayer()}}).mouseup(function(){try{a.ismove&&(a.moveLayer(),a.move.remove()),a.ismove=!1}catch(c){a.ismove=!1}b.moveEnd&&b.moveEnd()}),this};l.pt.callback=function(){function b(){!1===(c.cancel&&c.cancel(a.index))||layer.close(a.index)}var a=this,d=a.layero,c=a.config;a.openLayer();c.success&&(2==c.type?d.find("iframe")[0].onload=function(){this.className="";c.success(d,a.index)}:c.success(d,a.index));layer.ie6&&a.IE6(d);d.find("."+e[6]).children("a").on("click",function(){var e=g(this).index();0===e?c.yes?c.yes(a.index,d):layer.close(a.index):1===e?b():c["btn"+(e+1)]?c["btn"+(e+1)](a.index,d):layer.close(a.index)});d.find("."+e[7]).on("click",b);c.shadeClose&&g("#layui-layer-shade"+a.index).on("click",function(){layer.close(a.index)});d.find(".layui-layer-min").on("click",function(){layer.min(a.index,c);c.min&&c.min(d)});d.find(".layui-layer-max").on("click",function(){g(this).hasClass("layui-layer-maxmin")?(layer.restore(a.index),c.restore&&c.restore(d)):(layer.full(a.index,c),c.full&&c.full(d))});c.end&&(h.end[a.index]=c.end)};h.reselect=function(){g.each(g("select"),function(b,a){var d=g(this);d.parents("."+e[0])[0]||1==d.attr("layer")&&1>g("."+e[0]).length&&d.removeAttr("layer").show()})};l.pt.IE6=function(b){function a(){b.css({top:c+(d.config.fix?k.scrollTop():0)})}var d=this,c=b.offset().top;a();k.scroll(a);g("select").each(function(a,b){var c=g(this);c.parents("."+e[0])[0]||"none"===c.css("display")||c.attr({layer:"1"}).hide()})};l.pt.openLayer=function(){layer.zIndex=this.config.zIndex;layer.setTop=function(b){return layer.zIndex=parseInt(b[0].style.zIndex),b.on("mousedown",function(){layer.zIndex++;b.css("z-index",layer.zIndex+1)}),layer.zIndex}};h.record=function(b){var a=[b.outerWidth(),b.outerHeight(),b.position().top,b.position().left+parseFloat(b.css("margin-left"))];b.find(".layui-layer-max").addClass("layui-layer-maxmin");b.attr({area:a})};h.rescollbar=function(b){e.html.attr("layer-full")==b&&(e.html[0].style.removeProperty?e.html[0].style.removeProperty("overflow"):e.html[0].style.removeAttribute("overflow"),e.html.removeAttr("layer-full"))};layer.getChildFrame=function(b,a){return a=a||g("."+e[4]).attr("times"),g("#"+e[0]+a).find("iframe").contents().find(b)};layer.getFrameIndex=function(b){return g("#"+b).parents("."+e[4]).attr("times")};layer.iframeAuto=function(b){if(b){var a=layer.getChildFrame("body",b).outerHeight();b=g("#"+e[0]+b);var d=b.find(e[1]).outerHeight()||0,c=b.find("."+e[6]).outerHeight()||0;b.css({height:a+d+c});b.find("iframe").css({height:a})}};layer.iframeSrc=function(b,a){g("#"+e[0]+b).find("iframe").attr("src",a)};layer.style=function(b,a){var d=g("#"+e[0]+b),c=d.attr("type"),f=d.find(e[1]).outerHeight()||0,k=d.find("."+e[6]).outerHeight()||0;c!==h.type[1]&&c!==h.type[2]||(d.css(a),c!==h.type[2]||d.find("iframe").css({height:parseFloat(a.height)-f-k}))};layer.min=function(b,a){var d=g("#"+e[0]+b),c=d.find(e[1]).outerHeight()||0;h.record(d);layer.style(b,{width:180,height:c,overflow:"hidden"});d.find(".layui-layer-min").hide();"page"===d.attr("type")&&d.find(e[4]).hide();h.rescollbar(b)};layer.restore=function(b){var a=g("#"+e[0]+b),d=a.attr("area").split(",");a.attr("type");layer.style(b,{width:parseFloat(d[0]),height:parseFloat(d[1]),top:parseFloat(d[2]),left:parseFloat(d[3]),overflow:"visible"});a.find(".layui-layer-max").removeClass("layui-layer-maxmin");a.find(".layui-layer-min").show();"page"===a.attr("type")&&a.find(e[4]).show();h.rescollbar(b)};layer.full=function(b){var a,d=g("#"+e[0]+b);h.record(d);e.html.attr("layer-full")||e.html.css("overflow","hidden").attr("layer-full",b);clearTimeout(a);a=setTimeout(function(){var a="fixed"===d.css("position");layer.style(b,{top:a?0:k.scrollTop(),left:a?0:k.scrollLeft(),width:k.width(),height:k.height()});d.find(".layui-layer-min").hide()},100)};layer.title=function(b,a){g("#"+e[0]+(a||layer.index)).find(e[1]).html(b)};layer.close=function(b){var a=g("#"+e[0]+b),d=a.attr("type");if(a[0]){if(d===h.type[1]&&"object"===a.attr("conType"))for(a.children(":not(."+e[5]+")").remove(),d=0;2>d;d++)a.find(".layui-layer-wrap").unwrap().hide();else{if(d===h.type[2])try{var c=g("#"+e[4]+b)[0];c.contentWindow.document.write("");c.contentWindow.close();a.find("."+e[5])[0].removeChild(c)}catch(f){}a[0].innerHTML="";a.remove()}g("#layui-layer-moves, #layui-layer-shade"+b).remove();layer.ie6&&h.reselect();h.rescollbar(b);"function"==typeof h.end[b]&&h.end[b]();delete h.end[b]}};layer.closeAll=function(b){g.each(g("."+e[0]),function(){var a=g(this);(b?a.attr("type")===b:1)&&layer.close(a.attr("times"))})};h.run=function(){g=jQuery;k=g(m);e.html=g("html");layer.open=function(b){return(new l(b)).index}};"function"==typeof define?define(function(){return h.run(),layer}):(h.run(),layer.use("skin/layer.css"))}(window);