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