/** * This is old browsers support patch for RightJS * * The library released under terms of the MIT license * Visit http://rightjs.org for more details * * Copyright (C) 2008-2010 Nikolay V. Nemshilov aka St. */ if(Browser.OLD){$=(function(o){return function(i){var e=o(i);return e?Element.prepare(e):e}})($);$ext(document,{createElement:(function(o){return function(t){return Element.prepare(o(t))}})(document.createElement)});$ext(Element,{prepare:function(e){if(e&&e.tagName&&!e.set){$ext(e,Element.Methods,true);if(self.Form)switch(e.tagName){case 'FORM':Form.ext(e);break;case 'INPUT':case 'SELECT':case 'BUTTON':case 'TEXTAREA':Form.Element.ext(e);break}}return e}});Element.include((function(){var o=Element.Methods.rCollect;return{rCollect:function(a,c){return o.call(this,a,c).each(Element.prepare)}}})())}if(!$E('p').getBoundingClientRect)Element.include({position:function(){var l=this.offsetLeft,t=this.offsetTop,a=this.getStyle('position'),p=this.parentNode,b=this.ownerDocument.body;while(p&&p.tagName){if(p===b||p.getStyle('position')!='static'){if(p!==b||a!='absolute'){var s=p.position();l+=s.x;t+=s.y}break}p=p.parentNode}return{x:l,y:t}}});if(!document.querySelector)Element.include((function(){var H={' ':function(e,t){return $A(e.getElementsByTagName(t))},'>':function(e,t){var r=[],n=e.firstChild;while(n){if(t=='*'||n.tagName==t)r.push(n);n=n.nextSibling}return r},'+':function(e,t){while(e=e.nextSibling)if(e.tagName)return(t=='*'||e.tagName==t)?[e]:[];return[]},'~':function(e,t){var r=[];while(e=e.nextSibling)if(t=='*'||e.tagName==t)r.push(e);return r}};var G={checked:function(){return this.checked},disabled:function(){return this.disabled},empty:function(){return!(this.innerText||this.innerHTML||this.textContent||'').length},'first-child':function(t){var n=this;while(n=n.previousSibling)if(n.tagName&&(!t||n.tagName==t))return false;return true},'first-of-type':function(){return arguments[1]['first-child'].call(this,this.tagName)},'last-child':function(t){var n=this;while(n=n.nextSibling)if(n.tagName&&(!t||n.tagName==t))return false;return true},'last-of-type':function(){return arguments[1]['last-child'].call(this,this.tagName)},'only-child':function(t,m){return m['first-child'].call(this,t)&&m['last-child'].call(this,t)},'only-of-type':function(){return arguments[1]['only-child'].call(this,this.tagName,arguments[1])},'nth-child':function(d,c,t){if(!this.parentNode)return false;d=d.toLowerCase();if(d=='n')return true;if(d.includes('n')){var a=b=0;if(m=d.match(/^([+-]?\d*)?n([+-]?\d*)?$/)){a=m[1]=='-'?-1:parseInt(m[1],10)||1;b=parseInt(m[2],10)||0}var i=1,n=this;while((n=n.previousSibling))if(n.tagName&&(!t||n.tagName==t))i++;return(i-b)% a==0&&(i-b)/a>=0}else return c['index'].call(this,d.toInt()-1,c,t)},'nth-of-type':function(n){return arguments[1]['nth-child'].call(this,n,arguments[1],this.tagName)},index:function(a,m,t){a=isString(a)?a.toInt():a;var n=this,c=0;while((n=n.previousSibling))if(n.tagName&&(!t||n.tagName==t)&&++c>a)return false;return c==a}};var A=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g;var E=/#([\w\-_]+)/;var L=/^[\w\*]+/;var C=/\.([\w\-\._]+)/;var F=/:([\w\-]+)(\((.+?)\))*$/;var w=/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/;var q={};function x(b){if(!q[b]){var i,t,c,a,p,v,m,d={};while(m=b.match(w)){a=a||{};a[m[1]]={o:m[2],v:m[5]||m[6]};b=b.replace(m[0],'')}if(m=b.match(F)){p=m[1];v=m[3]==''?null:m[3];b=b.replace(m[0],'')}i=(b.match(E)||[1,null])[1];t=(b.match(L)||'*').toString().toUpperCase();c=(b.match(C)||[1,''])[1].split('.').without('');d.tag=t;if(i||c.length||a||p){var f='function(y){var e,r=[];for(var z=0,x=y.length;z1)f=k(f);for(var j=0;j1?k(f):f}}return M[h]};var J={},B={};function K(c){if(!J[c]){A.lastIndex=0;var b=[],a=[],r=' ',m,t;while(m=A.exec(c)){t=m[1];if(t=='+'||t=='>'||t=='~')r=t;else{a.push([r,t]);r=' '}if(m[2]){b.push(y(a));a=[]}}b.push(y(a));J[c]=b}return J[c]};function I(e,c){var s=K(c),r=[];for(var i=0,l=s.length;i