/*! layer mobile-v1.2 弹层组件移动版 2014-10-09 license lgpl http://sentsin.com/layui/layer/ by 贤心 */
;!function(a){"use strict";var b="";b=b?b:document.scripts[document.scripts.length-1].src.match(/[\s\s]*\//)[0];var c=document,d="queryselectorall",e="getelementsbyclassname",f=function(a){return c[d](a)};document.head.appendchild(function(){var a=c.createelement("link");return a.href=b+"need/layer.css",a.type="text/css",a.rel="stylesheet",a.id="layermcss",a}());var g={type:0,shade:!0,shadeclose:!0,fixed:!0,anim:!0};a.ready={extend:function(a){var b=json.parse(json.stringify(g));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};var h=0,i=["layermbox"],j=function(a){var b=this;b.config=ready.extend(a),b.view()};j.prototype.view=function(){var a=this,b=a.config,d=c.createelement("div");a.id=d.id=i[0]+h,d.setattribute("class",i[0]+" "+i[0]+(b.type||0)),d.setattribute("index",h);var g=function(){var a="object"==typeof b.title;return b.title?'
'+(a?b.title[0]:b.title)+'
':""}(),j=function(){var a,c=(b.btn||[]).length;return 0!==c&&b.btn?(a=''+b.btn[0]+"",2===c&&(a=''+b.btn[1]+""+a),''+a+"
"):""}();if(b.fixed||(b.top=b.hasownproperty("top")?b.top:100,b.style=b.style||"",b.style+=" top:"+(c.body.scrolltop+b.top)+"px"),2===b.type&&(b.content=''+(b.content||"")+"
"),d.innerhtml=(b.shade?'':"")+'",!b.type||2===b.type){var l=c[e](i[0]+b.type),m=l.length;m>=1&&k.close(l[0].getattribute("index"))}document.body.appendchild(d);var n=a.elem=f("#"+a.id)[0];settimeout(function(){try{n.classname=n.classname+" layermshow"}catch(a){return}b.success&&b.success(n)},1),a.index=h++,a.action(b,n)},j.prototype.action=function(a,b){var c=this;if(a.time&&(ready.timer[c.index]=settimeout(function(){k.close(c.index)},1e3*a.time)),a.title&&(b[e]("layermend")[0].onclick=function(){a.cancel&&a.cancel(),k.close(c.index)}),a.btn)for(var d=b[e]("layermbtn")[0].children,f=d.length,g=0;f>g;g++)d[g].onclick=function(){var b=this.getattribute("type");0==b?(a.no&&a.no(),k.close(c.index)):a.yes?a.yes(c.index):k.close(c.index)};if(a.shade&&a.shadeclose){var h=b[e]("laymshade")[0];h.onclick=function(){k.close(c.index,a.end)},h.ontouchmove=function(){k.close(c.index,a.end)}}a.end&&(ready.end[c.index]=a.end)};var k={v:"1.2",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var b=f("#"+i[0]+a)[0];b&&(b.innerhtml="",c.body.removechild(b),cleartimeout(ready.timer[a]),delete ready.timer[a],"function"==typeof ready.end[a]&&ready.end[a](),delete ready.end[a])},closeall:function(){for(var a=c[e](i[0]),b=0,d=a.length;d>b;b++)k.close(a[b].getattribute("index"))}};"function"==typeof define?define(function(){return k}):a.layer=k}(window);