UNPKG

swg-js

Version:

模拟jquery,并提供jq没有的常用js方法

2 lines 41.1 kB
!function(){var e=function(e){function t(e,t,n,r){var o,i,a,u,s,c,l,f=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:$)!==R&&I(t),t=t||R,P)){if(11!==p&&(s=ve.exec(e)))if(o=s[1]){if(9===p){if(!(a=t.getElementById(o)))return n;if(a.id===o)return n.push(a),n}else if(f&&(a=f.getElementById(o))&&j(t,a)&&a.id===o)return n.push(a),n}else{if(s[2])return K.apply(n,t.getElementsByTagName(e)),n;if((o=s[3])&&E.getElementsByClassName&&t.getElementsByClassName)return K.apply(n,t.getElementsByClassName(o)),n}if(E.qsa&&!W[e+" "]&&(!B||!B.test(e))){if(1!==p)f=t,l=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(Ce,Ee):t.setAttribute("id",u=X),c=S(e),i=c.length;i--;)c[i]="#"+u+" "+h(c[i]);l=c.join(","),f=ye.test(e)&&d(t.parentNode)||t}if(l)try{return K.apply(n,f.querySelectorAll(l)),n}catch(e){}finally{u===X&&t.removeAttribute("id")}}}return D(e.replace(ue,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>T.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[X]=!0,e}function o(e){var t=R.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split("|"),r=n.length;r--;)T.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function s(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&xe(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function d(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function h(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function p(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,u=F++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,s){var c,l,d,f=[z,u];if(s){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(d=t[X]||(t[X]={}),l=d[t.uniqueID]||(d[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=l[i])&&c[0]===z&&c[1]===u)return f[2]=c[2];if(l[i]=f,f[2]=e(t,n,s))return!0}return!1}}function g(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function m(e,n,r){for(var o=0,i=n.length;o<i;o++)t(e,n[o],r);return r}function v(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function y(e,t,n,o,i,a){return o&&!o[X]&&(o=y(o)),i&&!i[X]&&(i=y(i,a)),r(function(r,a,u,s){var c,l,d,f=[],h=[],p=a.length,g=r||m(t||"*",u.nodeType?[u]:u,[]),y=!e||!r&&t?g:v(g,f,e,u,s),b=n?i||(r?e:p||o)?[]:a:y;if(n&&n(y,b,u,s),o)for(c=v(b,h),o(c,[],u,s),l=c.length;l--;)(d=c[l])&&(b[h[l]]=!(y[h[l]]=d));if(r){if(i||e){if(i){for(c=[],l=b.length;l--;)(d=b[l])&&c.push(y[l]=d);i(null,b=[],c,s)}for(l=b.length;l--;)(d=b[l])&&(c=i?ee(r,d):f[l])>-1&&(r[c]=!(a[c]=d))}}else b=v(b===a?b.splice(p,b.length):b),i?i(null,a,b,s):K.apply(a,b)})}function b(e){for(var t,n,r,o=e.length,i=T.relative[e[0].type],a=i||T.relative[" "],u=i?1:0,s=p(function(e){return e===t},a,!0),c=p(function(e){return ee(t,e)>-1},a,!0),l=[function(e,n,r){var o=!i&&(r||n!==L)||((t=n).nodeType?s(e,n,r):c(e,n,r));return t=null,o}];u<o;u++)if(n=T.relative[e[u].type])l=[p(g(l),n)];else{if(n=T.filter[e[u].type].apply(null,e[u].matches),n[X]){for(r=++u;r<o&&!T.relative[e[r].type];r++);return y(u>1&&g(l),u>1&&h(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ue,"$1"),n,u<r&&b(e.slice(u,r)),r<o&&b(e=e.slice(r)),r<o&&h(e))}l.push(n)}return g(l)}function w(e,n){var o=n.length>0,i=e.length>0,a=function(r,a,u,s,c){var l,d,f,h=0,p="0",g=r&&[],m=[],y=L,b=r||i&&T.find.TAG("*",c),w=z+=null==y?1:Math.random()||.1,C=b.length;for(c&&(L=a===R||a||c);p!==C&&null!=(l=b[p]);p++){if(i&&l){for(d=0,a||l.ownerDocument===R||(I(l),u=!P);f=e[d++];)if(f(l,a||R,u)){s.push(l);break}c&&(z=w)}o&&((l=!f&&l)&&h--,r&&g.push(l))}if(h+=p,o&&p!==h){for(d=0;f=n[d++];)f(g,m,a,u);if(r){if(h>0)for(;p--;)g[p]||m[p]||(m[p]=Q.call(s));m=v(m)}K.apply(s,m),c&&!r&&m.length>0&&h+n.length>1&&t.uniqueSort(s)}return c&&(z=w,L=y),g};return o?r(a):a}var C,E,T,x,N,S,A,D,L,M,H,I,R,q,P,B,k,O,j,X="sizzle"+1*new Date,$=e.document,z=0,F=0,V=n(),U=n(),W=n(),_=function(e,t){return e===t&&(H=!0),0},G={}.hasOwnProperty,Y=[],Q=Y.pop,J=Y.push,K=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+re+"))|)"+ne+"*\\]",ie=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",ae=new RegExp(ne+"+","g"),ue=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),se=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(ie),fe=new RegExp("^"+re+"$"),he={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ie),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),we=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Ce=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Ee=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Te=function(){I()},xe=p(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{K.apply(Y=Z.call($.childNodes),$.childNodes),Y[$.childNodes.length].nodeType}catch(e){K={apply:Y.length?function(e,t){J.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=t.support={},N=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},I=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:$;return r!==R&&9===r.nodeType&&r.documentElement?(R=r,q=R.documentElement,P=!N(R),$!==R&&(n=R.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Te,!1):n.attachEvent&&n.attachEvent("onunload",Te)),E.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),E.getElementsByTagName=o(function(e){return e.appendChild(R.createComment("")),!e.getElementsByTagName("*").length}),E.getElementsByClassName=me.test(R.getElementsByClassName),E.getById=o(function(e){return q.appendChild(e).id=X,!R.getElementsByName||!R.getElementsByName(X).length}),E.getById?(T.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}},T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&P){var n=t.getElementById(e);return n?[n]:[]}}):(T.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},T.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&P){var n,r,o,i=t.getElementById(e);if(i){if(n=i.getAttributeNode("id"),n&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if(n=i.getAttributeNode("id"),n&&n.value===e)return[i]}return[]}}),T.find.TAG=E.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):E.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},T.find.CLASS=E.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&P)return t.getElementsByClassName(e)},k=[],B=[],(E.qsa=me.test(R.querySelectorAll))&&(o(function(e){q.appendChild(e).innerHTML="<a id='"+X+"'></a><select id='"+X+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&B.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||B.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+X+"-]").length||B.push("~="),e.querySelectorAll(":checked").length||B.push(":checked"),e.querySelectorAll("a#"+X+"+*").length||B.push(".#.+[+~]")}),o(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=R.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&B.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&B.push(":enabled",":disabled"),q.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&B.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),B.push(",.*:")})),(E.matchesSelector=me.test(O=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&o(function(e){E.disconnectedMatch=O.call(e,"*"),O.call(e,"[s!='']:x"),k.push("!=",ie)}),B=B.length&&new RegExp(B.join("|")),k=k.length&&new RegExp(k.join("|")),t=me.test(q.compareDocumentPosition),j=t||me.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},_=t?function(e,t){if(e===t)return H=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!E.sortDetached&&t.compareDocumentPosition(e)===n?e===R||e.ownerDocument===$&&j($,e)?-1:t===R||t.ownerDocument===$&&j($,t)?1:M?ee(M,e)-ee(M,t):0:4&n?-1:1)}:function(e,t){if(e===t)return H=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,u=[e],s=[t];if(!o||!i)return e===R?-1:t===R?1:o?-1:i?1:M?ee(M,e)-ee(M,t):0;if(o===i)return a(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;u[r]===s[r];)r++;return r?a(u[r],s[r]):u[r]===$?-1:s[r]===$?1:0},R):R},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==R&&I(e),n=n.replace(le,"='$1']"),E.matchesSelector&&P&&!W[n+" "]&&(!k||!k.test(n))&&(!B||!B.test(n)))try{var r=O.call(e,n);if(r||E.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,R,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==R&&I(e),j(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==R&&I(e);var n=T.attrHandle[t.toLowerCase()],r=n&&G.call(T.attrHandle,t.toLowerCase())?n(e,t,!P):void 0;return void 0!==r?r:E.attributes||!P?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(Ce,Ee)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,o=0;if(H=!E.detectDuplicates,M=!E.sortStable&&e.slice(0),e.sort(_),H){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return M=null,e},x=t.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=x(t);return n},T=t.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=S(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=V[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&V(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(o){var i=t.attr(o,e);return null==i?"!="===n:!n||(i+="","="===n?i===r:"!="===n?i!==r:"^="===n?r&&0===i.indexOf(r):"*="===n?r&&i.indexOf(r)>-1:"$="===n?r&&i.slice(-r.length)===r:"~="===n?(" "+i.replace(ae," ")+" ").indexOf(r)>-1:"|="===n&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,s){var c,l,d,f,h,p,g=i!==a?"nextSibling":"previousSibling",m=t.parentNode,v=u&&t.nodeName.toLowerCase(),y=!s&&!u,b=!1;if(m){if(i){for(;g;){for(f=t;f=f[g];)if(u?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=g="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&y){for(f=m,d=f[X]||(f[X]={}),l=d[f.uniqueID]||(d[f.uniqueID]={}),c=l[e]||[],h=c[0]===z&&c[1],b=h&&c[2],f=h&&m.childNodes[h];f=++h&&f&&f[g]||(b=h=0)||p.pop();)if(1===f.nodeType&&++b&&f===t){l[e]=[z,h,b];break}}else if(y&&(f=t,d=f[X]||(f[X]={}),l=d[f.uniqueID]||(d[f.uniqueID]={}),c=l[e]||[],h=c[0]===z&&c[1],b=h),b===!1)for(;(f=++h&&f&&f[g]||(b=h=0)||p.pop())&&((u?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++b||(y&&(d=f[X]||(f[X]={}),l=d[f.uniqueID]||(d[f.uniqueID]={}),l[e]=[z,b]),f!==t)););return b-=o,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,n){var o,i=T.pseudos[e]||T.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return i[X]?i(n):i.length>1?(o=[e,e,"",n],T.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,o=i(e,n),a=o.length;a--;)r=ee(e,o[a]),e[r]=!(t[r]=o[a])}):function(e){return i(e,0,o)}):i}},pseudos:{not:r(function(e){var t=[],n=[],o=A(e.replace(ue,"$1"));return o[X]?r(function(e,t,n,r){for(var i,a=o(e,null,r,[]),u=e.length;u--;)(i=a[u])&&(e[u]=!(t[u]=i))}):function(e,r,i){return t[0]=e,o(t,null,i,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),lang:r(function(e){return fe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do if(n=P?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===R.activeElement&&(!R.hasFocus||R.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!T.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},T.pseudos.nth=T.pseudos.eq;for(C in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})T.pseudos[C]=u(C);for(C in{submit:!0,reset:!0})T.pseudos[C]=s(C);f.prototype=T.filters=T.pseudos,T.setFilters=new f,S=t.tokenize=function(e,n){var r,o,i,a,u,s,c,l=U[e+" "];if(l)return n?0:l.slice(0);for(u=e,s=[],c=T.preFilter;u;){r&&!(o=se.exec(u))||(o&&(u=u.slice(o[0].length)||u),s.push(i=[])),r=!1,(o=ce.exec(u))&&(r=o.shift(),i.push({value:r,type:o[0].replace(ue," ")}),u=u.slice(r.length));for(a in T.filter)!(o=he[a].exec(u))||c[a]&&!(o=c[a](o))||(r=o.shift(),i.push({value:r,type:a,matches:o}),u=u.slice(r.length));if(!r)break}return n?u.length:u?t.error(e):U(e,s).slice(0)},A=t.compile=function(e,t){var n,r=[],o=[],i=W[e+" "];if(!i){for(t||(t=S(e)),n=t.length;n--;)i=b(t[n]),i[X]?r.push(i):o.push(i);i=W(e,w(o,r)),i.selector=e}return i},D=t.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&S(e=c.selector||e);if(n=n||[],1===l.length){if(i=l[0]=l[0].slice(0),i.length>2&&"ID"===(a=i[0]).type&&9===t.nodeType&&P&&T.relative[i[1].type]){if(t=(T.find.ID(a.matches[0].replace(be,we),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=he.needsContext.test(e)?0:i.length;o--&&(a=i[o],!T.relative[u=a.type]);)if((s=T.find[u])&&(r=s(a.matches[0].replace(be,we),ye.test(i[0].type)&&d(t.parentNode)||t))){if(i.splice(o,1),e=r.length&&h(i),!e)return K.apply(n,r),n;break}}return(c||A(e,l))(r,t,!P,n,!t||ye.test(e)&&d(t.parentNode)||t),n},E.sortStable=X.split("").sort(_).join("")===X,E.detectDuplicates=!!H,I(),E.sortDetached=o(function(e){return 1&e.compareDocumentPosition(R.createElement("fieldset"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||i("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),E.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||i("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||i(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});var Ne=e.Sizzle;return t.noConflict=function(){return e.Sizzle===t&&(e.Sizzle=Ne),t},"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?module.exports=t:e.Sizzle=t,t}(window);!function(){function t(e,t,n){e.prototype[t]=n}function n(e){if(!e instanceof Array)throw new Error("必须传入HTMLElement数组");this.nodes=e,this.length=this.nodes.length;for(var t in e)this[t]=e[t]}var r={select:function(t,n,r,o){return new e(t,n,r,o)}},o=(r.select,{create:function(e){return new n(e)}});n.prototype={constructor:n,bind:function(){var e=function(){return window.addEventListener?function(e,t,n){e.addEventListener(t,n,!1)}:window.attachEvent?function(e,t,n){var r="on"+t;e.attachEvent(r,function(t){t.preventDefault=t.preventDefault instanceof Function?t.preventDefault:function(){t.returnValue=!1},t.stopPropagation=t.stopPropagation instanceof Function?t.preventDefault:function(){t.cancelBubble=!0},n.call(e,t)})}:function(e,t,n){var r="on"+t,o=e[r];e[r]=function(t){t=t?t:window.event,o instanceof Function&&o.call(e,t),n.call(e,t)}}}();return function(t,n){return this.each(function(){e(this,t,n)}),this}}(),unbind:function(e,t){this.each(function(){t?this.removeEventListener?this.removeEventListener(e,t,!1):this.detachEvent?this.detachEvent("on"+e,function(){t.call(this)}):this["on"+e]=null:this["on"+e]=null})},trigger:function(e){return this.each(function(){try{var t=document.createEvent("Events");t.initEvent(e,!0,!1),this.dispatchEvent(t)}catch(t){this.fireEvent("on"+e)}}),this},bindOrTrigger:function(e,t){return t?this.bind(e,t):this.trigger(e),this},filter:function(e){e=e?e:"*";var t=r.select(e,null,null,this.nodes);return o.create(t)},siblings:function(e){var t=[];return this.each(function(){var e=(this.parentNode||this.parent).childNodes;e=a.nodeListToNodeArray(e);for(var n=0;n<e.length;n++)1===e[n].nodeType&&e[n]!==this&&t.push(e[n])}),o.create(t).filter(e)},afterSiblings:function(e){var t=[];for(var n in this.nodes)for(var r=this.nodes[n],i=r.parentNode.lastChild;r!==i;)r=r.nextSibling,1===r.nodeType&&t.push(r);return o.create(t).filter(e)},beforeSiblings:function(e){var t=[];for(var n in this.nodes)for(var r=this.nodes[n],i=r.parentNode.firstChild;i!=r;)i=i.nextSibling,1===r.nodeType&&t.push(r);return o.create(t).filter(e)},children:function(e){var t=[];return this.each(function(){a.each(this.childNodes,function(){1===this.nodeType&&t.push(this)})}),o.create(t).filter(e)},find:function(e){var t=[];return this.each(function(){t=t.concat(a.getDescendantNodes(this))}),o.create(t).filter(e)},get:function(e){return this.nodes[e]},eq:function(e){return o.create(this.nodes[e]?[this.nodes[e]]:[])},first:function(){return this.eq(0)},last:function(){return this.eq(this.length-1)},parent:function(){var e=[];return this.each(function(){e.push(this.parentNode)}),o.create(e)},hasClass:function(e){var t=!1;return this.each(function(){a.hasClass(this,e)&&(t=!0)}),t},addClass:function(e){this.each(function(){a.hasClass(this,e)||(this.className+=(this.className?" ":"")+e)})},css:function(e,t){return e&&a.isString(e)?(e=a.cssToCamel(e),void 0!==t?(this.each(function(){this.style[e]=t}),this):this[0]?this[0].style[e]:""):void 0},getLinkCss:function(e){var t=this[0];if(t)return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(t,null).getPropertyValue(e):t.currentStyle?t.currentStyle[a.cssToCamel(e)]:null},removeClass:function(e){this.each(function(){for(var t=this.className.split(" "),n=0;n<t.length;n++)t[n]==e&&t.splice(n--,1);this.className=t.join(" ")})},show:function(){this.each(function(){this.style.display=null})},hide:function(){this.each(function(){this.style.display="none"})},text:function(e){function t(e){var n="";for(var r in e.childNodes){var o=e.childNodes[r];n+=1===o.nodeType?t(o):o.nodeValue}return n}return void 0===e||null===e?this.nodes.length>0?"string"==typeof this.nodes[0].textContent?this.nodes[0].textContent:"string"==this.nodes[0].innerText?this.nodes[0].innerText:t(this.nodes[0]):void 0:void("string"==typeof this.textContent?this.each(function(){this.textContent=e}):this.each(function(){this.innerText=e}))},html:function(e){return void 0===e&&null===e?this.nodes.length>0?this.nodes[0].innerHTML:void 0:void this.each(function(){this.innerHTML=e})},val:function(e){return void 0===e?this.nodes.length>0?this.nodes[0].value:void 0:void this.each(function(){this.value=e})},attr:function(e,t){if(this.length>0){if(void 0===t)return this.nodes[0].getAttribute?this.nodes[0].getAttribute(e):this.nodes[0][e];this.each(function(){this.setAttribute(e,t)})}},removeAttr:function(e){this.length>0&&this.each(function(){this.removeAttribute(e)})},append:function(e){"string"==typeof e?this.each(function(){this.insertAdjacentHTML("beforeend",e)}):this.each(function(){this.appendChild(e)})},prepend:function(e){"string"==typeof e?this.each(function(){this.insertAdjacentHTML("afterbegin",e)}):this.each(function(){this.insertBefore(e,this.firstChild)})},before:function(e){"string"==typeof e?this.each(function(){this.insertAdjacentHTML("beforebegin",e)}):this.each(function(){this.parentNode.insertBefore(e,this)})},after:function(e){"string"==typeof e?this.each(function(){this.insertAdjacentHTML("afterend",e)}):this.each(function(){this!==this.parentNode.lastChild?this.parentNode.insertBefore(e,this.nextSibling):this.parentNode.appendChild(e)})},remove:function(){this.each(function(){this.parentNode.removeChild(this)})},empty:function(){this.each(function(){this.innerHTML=""})},ajaxSubmit:function(e){this.each(function(){if("form"!=this.nodeName.toLowerCase())return void alert(this+"不是form,无法进行submit");var t=this,n=document.createElement("iframe");if(n.name="iframe"+a.randomInteger(1e4,99999),n.style.display="none",document.body.appendChild(n),e.url&&(t.action=e.url),e.method&&(t.method=e.method),e.enctype&&(t.enctype=e.enctype),e.data)for(var r in e.data){var o=e.data[r];t.action=a.addParamToUrl(t.action,r,o)}n.onload=function(){if(e.success){try{var r=n.contentWindow.document}catch(e){"SecurityError"==e.name&&alert("表单跨域提交,不能获取返回信息!"+t.action)}r.body?e.success(r.body.innerHTML):e.success(r.documentElement.outerHTML)}document.body.removeChild(n),t.target=void 0},t.target=n.name,t.submit()})},each:function(e){a.each(this.nodes,e)},setIframeAutoHeight:function(){this.each(function(){if("iframe"==this.nodeName.toLowerCase()){var e=this;e[0].onload=function(){e.css("height",0);var t=parseInt(e[0].contentWindow.document.getElementsByTagName("body")[0].scrollHeight);e.css("height",t+50)}}})}},function(){var e=["click","dbclick","focus","blur","change","select","keydown","keyup","mousedown","mouseup","mouseenter","mouseleave","mouseover","mouseout","mousemove","resize","scroll","submit","load","unload","touchstart","touchmove","touchend","touchcancel","paste"];for(var r in e)!function(e){t(n,e,function(t){return this.bindOrTrigger(e,t),this})}(e[r])}();var i={ajax:function(e){function t(e,t){if(t.header)for(var n in t.header){var r=t.header[n];e.setRequestHeader(n,r)}}function n(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject){var e=["MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp.2.0","MSXML2.XMLHttp"];for(var t in e)try{return new ActiveXObject(e[t])}catch(e){}}else alert("您的浏览器版本太低,不支持ajax.")}var r={url:"",method:"get",async:!0,data:void 0,header:void 0,success:function(){},error:function(){}};if(a.setObjectDefaultPropertyValues(e,r),e.data)for(var o in e.data){var i=e.data[o];i instanceof Array?a.each(i,function(){e.url=a.addParamToUrl(e.url,o,this)}):e.url=a.addParamToUrl(e.url,o,i)}var u=n();if(u.onreadystatechange=function(){4===u.readyState&&(200===u.status?e.success(u.responseText):e.error(u.statusText,u.responseText),u=null)},"get"===e.method)u.open("get",e.url,e.async),t(u,e),u.send(null);else if("post"===e.method){var s=e.url.split("?");u.open("post",s[0],e.async),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t(u,e),u.send(s[1]?s[1]:null)}else console.error("调用swg.ajax()方法传入method参数不正确")},jsonp:function(e,t,n,r){var o=document.createElement("script");r||(r="callback");var i=a.randomInteger(1,1e4),u=a["jsonpResult"+i],s="saveJsonpResult"+i;a[s]=function(e){u=e},e=/\?/.test(e)?e.concat("&",r,"=swg."+s):e.concat("?",r,"=swg."+s),o.src=e,void 0!==o.onload?(o.onload=function(){void 0!==u?t(u):n?n():0,o.parentNode.removeChild(o)},o.onerror=function(e){o.parentNode.removeChild(o),n?n():0}):void 0!==o.onreadystatechange&&(o.onreadystatechange=function(){/loaded|complete/.test(this.readyState)&&(void 0!==u?t(u):n(),o.parentNode.removeChild(o))}),u=void 0,document.getElementsByTagName("head")[0].appendChild(o)},setObjectDefaultPropertyValues:function(e,t){for(var n in t)void 0===e[n]&&(e[n]=t[n])},cors:function(e){var t={url:"",method:"get",data:void 0,success:function(){},error:function(){}};if(a.setObjectDefaultPropertyValues(e,t),e.data)for(var n in e.data){var r=e.data[n];e.url=a.addParamToUrl(e.url,n,r)}var o;if(void 0!==window.XMLHttpRequest&&"withCredentials"in(o=new XMLHttpRequest)?o=new XMLHttpRequest:window.XDomainRequest?o=new XDomainRequest:alert("您的浏览器不支持CORS."),o.onload=function(){e.success(o.responseText)},o.onerror=function(){e.error(o.statusText,o.responseText)},"get"===e.method)o.open("get",e.url,!0),o.send(null);else if("post"===e.method){var i=e.url.split("?");o.open("post",i[0],!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(i[1]?i[1]:null)}else console.error("调用swg.ajax()方法传入method参数不正确")},crossDomainPost:function(e,t,n){var r=document.createElement("iframe");r.name="crossDomainPost"+a.randomInteger(100,1e4),r.style.display="none",document.body.appendChild(r);var o=document.createElement("form");o.target=r.name,o.method="post",o.action=e;for(var i in t){var u=document.createElement("input");u.type="hidden",u.name=i,u.value=t[i],o.appendChild(u)}document.body.appendChild(o),r.onload=n,o.submit()},isPositiveInteger:function(e){return!(!e||!e.toString().match(/^\d+$/))},checkIdCard:{cityArray:{11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"},regExp:/^(\d{6})(\d{4})([01]\d)([0123]\d)(\d{3})(\d|x|X)?$/,check:function(e){return!!this.regExp.test(e)&&(!!this.isValidCity(e)&&(!!this.isValidBirth(e)&&!!this.isValidCheckDigit(e)))},isValidCity:function(e){var t=e.substring(0,2);return!!a.checkIdCard.cityArray[parseInt(t)]},isValidBirth:function(e){var t,n,r;if(18==e.length)t=e.substring(6,10),n=e.substring(10,12),r=e.substring(12,14);else{if(15!=e.length)return!1;t="19"+e.substring(6,8),n=e.substring(8,10),r=e.substring(10,12)}if(t<1900)return!1;if(n>12||n<1)return!1;if(r>31||r<1)return!1;try{var o=new Date(t,n,r),i=new Date;return o.getTime()<i.getTime()}catch(e){return!1}},isValidCheckDigit:function(e){if(18==e.length){for(var t=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],n=["1","0","X","9","8","7","6","5","4","3","2"],r=0,o=0;o<17;o++)r+=e.substring(o,o+1)*t[o];var i=n[r%11];return i==e.substring(17,18)}}},checkChineseName:function(e){return!(!e||!e.toString().match(/^[\u4E00-\u9FA5\uf900-\ufa2d]+$/))},addFavorite:function(){var e=location.href,t=document.getElementsByTagName("title")[0].innerText;try{window.external.addFavorite(e,t)}catch(n){try{window.sidebar.addPanel(t,e,"")}catch(e){alert("加入收藏失败,请使用Ctrl+D进行添加,或手动在浏览器里进行设置.")}}},checkResExist:function(e){var t;return $.ajax({url:e,type:"get",cache:!1,async:!1,dataType:"text",data:{},traditional:!0,success:function(e,n){t=!0},error:function(e,n,r){t=!1}}),t},makePlaceHolderCompatible:function(){if(navigator.userAgent.indexOf("MSIE 9.0")!==-1||navigator.userAgent.indexOf("MSIE 8.0")!==-1){var e=a("input[placeHolder!='']");e.focus(function(){a(this).val()==a(this).attr("placeHolder")&&(a(this).val(""),a(this).removeClass("place_holder_text_color"))}),e.blur(function(){""==a(this).val()&&(a(this).val(a(this).attr("placeHolder")),a(this).addClass("place_holder_text_color"))}),e.blur()}},stringEndWith:function(e,t){return e.lastIndexOf(t)==e.length-t.length},randomFloat:function(e,t){return Math.random()*(t-e)+e},randomInteger:function(e,t){return Math.floor(a.randomFloat(e,t))},exchangeArrayElementPosition:function(e,t,n){if(t>n){var r=t;t=n, n=r}for(var r=e[n],o=n;o<t;o++)e[o]=e[o+1];e[t]=r},getParam:function(e,t){if(t=t||location.href,t.indexOf("?")!==-1){var n=t.split("?")[1],r=n.split("&");for(var o in r){var i=r[o].split("=");if(i[0]==e)return i[1]}}},getEvent:function(e){return e?e:window.event},getTarget:function(e){return e=a.getEvent(e),e.target?e.target:e.srcElement},preventDefault:function(e){e=a.getEvent(e),e.preventDefault?e.preventDefault():e.returnValue=!1},getKeyCode:function(e){return e=a.getEvent(e),e.keyCode||e.charCode},stopPropagation:function(e){e=a.getEvent(e),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},assert:function(e,t){if(!e)throw new Error(t)},initAutoRootSize:function(){a.addEvent(window,"load",function(){function e(){var e=16,t=document.documentElement.clientWidth;document.getElementsByTagName("html")[0].style.fontSize=t/e+"px"}e(),window.onresize=e})},getBodyScrollTop:function(){var e=document.getElementsByTagName("body")[0].scrollTop,t=document.documentElement.scrollTop;return e||t},loadLazyImg:function(){var e=a.getBodyScrollTop()+document.documentElement.clientHeight,t=document.querySelectorAll("img[data-src]");for(var n in t){var r=t[n];a.getOffsetTop(r)<e&&(r.setAttribute("src",r.getAttribute("data-src")),r.src=r.getAttribute("data-src"),r.removeAttribute("data-src"))}},getOffsetTop:function(e){for(var t=0;e.offsetParent;e=e.offsetParent)t+=e.offsetTop;return t},getOffsetLeft:function(e){for(var t=0;e.offsetParent;e=e.offsetParent)t+=e.offsetLeft;return t},initLoadLazyImg:function(){a(window).bind("scroll",a.loadLazyImg),a(window).bind("load",a.loadLazyImg),a.loadLazyImg()},dateFormat:function(e,t){if(e instanceof Date);else if("number"==typeof e)e=new Date(e);else{if("[object String]"!==Object.prototype.toString.call(e))return"";e=new Date(parseInt(e))}t||(t="yyyy-MM-dd HH:mm:ss");var n=new String(e.getFullYear()),r=a.oneTo2Digits(new String(e.getMonth()+1)),o=a.oneTo2Digits(new String(e.getDate())),i=a.oneTo2Digits(new String(e.getHours())),u=a.oneTo2Digits(new String(e.getMinutes())),s=a.oneTo2Digits(new String(e.getSeconds())),c=new String(e.getMilliseconds());return t=t.replace(/yyyy/g,n).replace(/yyy/g,n.substr(-3)).replace(/yy/g,n.substr(-2)).replace(/y/g,n.substr(-1)),t=t.replace(/MM/g,r).replace(/M/g,r.substr(-1)),t=t.replace(/dd/g,o).replace(/d/g,o.substr(-1)),t=t.replace(/HH/g,i).replace(/H/g,i.substr(-1)),t=t.replace(/mm/g,u).replace(/m/g,u.substr(-1)),t=t.replace(/ss/g,s).replace(/s/g,s.substr(-1)),t=t.replace(/SSS/g,c).replace(/SS/g,r.substr(-2)).replace(/S/g,c.substr(-1))},oneTo2Digits:function(e){var e=new String(e);return 1==e.length?"0"+e:e},setCookie:function(e,t,n,r,o,i){return document.cookie=[encodeURIComponent(e)+"="+encodeURIComponent(t),n?"; path="+n:"","number"==typeof r?"; expires="+new Date((new Date).getTime()+r).toUTCString():"",o?"; domain="+o:"",i?"; secure":""].join("")},getCookie:function(e){e=encodeURIComponent(e);for(var t=document.cookie.split("; "),n=0;n<t.length;n++){var r=t[n].split("=");if(r[0]==e)return decodeURIComponent(r[1])}},deleteCookie:function(e,t,n,r){a.setCookie(e,null,t,-1e7,n,r)},addParamToUrl:function(e,t,n){return e=/\?/.test(e)?e.concat("&"):e.concat("?"),e.concat(encodeURIComponent(t),"=",encodeURIComponent(n))},hasClass:function(e,t){if(e.className){var n=e.className.split(" ");for(var r in n)if(n[r]==t)return!0}},nodeListToNodeArray:function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];1===r.nodeType&&t.push(r)}return t},removeRepeat:function(e){for(var t=0;t<e.length-1;t++)for(var n=t+1;n<e.length;n++)e[t]===e[n]&&(e.splice(n,1),n--);return e},each:function(e,t){if(e&&e.length)for(var n=0;n<e.length;n++)t.call(e[n],n)},trim:function(e){return e.replace(/(^\s*)|(\s*$)/g,"")},mergeArray:function(e,t){for(var n=0;t&&n<t.length;n++)e.push(t[n]);return e},getNodesChildren:function(e){var t=[];return a.each(e,function(){t=a.mergeArray(t,this.childNodes)}),t},getNodesDescendants:function(e){var t=[];return a.each(e,function(){var e=this.childNodes;t=a.mergeArray(t,e),e&&e.length>0&&(t=a.mergeArray(t,a.getNodesDescendants(e)))}),t},getScreenLeft:function(){return"number"==typeof window.screenLeft?window.screenLeft:window.screenX},getScreenTop:function(){return"number"==typeof window.screenTop?window.screenTop:window.screenY},getViewPortWidth:function(){var e=window.innerWidth;return"number"!=typeof e&&(e="CSS1Compat"==document.compatMode?document.documentElement.clientWidth:document.body.clientWidth),e},getViewPortHeight:function(){var e=window.innerHeight;return"number"!=typeof e&&(e="CSS1Compat"==document.compatMode?document.documentElement.clientHeight:document.body.clientHeight),e},isIE678:function(){var e={toString:function(){}};for(var t in e)if("toString"==t)return!1;return!0},bodyAppendScript:function(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,document.body.appendChild(t)},headAppendLink:function(e){var t=document.createElement("link");t.rel="stylesheet",t.type="text/css",t.href=e;var n=document.getElementsByTagName("head")[0];n.appendChild(t)},pxToNum:function(e){return""===e?0:1*e.replace("px","")},numToPx:function(e){return e+"px"},getEventRelatedTarget:function(e){return e.relatedTarget?e.relatedTarget:e.toElement?e.toElement:e.fromElement?e.fromElement:null},isAndroid:function(){return navigator.userAgent.indexOf("Android")!=-1},isIos:function(){return navigator.userAgent.indexOf("iPhone")!=-1},getDescendantNodes:function(e){var t=[];return a.each(e.childNodes,function(){if(1===this.nodeType){t.push(this);var e=a.getDescendantNodes(this);e&&(t=t.concat(e))}}),t},base64EncodeChars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",base64DecodeChars:new Array((-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),(-1),62,(-1),(-1),(-1),63,52,53,54,55,56,57,58,59,60,61,(-1),(-1),(-1),(-1),(-1),(-1),(-1),0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,(-1),(-1),(-1),(-1),(-1),(-1),26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,(-1),(-1),(-1),(-1),(-1)),base64encode:function(e){var t,n,r,o,i,a;for(r=e.length,n=0,t="";n<r;){if(o=255&e.charCodeAt(n++),n==r){t+=this.base64EncodeChars.charAt(o>>2),t+=this.base64EncodeChars.charAt((3&o)<<4),t+="==";break}if(i=e.charCodeAt(n++),n==r){t+=this.base64EncodeChars.charAt(o>>2),t+=this.base64EncodeChars.charAt((3&o)<<4|(240&i)>>4),t+=this.base64EncodeChars.charAt((15&i)<<2),t+="=";break}a=e.charCodeAt(n++),t+=this.base64EncodeChars.charAt(o>>2),t+=this.base64EncodeChars.charAt((3&o)<<4|(240&i)>>4),t+=this.base64EncodeChars.charAt((15&i)<<2|(192&a)>>6),t+=this.base64EncodeChars.charAt(63&a)}return t},base64decode:function(e){var t,n,r,o,i,a,u;for(a=e.length,i=0,u="";i<a;){do t=this.base64DecodeChars[255&e.charCodeAt(i++)];while(i<a&&t==-1);if(t==-1)break;do n=this.base64DecodeChars[255&e.charCodeAt(i++)];while(i<a&&n==-1);if(n==-1)break;u+=String.fromCharCode(t<<2|(48&n)>>4);do{if(r=255&e.charCodeAt(i++),61==r)return u;r=this.base64DecodeChars[r]}while(i<a&&r==-1);if(r==-1)break;u+=String.fromCharCode((15&n)<<4|(60&r)>>2);do{if(o=255&e.charCodeAt(i++),61==o)return u;o=this.base64DecodeChars[o]}while(i<a&&o==-1);if(o==-1)break;u+=String.fromCharCode((3&r)<<6|o)}return u},createHtmlDocument:function(e){var t=document.createElement("div");return t.innerHTML=e,a(t)},getClipboardData:function(e){return e=a.getEvent(e),e.clipboardData?e.clipboardData.getData("Text"):window.clipboardData.getData("Text")},cssToCamel:function(e){return e?e.toString().replace(/-(\w)/g,function(e,t,n,r){return t.toUpperCase()}):void 0},isEmail:function(e){return/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(e)},isMobile:function(e){return/^13[0-9]{9}$|14[0-9]{9}|15[0-9]{9}$|18[0-9]{9}$/.test(e)},isQQ:function(e){return/^\d{5,13}$/.test(e)},getTranslateX:function(e){return e.style.transform?1*/translateX\(([^)]*)px\)/.exec(e.style.transform)[1]:0},getTranslateY:function(e){return e.style.transform?1*/translateY\(([^)]*)px\)/.exec(e.style.transform)[1]:0},isString:function(e){return"string"==typeof e||e instanceof String},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)}},a=function(t){if(t){if(t instanceof Function){var r=t,o=new n([window]);return o.bind("load",r)}if(window.HTMLElement&&t instanceof HTMLElement){var i=t;return new n([i])}if(t.nodeType)return new n([t]);var a=t.toString();return new n(e(a))}return new n([])};for(var u in i)a[u]=i[u];"function"==typeof define&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:window.swg=a}()}();