(function(w,d){var math={tir:function(h,a,n){return Number(Math[h](a*Math.PI/180).toFixed(n||6))},sub:function(a,b,n){var A=a.toString().split("."),B=b.toString().split("."),l=(A[1]?A[1].length:0)+(B[1]?B[1].length:0),ca=A[0]+(A[1]?A[1]:""),cb=B[0]+(B[1]?B[1]:"");return Number(((ca*cb)/Math.pow(10,l)).toFixed(n?n:(l?l:0)))}},ty=function(s,a){if(a){var t=/\[(o?|O)bject (a?|A)rray\]/,arr=/(a?|A)rray/;if(arr.test(a)){return t.test(Object.prototype.toString.call(s))}else{return typeof(s)==a}}return typeof(s)},css=function(a,s){if(!s){a.style.cssText="";return}if(ty(s,"Array")){var n=[];for(var i=0;i<s.length;i++){if(a.currentStyle){n[i]=a.currentStyle[s[i]]}else{n[i]=d.defaultView.getComputedStyle(a,null)[s[i]]}}return n}else{if(ty(s,"string")){if(a.currentStyle){return a.currentStyle[s]}else{return d.defaultView.getComputedStyle(a,null)[s]}}else{for(var i in s){a.style[i]=s[i]}}}},OClass={get:function(c,e){if(d.getElementsByClassName){return(e||d).getElementsByClassName(c)}else{var a=(e||d).getElementsByTagName("*"),e=[],t=new RegExp(" "+c+" ");for(var i=0;i<a.length;i++){if(t.test(" "+a[i].className+" ")){e.push(a[i])}}return e}},add:function(a,s){var c=" "+a.className+" ",r=new RegExp(" "+s+" ");if(!r.test(c)){a.className+=" "+s}},remove:function(a,s){if(s){var c=" "+a.className+" ",r=new RegExp(" "+s+" ");if(r.test(c)){a.className=c.replace(r,"")}}else{a.className=""}}},obj={ex:function(a,b){if(ty(b,"string")){b=[b]}if(ty(b,"Array")){for(var i=0;i<b.length;i++){b[i] in a?void (0):a[b[i]]=null}}else{for(var i in b){i in a?void (0):a[i]=b[i]}}}},com={min:function(a,b){var n=0;for(var i in a){if(!ty(s,"number")){var c=parseInt(a[i])}else{var c=null}if(a[n]>(c||a[i])){n=i}}if(b){return a[n]}return n},max:function(a,b){var n=0;for(var i in a){if(!ty(s,"number")){var c=parseInt(a[i])}else{var c=null}if(a[n]<(c||a[i])){n=i}}if(b){return a[n]}return n}},attr={add:function(a,t){if(ty(t,"string")){t=[t]}if(ty(t,"Array")){var b=[];for(var i in t){b.push(a.getAttribute(t[i]))}return b}else{for(var i in t){a.setAttribute(i,t[i])}}},remove:function(a,t){if(t){if(ty(t,"string")){t=[t]}for(var i in t){a.removeAttribute(t[i])}}else{for(var i=0,s=a.attributes;i<s.length;i++){a.removeAttribute(s[i])}}}},events={add:function(a,s,f){if(w.addEventListener){a.addEventListener(s,f)}else{a.attachEvent("on"+s,f)}},remove:function(a,s,f){if(f){if(w.removeEventListener){a.removeEventListener(s,f)}else{a.detachEvent("on"+s,f)}}else{a[s]=void (0)}}},win={height:function(){return"innerHeight" in w?w.innerHeight:d.documentElement.clientHeight},width:function(){return"innerWidth" in w?w.innerWidth:d.documentElement.clientWidth},href:function(){return w.location.href},st:function(){return d.body.scrollTop||d.documentElement.scrollTop}};var lmq=function(){var rep=/small([0-9])*_/,name={small:function(){var s=OClass.get("small"),r=[];for(var i=0;i<s.length;i++){var sc=s[i].getElementsByTagName("img");for(var j=0;j<sc.length;j++){r.push(sc[j])}}return r},preHttp:function(){var p=OClass.get("preHttp"),r=[];for(var i=0;i<p.length;i++){var s=p[i].getElementsByTagName("a");for(var j=0;j<s.length;j++){r.push(s[j])}}return r},move:OClass.get("move"),lazyimg:function(){var lazy=d.getElementsByTagName("img"),r=[];for(var i=0;i<lazy.length;i++){if(lazy[i].getAttribute("data-src")){r.push(lazy[i])}}return r},win:OClass.get("winimg"),st:OClass.get("st"),sl:OClass.get("sl"),act:{nav:function(){return this.get(OClass.get("navAct"))},list:function(){return this.get(OClass.get("listAct"))},get:function(a){var r=[];for(var i=0;i<a.length;i++){for(var j=0,b=a[i].getElementsByTagName("a");j<b.length;j++){b[j].act=a[i].getAttribute("data-act")||"act";r.push(b[j])}a[i].removeAttribute("data-act")}return r}},water:OClass.get("water"),wow:OClass.get("wow"),sway:OClass.get("sway")};var e=function(){return new e.prototype.init()};e.f=e.prototype={constructor:e.prototype,from:"http://limengqun.top",data:"2018.7",edition:4,time:0.3,heightDir:0.8,compatible:["","webkit","moz","MS","o"],init:function(){e.l.lazy.pre().roll();e.a.wow.init();e.a.sway.init();e.r.p.top();e.r.p.left.init();e.r.p.re();e.w.alt();e.w.w.init();e.w.m.init();e.w.m.re();e.w.act.nav();e.w.act.list();events.add(w,"load",function(){e.l.rep.s();e.l.lazy.load();if(!name.lazyimg().length){e.l.pre.ajax()}})}};e.l=e.f.load={rep:{s:function(n){if(!name.small().length){return e.l}ty(n,"object")?void (0):n=new Object();obj.ex(n,"all");var s=name.small(),l=s.length,r=new Array();for(var i=0;i<l;i++){if(s[i].getAttribute("data-src")){if(rep.test(s[i].getAttribute("data-src"))){var sr=s[i].getAttribute("data-src").replace(rep,"");s[i].setAttribute("data-src",sr)}else{var sr=s[i].getAttribute("data-src")}}else{if(rep.test(s[i].src)){var sr=s[i].src.replace(rep,"");s[i].src=sr}else{var sr=s[i].src}}r.push(sr)}e.l.pre.load(r,{all:function(){e.w.m.init();n.all&&n.all()}});return e.l},r:function(a,s){s=new RegExp(s||rep);if(ty(a,"array")){for(var i=0;i<a.length;i++){if(s.test(a[i])){a[i]=a[i].replace(s,"")}}return a}else{if(ty(a,"string")){if(s.test(a)){return a.replace(s,"")}}}return a}},pre:{load:function(s,n){ty(n,"object")?void (0):n=new Object();obj.ex(n,["each","all"]);ty(s,"string")?s=[s]:(ty(s,"array")?void (0):console.log("src应为数组或字符串"));var l=0;for(var i=0;i<s.length;i++){var img=new Image();img.src=s[i];img.onload=function(){l++;n.each&&n.each();if(l>=s.length){n.all&&n.all()}}}return this},ajax:function(){var s=name.preHttp(),div=d.createElement("div"),a,src=[];div.style.display="none";d.body.appendChild(div);function ajaxPreload(i){if(i>=s.length){div.parentNode.removeChild(div);return}var ajax=new XMLHttpRequest();ajax.onreadystatechange=function(){if(this.status==200&&this.readyState==4){div.innerHTML=this.responseText;a=div.getElementsByTagName("img");for(var j=0;j<a.length;j++){if(a[j].getAttribute("data-src")){src[j]=a[j].getAttribute("data-src")}else{src[j]=a[j].src}}e.l.pre.load(src,{all:ajaxPreload(i+1)})}};ajax.open("POST",s[i].getAttribute("href"));ajax.send()}ajaxPreload(0);return e.l}},lazy:{pre:function(){if(!name.lazyimg().length){return this}var lazy=name.lazyimg();this.s=[];for(var i=0,m=lazy.length;i<m;i++){this.s.push(lazy[i].getAttribute("data-src"));if(!lazy[i].getAttribute("src")){lazy[i].src=e.f.from+"/img/loading.gif"}}return this},load:function(n){if(this.s==undefined){return}ty(n,"object")?void (0):n=new Object();obj.ex(n,["all"]);e.l.pre.load(this.s,{all:function(){e.l.pre.ajax();n.all&&n.all()}})},roll:function(n){if(!name.lazyimg().length){return}ty(n,"object")?void (0):n=new Object();obj.ex(n,["all"]);var lazy=name.lazyimg();function roll(){if(lazy.length==0){events.remove(w,"scroll",roll);n.all&&n.all()}for(var i=0;i<lazy.length;i++){if(lazy[i].getBoundingClientRect().top-win.height()*3<=0){lazy[i].setAttribute("src",lazy[i].getAttribute("data-src"));lazy.splice(i,1)}}}roll();events.add(w,"scroll",roll)}}};e.r=e.f.roll={p:{t:true,l:true,top:function(){var s=name.st;var len=s.length;if(!len){return}for(var i=0;i<len;i++){s[i].b={spend:Number(s[i].getAttribute("data-spend"))||1000/60,each:Number(s[i].getAttribute("data-each"))||1,stop:Number(s[i].getAttribute("data-stop"))||null,dir:"scrollTop",size:"offsetHeight"};if(e.r.p.t){var div=d.createElement("div");div.innerHTML=s[i].innerHTML;s[i].removeChild(s[i].children[0]);s[i].appendChild(div);s[i].style.overflow="hidden";div.style.overflow="hidden"}e.r.p.r(s[i],true);e.r.p.s(s[i])}e.r.p.t=!e.r.p.t},left:{init:function(){this.s=name.sl;var len=this.s.length;if(!len){return}for(var i=0;i<len;i++){this.s[i].b={spend:Number(this.s[i].getAttribute("data-spend"))||10,each:Number(this.s[i].getAttribute("data-each"))||1,row:Number(this.s[i].getAttribute("data-row"))||null,stop:Number(this.s[i].getAttribute("data-stop"))||null,dir:"scrollLeft",size:"offsetWidth"};if(e.r.p.l){var div=d.createElement("div");div.innerHTML=this.s[i].innerHTML;this.s[i].removeChild(this.s[i].children[0]);this.s[i].appendChild(div);this.s[i].style.overflow="hidden";div.style.overflow="hidden"}e.r.p.r(this.s[i],true);e.r.p.s(this.s[i])}e.r.p.l=!e.r.p.l},r:function(s){var div=s.children[0];var div1=s.children[0].children[0];if(s.children[0].children[1]){var div2=s.children[0].children[1]}var a=div1.children[0];var m=css(a,["margin-left","margin-right"]);for(var j=0;j<2;j++){m[j]=m[j].split("px")[0]=="auto"?0:Number(m[j].split("px")[0])}var width=(a.offsetWidth+m[0]+m[1])*div1.children.length/(s.b.row||1);css(div,{width:width*2+"px"});css(div1,{"width":width+"px","float":"left"});if(div2){css(div2,{"width":width+"px","float":"left"})}}},s:function(a){clearInterval(a.timer);function roll(){if((a[a.b.dir]+=a.b.each)>=a.children[0][a.b.size]/2){a[a.b.dir]=0}}a.timer=setInterval(roll,a.b.spend);events.add(a,"mouseenter",function(){clearInterval(a.timer)});events.add(a,"mouseleave",function(){clearInterval(a.timer);a.timer=setInterval(roll,a.b.spend)})},r:function(a,f){if(f){a.children[0].innerHTML+=a.children[0].innerHTML;a.children[0].children[0].style.overflow="hidden";a.children[0].children[1].style.overflow="hidden"}else{clearInterval(a.timer);a[a.b.dir]=0;a.children[0].removeChild(a.children[0].children[0])}},re:function(){var t=name.st,l=name.sl;var nowW=win.width(),timer;function start(){for(var i=0;i<t.length;i++){t[i].curW=nowW;if(nowW<t[i].b.stop){e.r.p.r(t[i],false)}}for(var i=0;i<l.length;i++){e.r.p.left.r(l[i]);l[i].curW=nowW;if(nowW<l[i].b.stop){e.r.p.r(l[i],false);l[i].style.width="";l[i].children[0].style.width="";l[i].children[0].children[0].style.width="";l[i].children[0].children[0].style["float"]=""}}}start();function re(){for(var i=0;i<t.length;i++){if(nowW<t[i].b.stop&&t[i].curW>t[i].b.stop){e.r.p.r(t[i],false)}if(nowW>t[i].b.stop&&t[i].curW<t[i].b.stop){e.r.p.r(t[i],true);e.r.p.s(t[i])}t[i].curW=nowW}for(var i=0;i<l.length;i++){e.r.p.left.r(l[i]);if(nowW<l[i].b.stop&&l[i].curW>l[i].b.stop){e.r.p.r(l[i],false);e.r.p.left.r(l[i]);l[i].style.width="";l[i].children[0].style.width="";l[i].children[0].children[0].style.width="";l[i].children[0].children[0].style["float"]=""}if(nowW>l[i].b.stop&&l[i].curW<l[i].b.stop){e.r.p.r(l[i],true);e.r.p.left.r(l[i]);e.r.p.s(l[i])}l[i].curW=nowW}}events.add(w,"resize",function(){nowW=win.width();clearTimeout(timer);timer=setTimeout(re,300)})}}};e.a=e.f.animate={wow:{animated:"animated",init:function(){var wow=name.wow,len=wow.length,animateName=new Array();for(var i=0;i<len;i++){var Class=wow[i].className.split(" ");for(var j=0;j<Class.length;j++){if(Class[j]=="wow"){animateName[i]=Class[j+1];css(wow[i],{"animation-name":"none","visibility":"hidden"})}}}this.animateName=animateName;this.scroll()},scroll:function(){var animateName=this.animateName,wow=name.wow,len=wow.length,d=0,t=this;events.add(w,"scroll",animate);function animate(){for(var i=d;i<len;i++){if(wow[i].getBoundingClientRect().top<=win.height()*e.f.heightDir){d+=1;OClass.add(wow[i],t.animated);css(wow[i],{"animation-name":animateName[i],"visibility":"visible"});for(var j=0;j<e.f.compatible.length;j++){events.add(wow[i],e.f.compatible[j]+"animationend",function(){OClass.remove(this,t.animated)})}}}}animate()}},sway:{init:function(){var sway=name.sway,len=sway.length,tThis=this,timer;for(var i=0;i<len;i++){if(sway[i].addedSwayMouseEnter){continue}sway[i].addedSwayMouseEnter=true;events.add(sway[i],"mouseenter",function(){clearTimeout(timer);css(this,{"transition":"none"});var t=this;function move(){tThis.move.call(t)}this.basic={spend:t.getAttribute("data-spend")||".3",dir:t.getAttribute("data-dir")||"0.05"};this.WidthCenter=this.offsetWidth/2;this.HeightCenter=this.offsetHeight/2;events.add(d,"mousemove",move);function leave(){events.remove(d,"mousemove",move);css(t,{"transition":"all "+t.basic.spend+"s","transform":""});timer=setTimeout(function(){css(t,{"transition":""})},Number(t.basic.spend)*1000)}events.add(t,"mouseleave",leave)})}},move:function(ev){ev=ev||w.event;var x=ev.clientX-this.getBoundingClientRect().left,y=ev.clientY-this.getBoundingClientRect().top;css(this,{"transform":"rotateY("+(x-this.WidthCenter)*this.basic.dir+"deg ) rotateX("+(y-this.HeightCenter)*-1*this.basic.dir+"deg)"})},}};e.w=e.f.effect={alt:function(){if(!d.getElementById("logo")){return}else{var logo=d.getElementById("logo").getAttribute("alt")}var a=document.getElementsByTagName("a"),img=document.getElementsByTagName("img");var dot=/\./;function imp(who,how){if(ty(who.getAttribute(how),"object")||dot.test(who.getAttribute(how))||who.getAttribute(how)==""){who.setAttribute(how,logo)}}for(var i=0;i<a.length;i++){imp(a[i],"title")}for(var i=0;i<img.length;i++){imp(img[i],"alt")}},w:{s:name.win,h:[],d:20,init:function(){var s=this.s,len=s.length;if(!len){return}if(d.getElementById("winImgDiv")){this.div=d.getElementById("winImgDiv");this.img=this.div.getElementsByTagName("img")[0]}else{this.div=d.createElement("div");this.img=d.createElement("img");this.div.id="winImgDiv";this.div.appendChild(this.img);d.body.appendChild(this.div)}css(this.div,{"display":"none","border":"3px solid #fff","border-radius":"3px","overflow":"hidden","position":"fixed","z-index":"999999","box-shadow":"0 0 10px 0 rgba(0,0,0,.3)"});css(this.img,{"display":"block"});for(var i=0;i<len;i++){s[i].index=i;events.add(s[i],"mouseenter",function(){if(this.innerHTML!=e.w.w.h[this.index]){e.w.w.enterLeave(this.index);e.w.w.h[this.index]=this.innerHTML}})}},enterLeave:function(i){var s=this.s[i],img=s.getElementsByTagName("img"),len=img.length,div=this.div,dimg=this.img,timer;for(var i=0;i<len;i++){if(img[i].addedMouseenter){continue}img[i].addedMouseenter=true;events.add(img[i],"mouseenter",function(){dimg.src=this.src;css(div,{"display":"block"});div.lheight=div.offsetHeight;div.lwidth=div.offsetWidth;events.add(d,"mousemove",e.w.w.move)});events.add(img[i],"mouseleave",function(){clearTimeout(timer);css(div,{"display":"none"});events.remove(d,"mousemove",e.w.w.move)})}},move:function(ev){ev=ev||w.event;var dir=e.w.w.d,x=ev.clientX+dir,y=ev.clientY+dir,div=e.w.w.div,alt=d.getElementById("alttxt");if(x+div.lwidth>=win.width()){div.style.left=x-div.lwidth-dir*2+"px"}else{div.style.left=x+"px"}if(y+div.lheight>=win.height()){div.style.top="initial";div.style.bottom="0px"}else{div.style.bottom="initial";div.style.top=y+"px"}if(alt){alt.parentNode.removeChild(alt)}},},m:{m:name.move,init:function(){var m=this.m,len=m.length;if(!len){return}for(var i=0;i<len;i++){var mi=m[i].getElementsByTagName("img");if(m[i].getAttribute("data-move")=="lr"){for(var j=0;j<mi.length;j++){mi[j].style.marginLeft=(mi[j].offsetWidth-mi[j].parentNode.offsetWidth)/-2+"px"}continue}else{if(m[i].getAttribute("data-move")=="tb"){for(var j=0;j<mi.length;j++){mi[j].style.marginTop=(mi[j].offsetHeight-mi[j].parentNode.offsetHeight)/-2+"px"}continue}else{for(var j=0;j<mi.length;j++){mi[j].style.marginLeft=(mi[j].offsetWidth-mi[j].parentNode.offsetWidth)/-2+"px";mi[j].style.marginTop=(mi[j].offsetHeight-mi[j].parentNode.offsetHeight)/-2+"px"}}}}},re:function(){var timer,t=this;events.add(w,"resize",function(){clearTimeout(timer);timer=setTimeout(t.init(),160)})}},act:{url:win.href().split("/").pop(),nav:function(){var a=name.act.nav(),len=a.length;if(!len){return}if(this.url==""){var url=new RegExp("index")}else{var url=new RegExp(this.url.split("?")[0])}for(var i=0;i<len;i++){if(url.test(a[i].getAttribute("href"))){OClass.add(a[i],a[i].act)}}},list:function(){var a=name.act.list(),len=a.length;if(!len){return}if(d.getElementById("pagelei")){var url=new RegExp(d.getElementById("pagelei").getAttribute("data-lei"))}else{if(/topage/.test(win.href)){var url=new RegExp(this.url.split("=")[3].split("&")[0])}else{var url=new RegExp(this.url.split("=").pop())}}for(var i=0;i<len;i++){if(url.test(a[i].getAttribute("href"))){OClass.add(a[i],a[i].act)}}}}};e()};lmq()}(window,document));