/** * 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 */ if(RightJS.Browser.OLD)$=RightJS.$=function(g){return function(n){var k=g(n);if(k&&k instanceof RightJS.Element&&RightJS.isString(n)&&k._.id!==n)k=RightJS.$(document).first("#"+n);return k}}(RightJS.$);RightJS.$E("p").getBoundingClientRect||RightJS.Element.include({position:function(){var g=this._,n=g.offsetTop,k=g.offsetLeft;for(g=g.offsetParent;g;){n+=g.offsetTop;k+=g.offsetLeft;g=g.offsetParent}return{x:k,y:n}}}); document.querySelector||function(g){function n(a){if(!r[a]){var b,d,c,f,l,h,e={};for(c=a;b=c.match(w);){f=f||{};f[b[1]]={o:b[2],v:b[5]||b[6]};c=c.replace(b[0],"")}if(b=c.match(x)){l=b[1];h=b[3]==""?null:b[3];c=c.replace(b[0],"")}b=(c.match(y)||[1,null])[1];d=(c.match(z)||"*").toString().toUpperCase();c=(c.match(A)||[1,""])[1].split(".").without("");e.tag=d;if(b||c.length||f||l){var i="function(y){var e,r=[],z=0,x=y.length;for(;z1)e=f(e);for(var p=0;p1?f(e):e}}return s[b]}var B={" ":function(a,b){return g.$A(a.getElementsByTagName(b))},">":function(a,b){for(var d=[],c=a.firstChild;c;){if(b=="*"||c.tagName==b)d.push(c);c=c.nextSibling}return d},"+":function(a,b){for(;a=a.nextSibling;)if(a.tagName)return b=="*"||a.tagName==b?[a]:[];return[]},"~":function(a,b){for(var d= [];a=a.nextSibling;)if(b=="*"||a.tagName==b)d.push(a);return d}},u={checked:function(){return this.checked},disabled:function(){return this.disabled},empty:function(){return!(this.innerText||this.innerHTML||this.textContent||"").length},"first-child":function(a){for(var b=this;b=b.previousSibling;)if(b.tagName&&(!a||b.tagName==a))return false;return true},"first-of-type":function(a,b){return b["first-child"].call(this,this.tagName)},"last-child":function(a){for(var b=this;b=b.nextSibling;)if(b.tagName&& (!a||b.tagName==a))return false;return true},"last-of-type":function(a,b){return b["last-child"].call(this,this.tagName)},"only-child":function(a,b){return b["first-child"].call(this,a)&&b["last-child"].call(this,a)},"only-of-type":function(a,b){return b["only-child"].call(this,this.tagName,b)},"nth-child":function(a,b,d){if(!this.parentNode)return false;a=a.toLowerCase();if(a=="n")return true;if(a.include("n")){var c=b=0;if(m=a.match(/^([+\-]?\d*)?n([+\-]?\d*)?$/)){b=m[1]=="-"?-1:parseInt(m[1],10)|| 1;c=parseInt(m[2],10)||0}a=1;for(var f=this;f=f.previousSibling;)if(f.tagName&&(!d||f.tagName==d))a++;return(a-c)%b===0&&(a-c)/b>=0}else return b.index.call(this,a.toInt()-1,b,d)},"nth-of-type":function(a,b){return b["nth-child"].call(this,a,b,this.tagName)},index:function(a,b,d){a=g.isString(a)?a.toInt():a;b=this;for(var c=0;b=b.previousSibling;)if(b.tagName&&(!d||b.tagName==d)&&++c>a)return false;return c==a}},v=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, y=/#([\w\-_]+)/,z=/^[\w\*]+/,A=/\.([\w\-\._]+)/,x=/:([\w\-]+)(\((.+?)\))*$/,w=/\[((?:[\w\-]*:)?[\w\-]+)\s*(?:([!\^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/,r={},s={},t={},q={first:function(a){return this.find(a)[0]},find:function(a){var b=this._;a=a||"*";if(!t[a]){v.lastIndex=0;for(var d=[],c=[],f=" ",l,h;l=v.exec(a);){h=l[1];if(h=="+"||h==">"||h=="~")f=h;else{c.push([f,h]);f=" "}if(l[2]){d.push(k(c));c=[]}}d.push(k(c));t[a]=d}a=t[a];d=[];c=0;for(f=a.length;c