/*
 (c) 2011 - 2016 Magnetic Media Online, Inc.
 Version: 1.8
 Date: 1544869811.2644396
 Privacy: http://www.magnetic.com/privacy/corporate-privacy-policy/
*/

if("function"!=typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),document.querySelectorAll||(document.querySelectorAll=function(e){var t,n=document.createElement("style"),r=[];for(document.documentElement.firstChild.appendChild(n),document._qsa=[],n.styleSheet.cssText=e+"{x-qsa:expression(document._qsa && document._qsa.push(this))}",window.scrollBy(0,0),n.parentNode.removeChild(n);document._qsa.length;)t=document._qsa.shift(),t.style.removeAttribute("x-qsa"),r.push(t);return document._qsa=null,r}),document.querySelector||(document.querySelector=function(e){var t=document.querySelectorAll(e);return t.length?t[0]:null}),/*
The MIT License

Copyright (c) 2007 Cybozu Labs, Inc.
Copyright (c) 2012 Google Inc.
Copyright (c) 2013 Jacob Marble

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
function(){function e(e){var t=typeof e;if("object"==t){if(!e)return"null";if(e instanceof Array)return"array";if(e instanceof Object)return t;var n=Object.prototype.toString.call(e);if("[object Window]"==n)return"object";if("[object Array]"==n||"number"==typeof e.length&&"undefined"!=typeof e.splice&&"undefined"!=typeof e.propertyIsEnumerable&&!e.propertyIsEnumerable("splice"))return"array";if("[object Function]"==n||"undefined"!=typeof e.call&&"undefined"!=typeof e.propertyIsEnumerable&&!e.propertyIsEnumerable("call"))return"function"}else if("function"==t&&"undefined"==typeof e.call)return"object";return t}function t(e){return"string"==typeof e}function n(e){return e.call.apply(e.bind,arguments)}function r(e,t){if(!e)throw Error();if(2<arguments.length){var n=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,n),e.apply(t,r)}}return function(){return e.apply(t,arguments)}}function i(){return i=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?n:r,i.apply(null,arguments)}function o(e){var t=Array.prototype.slice.call(arguments,1);return function(){var n=t.slice();return n.push.apply(n,arguments),e.apply(this,n)}}function a(e){function t(){}var n=G;t.prototype=n.prototype,e.u=n.prototype,e.prototype=new t,e.prototype.constructor=e,e.t=function(e,t){return n.prototype[t].apply(e,Array.prototype.slice.call(arguments,2))}}function u(e,t){return t>e?-1:e>t?1:0}function s(e){return-1!=Lt.indexOf(e)}function c(e,n){var r;e:{r=e.length;for(var i=t(e)?e.split(""):e,o=0;r>o;o++)if(o in i&&n.call(void 0,i[o],o,e)){r=o;break e}r=-1}return 0>r?null:t(e)?e.charAt(r):e[r]}function l(){return Xt.concat.apply(Xt,arguments)}function f(e,t,n){return 2>=arguments.length?Xt.slice.call(e,t):Xt.slice.call(e,t,n)}function p(){var e=Ft.document;return e?e.documentMode:void 0}function h(e){if(!nn[e]){for(var t=0,n=qt(String(tn)).split("."),r=qt(String(e)).split("."),i=Math.max(n.length,r.length),o=0;0==t&&i>o;o++){var a=n[o]||"",s=r[o]||"",c=RegExp("(\\d*)(\\D*)","g"),l=RegExp("(\\d*)(\\D*)","g");do{var f=c.exec(a)||["","",""],p=l.exec(s)||["","",""];if(0==f[0].length&&0==p[0].length)break;t=u(0==f[1].length?0:parseInt(f[1],10),0==p[1].length?0:parseInt(p[1],10))||u(0==f[2].length,0==p[2].length)||u(f[2],p[2])}while(0==t)}nn[e]=t>=0}}function d(e,t){if(e.contains&&1==t.nodeType)return e==t||e.contains(t);if("undefined"!=typeof e.compareDocumentPosition)return e==t||Boolean(16&e.compareDocumentPosition(t));for(;t&&e!=t;)t=t.parentNode;return t==e}function g(e,t){if(e==t)return 0;if(e.compareDocumentPosition)return 2&e.compareDocumentPosition(t)?1:-1;if(Jt&&!(Jt&&on>=9)){if(9==e.nodeType)return-1;if(9==t.nodeType)return 1}if("sourceIndex"in e||e.parentNode&&"sourceIndex"in e.parentNode){var n=1==e.nodeType,r=1==t.nodeType;if(n&&r)return e.sourceIndex-t.sourceIndex;var i=e.parentNode,o=t.parentNode;return i==o?w(e,t):!n&&d(i,t)?-1*m(e,t):!r&&d(o,e)?m(t,e):(n?e.sourceIndex:i.sourceIndex)-(r?t.sourceIndex:o.sourceIndex)}return r=9==e.nodeType?e:e.ownerDocument||e.document,n=r.createRange(),n.selectNode(e),n.collapse(!0),r=r.createRange(),r.selectNode(t),r.collapse(!0),n.compareBoundaryPoints(Ft.Range.START_TO_END,r)}function m(e,t){var n=e.parentNode;if(n==t)return-1;for(var r=t;r.parentNode!=n;)r=r.parentNode;return w(r,e)}function w(e,t){for(var n=t;n=n.previousSibling;)if(n==e)return-1;return 1}function y(e,t,n){this.a=e,this.b=t||1,this.d=n||1}function v(e){this.b=e,this.a=0}function b(e){e=e.match(an);for(var t=0;t<e.length;t++)un.test(e[t])&&e.splice(t,1);return new v(e)}function x(e,t){return e.b[e.a+(t||0)]}function E(e){return e.b[e.a++]}function S(e){return e.b.length<=e.a}function T(e,t){this.h=e.toLowerCase(),this.c=t?t.toLowerCase():"http://www.w3.org/1999/xhtml"}function N(e,t){switch(this.f=e,this.c=void 0!==t?t:null,this.b=null,e){case"comment":this.b=8;break;case"text":this.b=3;break;case"processing-instruction":this.b=7;break;case"node":break;default:throw Error("Unexpected argument")}}function k(e){return"comment"==e||"text"==e||"processing-instruction"==e||"node"==e}function R(e){switch(e.nodeType){case 1:return o(_,e);case 9:return R(e.documentElement);case 11:case 10:case 6:case 12:return P;default:return e.parentNode?R(e.parentNode):P}}function P(){return null}function _(e,t){if(e.prefix==t)return e.namespaceURI||"http://www.w3.org/1999/xhtml";var n=e.getAttributeNode("xmlns:"+t);return n&&n.specified?n.value||null:e.parentNode&&9!=e.parentNode.nodeType?_(e.parentNode,t):null}function I(e,t,n,r){this.a=e,this.nodeName=n,this.nodeValue=r,this.nodeType=2,this.parentNode=this.ownerElement=t}function O(e,t){var n=cn&&"href"==t.nodeName?e.getAttribute(t.nodeName,2):t.nodeValue;return new I(t,e,t.nodeName,n)}function C(e){var t=null,n=e.nodeType;if(1==n&&(t=e.textContent,t=void 0==t||null==t?e.innerText:t,t=void 0==t||null==t?"":t),"string"!=typeof t)if(sn&&"title"==e.nodeName.toLowerCase()&&1==n)t=e.text;else if(9==n||1==n){e=9==n?e.documentElement:e.firstChild;for(var n=0,r=[],t="";e;){do 1!=e.nodeType&&(t+=e.nodeValue),sn&&"title"==e.nodeName.toLowerCase()&&(t+=e.text),r[n++]=e;while(e=e.firstChild);for(;n&&!(e=r[--n].nextSibling););}}else t=e.nodeValue;return""+t}function D(e,t,n){if(null===t)return!0;try{if(!e.getAttribute)return!1}catch(r){return!1}return cn&&"class"==t&&(t="className"),null==n?!!e.getAttribute(t):e.getAttribute(t,2)==n}function A(e,n,r,i,o){return(sn?U:j).call(null,e,n,t(r)?r:null,t(i)?i:null,o||new F)}function U(e,t,n,r,i){if(e instanceof T||8==e.b||n&&null===e.b){var o=t.all;if(!o)return i;if(e=L(e),"*"!=e&&(o=t.getElementsByTagName(e),!o))return i;if(n){for(var a=[],u=0;t=o[u++];)D(t,n,r)&&a.push(t);o=a}for(u=0;t=o[u++];)"*"==e&&"!"==t.tagName||X(i,t);return i}return K(e,t,n,r,i),i}function j(e,t,n,r,i){return t.getElementsByName&&r&&"name"==n&&!Jt?(t=t.getElementsByName(r),$t(t,function(t){e.a(t)&&X(i,t)})):t.getElementsByClassName&&r&&"class"==n?(t=t.getElementsByClassName(r),$t(t,function(t){t.className==r&&e.a(t)&&X(i,t)})):e instanceof N?K(e,t,n,r,i):t.getElementsByTagName&&(t=t.getElementsByTagName(e.d()),$t(t,function(e){D(e,n,r)&&X(i,e)})),i}function M(e,t,n,r,i){var o;if((e instanceof T||8==e.b||n&&null===e.b)&&(o=t.childNodes)){var a=L(e);return"*"==a||(o=Qt(o,function(e){return e.tagName&&e.tagName.toLowerCase()==a}))?(n&&(o=Qt(o,function(e){return D(e,n,r)})),$t(o,function(e){"*"==a&&("!"==e.tagName||"*"==a&&1!=e.nodeType)||X(i,e)}),i):i}return B(e,t,n,r,i)}function B(e,t,n,r,i){for(t=t.firstChild;t;t=t.nextSibling)D(t,n,r)&&e.a(t)&&X(i,t);return i}function K(e,t,n,r,i){for(t=t.firstChild;t;t=t.nextSibling)D(t,n,r)&&e.a(t)&&X(i,t),K(e,t,n,r,i)}function L(e){if(e instanceof N){if(8==e.b)return"!";if(null===e.b)return"*"}return e.d()}function F(){this.b=this.a=null,this.i=0}function q(e){this.d=e,this.a=this.b=null}function V(e,t){if(!e.a)return t;if(!t.a)return e;for(var n=e.a,r=t.a,i=null,o=null,a=0;n&&r;){var o=n.d,u=r.d;o==u||o instanceof I&&u instanceof I&&o.a==u.a?(o=n,n=n.a,r=r.a):0<g(n.d,r.d)?(o=r,r=r.a):(o=n,n=n.a),(o.b=i)?i.a=o:e.a=o,i=o,a++}for(o=n||r;o;)o.b=i,i=i.a=o,a++,o=o.a;return e.b=i,e.i=a,e}function Y(e,t){var n=new q(t);n.a=e.a,e.b?e.a.b=n:e.a=e.b=n,e.a=n,e.i++}function X(e,t){var n=new q(t);n.b=e.b,e.a?e.b.a=n:e.a=e.b=n,e.b=n,e.i++}function H(e){return(e=e.a)?e.d:null}function $(e){return(e=H(e))?C(e):""}function Q(e,t){return new W(e,!!t)}function W(e,t){this.d=e,this.b=(this.c=t)?e.b:e.a,this.a=null}function z(e){var t=e.b;if(null==t)return null;var n=e.a=t;return e.b=e.c?t.b:t.a,n.d}function G(e){this.g=e,this.b=this.e=!1,this.d=null}function J(e){return"\n  "+e.toString().split("\n").join("\n  ")}function Z(e,t){e.e=t}function et(e,t){e.b=t}function tt(e,t){var n=e.a(t);return n instanceof F?+$(n):+n}function nt(e,t){var n=e.a(t);return n instanceof F?$(n):""+n}function rt(e,t){var n=e.a(t);return n instanceof F?!!n.i:!!n}function it(e,t,n){G.call(this,e.g),this.c=e,this.f=t,this.k=n,this.e=t.e||n.e,this.b=t.b||n.b,this.c==fn&&(n.b||n.e||4==n.g||0==n.g||!t.d?t.b||t.e||4==t.g||0==t.g||!n.d||(this.d={name:n.d.name,l:t}):this.d={name:t.d.name,l:n})}function ot(e,t,n,r,i){t=t.a(r),n=n.a(r);var o;if(t instanceof F&&n instanceof F){for(i=Q(t),r=z(i);r;r=z(i))for(t=Q(n),o=z(t);o;o=z(t))if(e(C(r),C(o)))return!0;return!1}if(t instanceof F||n instanceof F){for(t instanceof F?i=t:(i=n,n=t),i=Q(i),t=typeof n,r=z(i);r;r=z(i)){switch(t){case"number":r=+C(r);break;case"boolean":r=!!C(r);break;case"string":r=C(r);break;default:throw Error("Illegal primitive type for comparison.")}if(e(r,n))return!0}return!1}return i?"boolean"==typeof t||"boolean"==typeof n?e(!!t,!!n):"number"==typeof t||"number"==typeof n?e(+t,+n):e(t,n):e(+t,+n)}function at(e,t,n,r){this.a=e,this.p=t,this.g=n,this.j=r}function ut(e,t,n,r){if(ln.hasOwnProperty(e))throw Error("Binary operator already created: "+e);return e=new at(e,t,n,r),ln[e.toString()]=e}function st(e,t){if(t.a.length&&4!=e.g)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");G.call(this,e.g),this.c=e,this.f=t,this.e=e.e,this.b=e.b}function ct(e,t){if(t.length<e.o)throw Error("Function "+e.h+" expects at least"+e.o+" arguments, "+t.length+" given");if(null!==e.n&&t.length>e.n)throw Error("Function "+e.h+" expects at most "+e.n+" arguments, "+t.length+" given");e.s&&$t(t,function(t,n){if(4!=t.g)throw Error("Argument "+n+" to function "+e.h+" is not of type Nodeset: "+t)}),G.call(this,e.g),this.f=e,this.c=t,Z(this,e.e||zt(t,function(e){return e.e})),et(this,e.r&&!t.length||e.q&&!!t.length||zt(t,function(e){return e.b}))}function lt(e,t,n,r,i,o,a,u,s){this.h=e,this.g=t,this.e=n,this.r=r,this.q=i,this.j=o,this.o=a,this.n=void 0!==u?u:a,this.s=!!s}function ft(e,t,n,r,i,o,a,u){if(pn.hasOwnProperty(e))throw Error("Function already created: "+e+".");pn[e]=new lt(e,t,n,r,!1,i,o,a,u)}function pt(e){G.call(this,3),this.c=e.substring(1,e.length-1)}function ht(e){G.call(this,1),this.c=e}function dt(e,t){if(G.call(this,e.g),this.f=e,this.c=t,this.e=e.e,this.b=e.b,1==this.c.length){var n=this.c[0];n.m||n.c!=dn||(n=n.k,"*"!=n.d()&&(this.d={name:n.d(),l:null}))}}function gt(){G.call(this,4)}function mt(){G.call(this,4)}function wt(e){return"/"==e||"//"==e}function yt(e,t){this.a=e,this.b=!!t}function vt(e,t,n){for(n=n||0;n<e.a.length;n++)for(var r,i=e.a[n],o=Q(t),a=t.i,u=0;r=z(o);u++){var s=e.b?a-u:u+1;if(r=i.a(new y(r,s,a)),"number"==typeof r)s=s==r;else if("string"==typeof r||"boolean"==typeof r)s=!!r;else{if(!(r instanceof F))throw Error("Predicate.evaluate returned an unexpected type.");s=0<r.i}if(!s){s=o,r=s.d;var c=s.a;if(!c)throw Error("Next must be called at least once before remove.");var l=c.b,c=c.a;l?l.a=c:r.a=c,c?c.b=l:r.b=l,r.i--,s.a=null}}return t}function bt(e,t,n,r){G.call(this,4),this.c=e,this.k=t,this.f=n||new yt([]),this.m=!!r,t=this.f,t=0<t.a.length?t.a[0].d:null,e.b&&t&&(e=t.name,e=sn?e.toLowerCase():e,this.d={name:e,l:t.l});e:{for(e=this.f,t=0;t<e.a.length;t++)if(n=e.a[t],n.e||1==n.g||0==n.g){e=!0;break e}e=!1}this.e=e}function xt(e,t,n,r){this.h=e,this.d=t,this.a=n,this.b=r}function Et(e,t,n,r){if(hn.hasOwnProperty(e))throw Error("Axis already created: "+e);return t=new xt(e,t,n,!!r),hn[e]=t}function St(e){G.call(this,1),this.c=e,this.e=e.e,this.b=e.b}function Tt(e){G.call(this,4),this.c=e,Z(this,zt(this.c,function(e){return e.e})),et(this,zt(this.c,function(e){return e.b}))}function Nt(e,t){this.a=e,this.b=t}function kt(e){for(var t,n=[];;){Rt(e,"Missing right hand side of binary expression."),t=Ut(e);var r=E(e.a);if(!r)break;var i=(r=ln[r]||null)&&r.p;if(!i){e.a.a--;break}for(;n.length&&i<=n[n.length-1].p;)t=new it(n.pop(),n.pop(),t);n.push(t,r)}for(;n.length;)t=new it(n.pop(),n.pop(),t);return t}function Rt(e,t){if(S(e.a))throw Error(t)}function Pt(e,t){var n=E(e.a);if(n!=t)throw Error("Bad token, expected: "+t+" got: "+n)}function _t(e){if(e=E(e.a),")"!=e)throw Error("Bad token: "+e)}function It(e){if(e=E(e.a),2>e.length)throw Error("Unclosed literal string");return new pt(e)}function Ot(e){var t=E(e.a),n=t.indexOf(":");if(-1==n)return new T(t);var r=t.substring(0,n);if(e=e.b(r),!e)throw Error("Namespace prefix not declared: "+r);return t=t.substr(n+1),new T(t,e)}function Ct(e){var t,n,r=[];if(wt(x(e.a))){if(t=E(e.a),n=x(e.a),"/"==t&&(S(e.a)||"."!=n&&".."!=n&&"@"!=n&&"*"!=n&&!/(?![0-9])[\w]/.test(n)))return new gt;n=new gt,Rt(e,"Missing next location step."),t=Dt(e,t),r.push(t)}else{e:{switch(t=x(e.a),n=t.charAt(0)){case"$":throw Error("Variable reference not allowed in HTML XPath");case"(":E(e.a),t=kt(e),Rt(e,'unclosed "("'),Pt(e,")");break;case'"':case"'":t=It(e);break;default:if(isNaN(+t)){if(k(t)||!/(?![0-9])[\w]/.test(n)||"("!=x(e.a,1)){t=null;break e}for(t=E(e.a),t=pn[t]||null,E(e.a),n=[];")"!=x(e.a)&&(Rt(e,"Missing function argument list."),n.push(kt(e)),","==x(e.a));)E(e.a);Rt(e,"Unclosed function argument list."),_t(e),t=new ct(t,n)}else t=new ht(+E(e.a))}"["==x(e.a)&&(n=new yt(At(e)),t=new st(t,n))}if(t){if(!wt(x(e.a)))return t;n=t}else t=Dt(e,"/"),n=new mt,r.push(t)}for(;wt(x(e.a));)t=E(e.a),Rt(e,"Missing next location step."),t=Dt(e,t),r.push(t);return new dt(n,r)}function Dt(e,t){var n,r,i;if("/"!=t&&"//"!=t)throw Error('Step op should be "/" or "//"');if("."==x(e.a))return r=new bt(bn,new N("node")),E(e.a),r;if(".."==x(e.a))return r=new bt(yn,new N("node")),E(e.a),r;var o;if("@"==x(e.a))o=dn,E(e.a),Rt(e,"Missing attribute name");else if("::"==x(e.a,1)){if(!/(?![0-9])[\w]/.test(x(e.a).charAt(0)))throw Error("Bad token: "+E(e.a));if(n=E(e.a),o=hn[n]||null,!o)throw Error("No axis with name: "+n);E(e.a),Rt(e,"Missing node name")}else o=gn;if(n=x(e.a),/(?![0-9])[\w]/.test(n.charAt(0)))if("("==x(e.a,1)){if(!k(n))throw Error("Invalid node type: "+n);if(n=E(e.a),!k(n))throw Error("Invalid type name: "+n);Pt(e,"("),Rt(e,"Bad nodetype"),i=x(e.a).charAt(0);var a=null;('"'==i||"'"==i)&&(a=It(e)),Rt(e,"Bad nodetype"),_t(e),n=new N(n,a)}else n=Ot(e);else{if("*"!=n)throw Error("Bad token: "+E(e.a));n=Ot(e)}return i=new yt(At(e),o.a),r||new bt(o,n,i,"//"==t)}function At(e){for(var t=[];"["==x(e.a);){E(e.a),Rt(e,"Missing predicate expression.");var n=kt(e);t.push(n),Rt(e,"Unclosed predicate expression."),Pt(e,"]")}return t}function Ut(e){if("-"==x(e.a))return E(e.a),new St(Ut(e));var t=Ct(e);if("|"!=x(e.a))e=t;else{for(t=[t];"|"==E(e.a);)Rt(e,"Missing next union location path."),t.push(Ct(e));e.a.a--,e=new Tt(t)}return e}function jt(t,n){if(!t.length)throw Error("Empty XPath expression.");var r=b(t);if(S(r))throw Error("Invalid XPath expression.");n?"function"==e(n)||(n=i(n.lookupNamespaceURI,n)):n=function(){return null};var o=kt(new Nt(r,n));if(!S(r))throw Error("Bad token: "+E(r));this.evaluate=function(e,t){var n=o.a(new y(e));return new Mt(n,t)}}function Mt(e,t){if(0==t)if(e instanceof F)t=4;else if("string"==typeof e)t=2;else if("number"==typeof e)t=1;else{if("boolean"!=typeof e)throw Error("Unexpected evaluation result.");t=3}if(2!=t&&1!=t&&3!=t&&!(e instanceof F))throw Error("value could not be converted to the specified type");this.resultType=t;var n;switch(t){case 2:this.stringValue=e instanceof F?$(e):""+e;break;case 1:this.numberValue=e instanceof F?+$(e):+e;break;case 3:this.booleanValue=e instanceof F?0<e.i:!!e;break;case 4:case 5:case 6:case 7:var r=Q(e);n=[];for(var i=z(r);i;i=z(r))n.push(i instanceof I?i.a:i);this.snapshotLength=e.i,this.invalidIteratorState=!1;break;case 8:case 9:r=H(e),this.singleNodeValue=r instanceof I?r.a:r;break;default:throw Error("Unknown XPathResult type.")}var o=0;this.iterateNext=function(){if(4!=t&&5!=t)throw Error("iterateNext called with wrong result type");return o>=n.length?null:n[o++]},this.snapshotItem=function(e){if(6!=t&&7!=t)throw Error("snapshotItem called with wrong result type");return e>=n.length||0>e?null:n[e]}}function Bt(e){this.lookupNamespaceURI=R(e)}function Kt(e){e=e||Ft;var t=e.document;t.evaluate||(e.XPathResult=Mt,t.evaluate=function(e,t,n,r){return new jt(e,n).evaluate(t,r)},t.createExpression=function(e,t){return new jt(e,t)},t.createNSResolver=function(e){return new Bt(e)})}var Lt,Ft=this,qt=String.prototype.trim?function(e){return e.trim()}:function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};e:{var Vt=Ft.navigator;if(Vt){var Yt=Vt.userAgent;if(Yt){Lt=Yt;break e}}Lt=""}var Xt=Array.prototype,Ht=Xt.indexOf?function(e,t,n){return Xt.indexOf.call(e,t,n)}:function(e,n,r){if(r=null==r?0:0>r?Math.max(0,e.length+r):r,t(e))return t(n)&&1==n.length?e.indexOf(n,r):-1;for(;r<e.length;r++)if(r in e&&e[r]===n)return r;return-1},$t=Xt.forEach?function(e,t,n){Xt.forEach.call(e,t,n)}:function(e,n,r){for(var i=e.length,o=t(e)?e.split(""):e,a=0;i>a;a++)a in o&&n.call(r,o[a],a,e)},Qt=Xt.filter?function(e,t,n){return Xt.filter.call(e,t,n)}:function(e,n,r){for(var i=e.length,o=[],a=0,u=t(e)?e.split(""):e,s=0;i>s;s++)if(s in u){var c=u[s];n.call(r,c,s,e)&&(o[a++]=c)}return o},Wt=Xt.reduce?function(e,t,n,r){return r&&(t=i(t,r)),Xt.reduce.call(e,t,n)}:function(e,t,n,r){var i=n;return $t(e,function(n,o){i=t.call(r,i,n,o,e)}),i},zt=Xt.some?function(e,t,n){return Xt.some.call(e,t,n)}:function(e,n,r){for(var i=e.length,o=t(e)?e.split(""):e,a=0;i>a;a++)if(a in o&&n.call(r,o[a],a,e))return!0;return!1},Gt=s("Opera")||s("OPR"),Jt=s("Trident")||s("MSIE"),Zt=s("Gecko")&&-1==Lt.toLowerCase().indexOf("webkit")&&!(s("Trident")||s("MSIE")),en=-1!=Lt.toLowerCase().indexOf("webkit"),tn=function(){var t,n="";return Gt&&Ft.opera?(n=Ft.opera.version,"function"==e(n)?n():n):(Zt?t=/rv\:([^\);]+)(\)|;)/:Jt?t=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:en&&(t=/WebKit\/(\S+)/),t&&(n=(n=t.exec(Lt))?n[1]:""),Jt&&(t=p(),t>parseFloat(n))?String(t):n)}(),nn={},rn=Ft.document,on=rn&&Jt?p()||("CSS1Compat"==rn.compatMode?parseInt(tn,10):5):void 0;!Zt&&!Jt||Jt&&Jt&&on>=9||Zt&&h("1.9.1"),Jt&&h("9");var an=RegExp("\\$?(?:(?![0-9-])[\\w-]+:)?(?![0-9-])[\\w-]+|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!<>]=|\\s+|.","g"),un=/^\s/;T.prototype.a=function(e){var t=e.nodeType;return 1!=t&&2!=t?!1:"*"!=this.h&&this.h!=e.nodeName.toLowerCase()?!1:this.c==(e.namespaceURI?e.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")},T.prototype.d=function(){return this.h},T.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.h},N.prototype.a=function(e){return null===this.b||this.b==e.nodeType},N.prototype.d=function(){return this.f},N.prototype.toString=function(){var e="Kind Test: "+this.f;return null===this.c||(e+=J(this.c)),e};var sn=Jt&&!(Jt&&on>=9),cn=Jt&&!(Jt&&on>=8);a(it),it.prototype.a=function(e){return this.c.j(this.f,this.k,e)},it.prototype.toString=function(){var e="Binary Expression: "+this.c,e=e+J(this.f);return e+=J(this.k)},at.prototype.toString=function(){return this.a};var ln={};ut("div",6,1,function(e,t,n){return tt(e,n)/tt(t,n)}),ut("mod",6,1,function(e,t,n){return tt(e,n)%tt(t,n)}),ut("*",6,1,function(e,t,n){return tt(e,n)*tt(t,n)}),ut("+",5,1,function(e,t,n){return tt(e,n)+tt(t,n)}),ut("-",5,1,function(e,t,n){return tt(e,n)-tt(t,n)}),ut("<",4,2,function(e,t,n){return ot(function(e,t){return t>e},e,t,n)}),ut(">",4,2,function(e,t,n){return ot(function(e,t){return e>t},e,t,n)}),ut("<=",4,2,function(e,t,n){return ot(function(e,t){return t>=e},e,t,n)}),ut(">=",4,2,function(e,t,n){return ot(function(e,t){return e>=t},e,t,n)});var fn=ut("=",3,2,function(e,t,n){return ot(function(e,t){return e==t},e,t,n,!0)});ut("!=",3,2,function(e,t,n){return ot(function(e,t){return e!=t},e,t,n,!0)}),ut("and",2,2,function(e,t,n){return rt(e,n)&&rt(t,n)}),ut("or",1,2,function(e,t,n){return rt(e,n)||rt(t,n)}),a(st),st.prototype.a=function(e){return e=this.c.a(e),vt(this.f,e)},st.prototype.toString=function(){var e;return e="Filter:"+J(this.c),e+=J(this.f)},a(ct),ct.prototype.a=function(e){return this.f.j.apply(null,l(e,this.c))},ct.prototype.toString=function(){var e="Function: "+this.f;if(this.c.length)var t=Wt(this.c,function(e,t){return e+J(t)},"Arguments:"),e=e+J(t);return e},lt.prototype.toString=function(){return this.h};var pn={};ft("boolean",2,!1,!1,function(e,t){return rt(t,e)},1),ft("ceiling",1,!1,!1,function(e,t){return Math.ceil(tt(t,e))},1),ft("concat",3,!1,!1,function(e){return Wt(f(arguments,1),function(t,n){return t+nt(n,e)},"")},2,null),ft("contains",2,!1,!1,function(e,t,n){return t=nt(t,e),e=nt(n,e),-1!=t.indexOf(e)},2),ft("count",1,!1,!1,function(e,t){return t.a(e).i},1,1,!0),ft("false",2,!1,!1,function(){return!1},0),ft("floor",1,!1,!1,function(e,t){return Math.floor(tt(t,e))},1),ft("id",4,!1,!1,function(e,t){function n(e){if(sn){var t=i.all[e];if(t){if(t.nodeType&&e==t.id)return t;if(t.length)return c(t,function(t){return e==t.id})}return null}return i.getElementById(e)}var r=e.a,i=9==r.nodeType?r:r.ownerDocument,r=nt(t,e).split(/\s+/),o=[];$t(r,function(e){e=n(e),!e||0<=Ht(o,e)||o.push(e)}),o.sort(g);var a=new F;return $t(o,function(e){X(a,e)}),a},1),ft("lang",2,!1,!1,function(){return!1},1),ft("last",1,!0,!1,function(e){if(1!=arguments.length)throw Error("Function last expects ()");return e.d},0),ft("local-name",3,!1,!0,function(e,t){var n=t?H(t.a(e)):e.a;return n?n.localName||n.nodeName.toLowerCase():""},0,1,!0),ft("name",3,!1,!0,function(e,t){var n=t?H(t.a(e)):e.a;return n?n.nodeName.toLowerCase():""},0,1,!0),ft("namespace-uri",3,!0,!1,function(){return""},0,1,!0),ft("normalize-space",3,!1,!0,function(e,t){return(t?nt(t,e):C(e.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1),ft("not",2,!1,!1,function(e,t){return!rt(t,e)},1),ft("number",1,!1,!0,function(e,t){return t?tt(t,e):+C(e.a)},0,1),ft("position",1,!0,!1,function(e){return e.b},0),ft("round",1,!1,!1,function(e,t){return Math.round(tt(t,e))},1),ft("starts-with",2,!1,!1,function(e,t,n){return t=nt(t,e),e=nt(n,e),0==t.lastIndexOf(e,0)},2),ft("string",3,!1,!0,function(e,t){return t?nt(t,e):C(e.a)},0,1),ft("string-length",1,!1,!0,function(e,t){return(t?nt(t,e):C(e.a)).length},0,1),ft("substring",3,!1,!1,function(e,t,n,r){if(n=tt(n,e),isNaN(n)||1/0==n||-1/0==n)return"";if(r=r?tt(r,e):1/0,isNaN(r)||-1/0===r)return"";n=Math.round(n)-1;var i=Math.max(n,0);return e=nt(t,e),1/0==r?e.substring(i):(t=Math.round(r),e.substring(i,n+t))},2,3),ft("substring-after",3,!1,!1,function(e,t,n){return t=nt(t,e),e=nt(n,e),n=t.indexOf(e),-1==n?"":t.substring(n+e.length)},2),ft("substring-before",3,!1,!1,function(e,t,n){return t=nt(t,e),e=nt(n,e),e=t.indexOf(e),-1==e?"":t.substring(0,e)},2),ft("sum",1,!1,!1,function(e,t){for(var n=Q(t.a(e)),r=0,i=z(n);i;i=z(n))r+=+C(i);return r},1,1,!0),ft("translate",3,!1,!1,function(e,t,n,r){t=nt(t,e),n=nt(n,e);var i=nt(r,e);for(e=[],r=0;r<n.length;r++){var o=n.charAt(r);o in e||(e[o]=i.charAt(r))}for(n="",r=0;r<t.length;r++)o=t.charAt(r),n+=o in e?e[o]:o;return n},3),ft("true",2,!1,!1,function(){return!0},0),a(pt),pt.prototype.a=function(){return this.c},pt.prototype.toString=function(){return"Literal: "+this.c},a(ht),ht.prototype.a=function(){return this.c},ht.prototype.toString=function(){return"Number: "+this.c},a(dt),a(gt),gt.prototype.a=function(e){var t=new F;return e=e.a,9==e.nodeType?X(t,e):X(t,e.ownerDocument),t},gt.prototype.toString=function(){return"Root Helper Expression"},a(mt),mt.prototype.a=function(e){var t=new F;return X(t,e.a),t},mt.prototype.toString=function(){return"Context Helper Expression"},dt.prototype.a=function(e){var t=this.f.a(e);if(!(t instanceof F))throw Error("Filter expression must evaluate to nodeset.");e=this.c;for(var n=0,r=e.length;r>n&&t.i;n++){var i,o=e[n],a=Q(t,o.c.a);if(o.e||o.c!=wn)if(o.e||o.c!=vn)for(i=z(a),t=o.a(new y(i));null!=(i=z(a));)i=o.a(new y(i)),t=V(t,i);else i=z(a),t=o.a(new y(i));else{for(i=z(a);(t=z(a))&&(!i.contains||i.contains(t))&&8&t.compareDocumentPosition(i);i=t);t=o.a(new y(i))}}return t},dt.prototype.toString=function(){var e;if(e="Path Expression:"+J(this.f),this.c.length){var t=Wt(this.c,function(e,t){return e+J(t)},"Steps:");e+=J(t)}return e},yt.prototype.toString=function(){return Wt(this.a,function(e,t){return e+J(t)},"Predicates:")},a(bt),bt.prototype.a=function(e){var t=e.a,n=null,n=this.d,r=null,i=null,o=0;if(n&&(r=n.name,i=n.l?nt(n.l,e):null,o=1),this.m)if(this.e||this.c!=gn)if(e=Q(new bt(mn,new N("node")).a(e)),t=z(e))for(n=this.j(t,r,i,o);null!=(t=z(e));)n=V(n,this.j(t,r,i,o));else n=new F;else n=A(this.k,t,r,i),n=vt(this.f,n,o);else n=this.j(e.a,r,i,o);return n},bt.prototype.j=function(e,t,n,r){return e=this.c.d(this.k,e,t,n),e=vt(this.f,e,r)},bt.prototype.toString=function(){var e;if(e="Step:"+J("Operator: "+(this.m?"//":"/")),this.c.h&&(e+=J("Axis: "+this.c)),e+=J(this.k),this.f.a.length){var t=Wt(this.f.a,function(e,t){return e+J(t)},"Predicates:");e+=J(t)}return e},xt.prototype.toString=function(){return this.h};var hn={};Et("ancestor",function(e,t){for(var n=new F,r=t;r=r.parentNode;)e.a(r)&&Y(n,r);return n},!0),Et("ancestor-or-self",function(e,t){var n=new F,r=t;do e.a(r)&&Y(n,r);while(r=r.parentNode);return n},!0);var dn=Et("attribute",function(e,t){var n=new F,r=e.d();if("style"==r&&t.style&&sn)return X(n,new I(t.style,t,"style",t.style.cssText)),n;var i=t.attributes;if(i)if(e instanceof N&&null===e.b||"*"==r)for(var o,r=0;o=i[r];r++)sn?o.nodeValue&&X(n,O(t,o)):X(n,o);else(o=i.getNamedItem(r))&&(sn?o.nodeValue&&X(n,O(t,o)):X(n,o));return n},!1),gn=Et("child",function(e,n,r,i,o){return(sn?M:B).call(null,e,n,t(r)?r:null,t(i)?i:null,o||new F)},!1,!0);Et("descendant",A,!1,!0);var mn=Et("descendant-or-self",function(e,t,n,r){var i=new F;return D(t,n,r)&&e.a(t)&&X(i,t),A(e,t,n,r,i)},!1,!0),wn=Et("following",function(e,t,n,r){var i=new F;do for(var o=t;o=o.nextSibling;)D(o,n,r)&&e.a(o)&&X(i,o),i=A(e,o,n,r,i);while(t=t.parentNode);return i},!1,!0);Et("following-sibling",function(e,t){for(var n=new F,r=t;r=r.nextSibling;)e.a(r)&&X(n,r);return n},!1),Et("namespace",function(){return new F},!1);var yn=Et("parent",function(e,t){var n=new F;if(9==t.nodeType)return n;if(2==t.nodeType)return X(n,t.ownerElement),n;var r=t.parentNode;return e.a(r)&&X(n,r),n},!1),vn=Et("preceding",function(e,t,n,r){var i=new F,o=[];do o.unshift(t);while(t=t.parentNode);for(var a=1,u=o.length;u>a;a++){var s=[];for(t=o[a];t=t.previousSibling;)s.unshift(t);for(var c=0,l=s.length;l>c;c++)t=s[c],D(t,n,r)&&e.a(t)&&X(i,t),i=A(e,t,n,r,i)}return i},!0,!0);Et("preceding-sibling",function(e,t){for(var n=new F,r=t;r=r.previousSibling;)e.a(r)&&Y(n,r);return n},!0);var bn=Et("self",function(e,t){var n=new F;return e.a(t)&&X(n,t),n},!1);a(St),St.prototype.a=function(e){return-tt(this.c,e)},St.prototype.toString=function(){return"Unary Expression: -"+J(this.c)},a(Tt),Tt.prototype.a=function(e){var t=new F;return $t(this.c,function(n){if(n=n.a(e),!(n instanceof F))throw Error("Path expression must evaluate to NodeSet.");t=V(t,n)}),t},Tt.prototype.toString=function(){return Wt(this.c,function(e,t){return e+J(t)},"Union Expression:")},Mt.ANY_TYPE=0,Mt.NUMBER_TYPE=1,Mt.STRING_TYPE=2,Mt.BOOLEAN_TYPE=3,Mt.UNORDERED_NODE_ITERATOR_TYPE=4,Mt.ORDERED_NODE_ITERATOR_TYPE=5,Mt.UNORDERED_NODE_SNAPSHOT_TYPE=6,Mt.ORDERED_NODE_SNAPSHOT_TYPE=7,Mt.ANY_UNORDERED_NODE_TYPE=8,Mt.FIRST_ORDERED_NODE_TYPE=9;var xn=["wgxpath","install"],En=Ft;xn[0]in En||!En.execScript||En.execScript("var "+xn[0]);for(var Sn;xn.length&&(Sn=xn.shift());)xn.length||void 0===Kt?En=En[Sn]?En[Sn]:En[Sn]={}:En[Sn]=Kt}(),"undefined"==typeof _mag){var _mag={};_mag.settings={}}"undefined"==typeof console&&(console={},console.log=function(){}),function(){function e(){n.initSettings(),t.debugMode&&(_mag.Smag=n,_mag.PixelsController=r,_mag.Parser=i),r.init(t),t.bestTemplateResults=i.init(t.templates)||{},t.intervals=t.maxTries,n.searchReady()||(n.log("starting intervals"),t.readyInterval=window.setInterval(n.searchReady,100))}var t="settings"in _mag?_mag.settings:{},n={initSettings:function(){n.log("init settings."),t.ns=null,t.keywordSource="pub",t.keywordEncoded="kw_encoded"in _mag?_mag.kw_encoded:0,t.startTime="startTime"in _mag?_mag.startTime:"0",t.domainPaths={"manta.com":{"/business":"small business reference"}},t.defaultKeywords="keyword",t.publisherKeywords=n.getPageKeyword(),t.publisherKeywords=t.keywordEncoded?decodeURIComponent(t.publisherKeywords):t.publisherKeywords,t.tagVersion="1.8",t.executeTime=(new Date).getTime(),t.debugMode="debugMode"in t&&t.debugMode?!0:!1,t.isIFrame=~~(window!=window.top),t.isSecure="https:"==document.location.protocol,t.protocol=t.isSecure?"https:":"http:",t.currentURL=window.location,t.publicHost=n.getPublicHost(),t.refURL=n.getReferrerUrl(),t.title=document.title.substr(0,150),t.urlParams=window.location.search.substr(1),t.maxTries=1,t.readyInterval=null,t.magURL=t.protocol+"//d3ezl4ajpp2zy8.cloudfront.net",t.pixelURL=t.protocol+"//manta-uncategorized.t.domdex.com/search.js",t.pixelFired=!1,t.queryStringObject=n.getQueryStringObject(),t.pathnameArray=n.getPathnameArray(),t.excludedTerms={search:!0},t.templates=[{id:4249,keyword:"search",name:"Search",pairings:{},url:"manta.com"},{id:4250,keyword:"search",name:"Search",pairings:{},url:"manta.com"},{id:4251,keyword:"search",name:"Search",pairings:{},url:"manta.com"}],t.conversionPixelsMap=[],t.retargetingPixelsMap=[],t.conversionPixels="conversionPixels"in _mag?_mag.conversionPixels:t.conversionPixelsMap,t.retargetingPixels="retargetingPixels"in _mag?_mag.retargetingPixels:t.retargetingPixelsMap,t.metaKeywords="",t.metaDescription="",wgxpath.install(),n.log(t)},getPageKeyword:function(){var e=t.domainPaths[n.getPublicHost()],r="/"==window.location.pathname.substr(-1)&&window.location.pathname.length>1?window.location.pathname.slice(0,-1):window.location.pathname,i="";if(void 0!==e&&null!==e){for(;void 0===e[r]&&r.length>1;){var o=r.slice(0,r.lastIndexOf("/"));r=r===o||0===o.length?"/":o}void 0!==e[r]&&(i=e[r])}return""!==i?i:"kw"in _mag?_mag.kw:null},getReferrerUrl:function(){var e=document.referrer;return(void 0==e||""==e)&&(e=_mag.refUrl),void 0==e&&(e=""),e.length>147&&(e=e.substr(0,147)+"..."),n.log("Smag.getReferrerUrl: Referrer url "+e),e},searchReady:function(){if(n.log("Smag.searchReady - interval: "+t.intervals),!t.pixelFired){var e=t.bestTemplateResults.keyword;return e?n.stopSearch(e,"Smag.searchReady: found page kws: "+e+" -- clear ing interval"):(t.intervals--,t.intervals<=0&&n.stopSearch(null,"Smag.searchReady - page kws not found - forcing track without")),!0}},stopSearch:function(e,r){e&&(t.bestTemplateResults.ns=n.decodeKeywords(e)),n.log(r),n.trackQuery(),window.clearInterval(t.readyInterval)},escapeRegExp:function(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},getPublicHost:function(){var e=window.location.hostname.split("."),t=e.length;return 3==t&&"uk"!=e[t-1]&&e.shift(),e.join(".")},getQueryStringObject:function(){for(var e=window.location.search.substring(1),t=e.split("&"),n={},r=0;r<t.length;r++){var i=t[r].split("=");n[i[0]]=i[1]}return n},getPathnameArray:function(){for(var e=window.location.pathname.split("/"),t=[],n=0;n<e.length;n++)e[n].trim().length&&t.push(decodeURIComponent(e[n].trim()));return t},trackQuery:function(){n.log("trackingQuery");var e=i.parseMetaTag("keywords");t.metaKeywords="",e&&(t.metaKeywords=e.substr(0,150));var o=i.parseMetaTag("description");t.metaDescription="",o&&(t.metaDescription=o.substr(0,150));var a=null;n.isRelevantKeyword(t.title)&&(a=t.title,t.keywordSource="title"),n.isRelevantKeyword(t.metaKeywords)&&(a=t.metaKeywords,t.keywordSource="meta"),n.isRelevantKeyword(t.publisherKeywords)&&(a=t.publisherKeywords,t.keywordSource="pub"),n.isRelevantKeyword(t.bestTemplateResults.ns)&&(a=t.bestTemplateResults.ns,t.keywordSource="page"),null==a&&(a=t.defaultKeywords,t.keywordSource="defkwd");var u=n.buildSearchTrackingUrl(a);document.body.appendChild(r.buildScript(u)),t.pixelFired=!0,n.log(u)},log:function(e){t.debugMode&&console.log(e)},buildSearchTrackingUrl:function(e){var r=n.decodeKeywords(e),i={k:r,ks:t.keywordSource,pk:t.publisherKeywords,mk:t.metaKeywords,md:t.metaDescription,s:"1",t1:t.startTime,t2:t.executeTime,t3:(new Date).getTime(),v:t.tagVersion,u:t.currentURL,r:t.refURL,ifr:t.isIFrame,tit:t.title};for(var o in t.bestTemplateResults)"undefined"!=typeof t.bestTemplateResults[o]&&null!==t.bestTemplateResults[o]&&(i[o]=t.bestTemplateResults[o],"br"==o&&(i.k=i.k+" "+t.bestTemplateResults[o]),i[o]=i[o].substr(0,150));return n.log("Smag.buildSearchTrackingUrl: Search params are "+n.encodeQueryData(i)),t.pixelURL+"?"+n.encodeQueryData(i)},decodeKeywords:function(e){var t=e.replace(/\+/g," ").replace(/&/g," and ").replace(/\|/g," or ").replace(/\(|\)|\'| +(?= )/g,"").replace(/ AND | OR /g," ").replace(/"/g,"");return decodeURIComponent(t)},encodeQueryData:function(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")},isRelevantKeyword:function(e){var t=["keyword"];if(!e)return!1;for(var n=0;n<t.length;n++)if(e.toUpperCase()===t[n].toUpperCase())return!1;
return!0}},r={init:function(e){e.conversionPixels!=[]&&r.firePixels(e.conversionPixels),e.retargetingPixels!=[]&&r.firePixels(e.retargetingPixels)},firePixels:function(e){for(var t=0;t<e.length;t++)if("undefined"!==e[t].pages)for(var n=0;n<e[t].pages.length;n++)if(r.matchCurrentUrl(e[t].pages[n])){var i=r.buildPixel(e[t]);document.body.appendChild(i)}},buildPixel:function(e){var t=null;return e.js_url?t=r.buildScript(e.js_url):e.img_url&&(t=r.buildImage(e.img_url)),t},buildScript:function(e){var t=document.createElement("script");return t.type="text/javascript",t.src=e,t},buildImage:function(e){var t=document.createElement("img");return t.src=e,t.style="display: none;",t.height=1,t.width=1,t},matchCurrentUrl:function(e){var r=t.currentURL.href;r=r.split("#")[0],r=r.replace(/\/$/,""),target_url_regex=new RegExp(e,"gi");var i=r.match(target_url_regex)?!0:!1;return n.log("Smag.matchCurrentUrl: CurrentUrl: "+r+", TargetUrl: "+e+", matched: "+i),i},matchCurrentDomain:function(e){var r=t.publicHost,i=new RegExp(e,"gi");return n.log("Smag.matchCurrentDomain: CurrentDomain: "+r+", TargetDomain: "+e),r.match(i)?!0:!1}},i={init:function(e){if("undefined"!=typeof e&&null!=e&&e.length>0){var t=[],r={};if(t=i.selectTemplates(e),t.length>0)for(n.log("First template "+t[0].id),r.tid="",j=0;j<t.length;++j)r=i.appendObject(r,i.parseDOMWithTemplate(t[j])),r.ns=i.parseKeyword(t[j].keyword),r.tid=r.tid+t[j].id.toString()+", ";return r}},selectTemplates:function(e){for(var t,n=[],o=0;o<e.length;o++){var a=e[o];r.matchCurrentDomain(a.url)&&(t=i.parsePairings(a),i.countPairings(t)>=i.countPairings(a.pairings)&&n.push(a),a.keyword&&n.length<1&&n.push(a))}return n},parseMetaTag:function(e,t){var t=null==t?"content":t,n=document.querySelector("meta[name='"+e+"']");return n?n.getAttribute(t):null},parseKeyword:function(e){return i.isNumeric(e)?t.pathnameArray[parseInt(e,10)]:t.queryStringObject[e]},parsePairings:function(e){var t={};for(var n in e.pairings)t[n]=i.getElementByXPath(e.pairings[n]);return t},parseBreadcrumb:function(e){if(null==e||"undefined"==typeof e)return"";for(var t=i.collapseWhiteSpace(e.replace(/[^\w\s]/gi,",")),n=t.split(","),r=0;r<n.length;r++)n[r]=n[r].trim();return t=n.join(", ")},countPairings:function(e){var t=0;for(var n in e)null!==e[n]&&"undefined"!=typeof e[n]&&t++;return t},parseDOMWithTemplate:function(e){var t={},n="";for(var r in e.pairings)switch(r){case"bc":n=i.getTextByXPath(e.pairings[r]),t[r]=i.parseBreadcrumb(n);break;default:t[r]=i.getTextByXPath(e.pairings[r])}return t},getElementByXPath:function(e){return document.evaluate(e,document,null,9,null).singleNodeValue},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},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+=i.getText(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=i.getText(t);return n},collapseWhiteSpace:function(e){return e=e.replace(/\s+/g," "),e.replace(/^\s+|\s+$/g,"")},getTextByXPath:function(e){var t=i.getElementByXPath(e);if(null!==t)return i.collapseWhiteSpace(i.getText(t))},appendObject:function(e,t){for(var n in t)e[n]=t[n];return e}};e()}();