/*
selectivizr v1.0.3b - (c) Keith Clark, freely distributable under the terms 
of the MIT license.

CUSTOMIZED BY John | Flynax

selectivizr.com
*/
/* 
  
Notes about this source
-----------------------

 * The #DEBUG_START and #DEBUG_END comments are used to mark blocks of code
   that will be removed prior to building a final release version (using a
   pre-compression script)
  
  
References:
-----------
 
 * CSS Syntax          : http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#style
 * Selectors           : http://www.w3.org/TR/css3-selectors/#selectors
 * IE Compatability    : http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx
 * W3C Selector Tests  : http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/tests/
 
*/

(function(n){function G(a){return a.replace(H,m).replace(I,function(a,d,c){a=c.split(",");c=0;for(var e=a.length;c<e;c++){var h=J(a[c].replace(K,m).replace(L,m))+u,f=[];a[c]=h.replace(M,function(a,b,c,d,e){return b?(0<f.length&&(v.push({selector:h.substring(0,e),patches:f}),f=[]),b):(b=c?N(c):!z||z.test(d)?{className:A(d),applyClass:!0}:null)?(f.push(b),"."+b.className):a})}return d+a.join(",")})}function N(a){var b=!0,d=A(a.slice(1)),c=":not("==a.substring(0,5),e,h;c&&(a=a.slice(5,-1));var f=a.indexOf("(");
-1<f&&(a=a.substring(0,f));if(":"==a.charAt(0))switch(a.slice(1)){case "root":b=function(a){return c?a!=w:a==w};break;case "target":if(8==q){b=function(a){var b=function(){var b=location.hash,d=b.slice(1);return c?b==k||a.id!=d:b!=k&&a.id==d};l(n,"hashchange",function(){r(a,d,b())});return b()};break}return!1;case "checked":b=function(a){O.test(a.type)&&l(a,"propertychange",function(){"checked"==event.propertyName&&r(a,d,a.checked!==c)});return a.checked!==c};break;case "disabled":c=!c;case "enabled":b=
function(b){return P.test(b.tagName)?(l(b,"propertychange",function(){"$disabled"==event.propertyName&&r(b,d,b.$disabled===c)}),x.push(b),b.$disabled=b.disabled,b.disabled===c):":enabled"==a?c:!c};break;case "focus":e="focus",h="blur";case "hover":e||(e="mouseenter",h="mouseleave");b=function(a){l(a,c?h:e,function(){r(a,d,!0)});l(a,c?e:h,function(){r(a,d,!1)});return c};break;default:if(!Q.test(a))return!1}return{className:d,applyClass:b}}function R(){for(var a,b,d,c,e=0;e<v.length;e++){b=v[e].selector;
d=v[e].patches;c=b.replace(S,k);if(c==k||c.charAt(c.length-1)==u)c+="*";try{a=B(c)}catch(h){n.console&&n.console.log("Selector '"+b+"' threw exception '"+h+"'")}if(a)for(b=0,c=a.length;b<c;b++){for(var f=a[b],g=f.className,l=0,m=d.length;l<m;l++){var p=d[l];if("SELECT"!=f.tagName||"slvzr-focus"!=p.className)(new RegExp("(^|\\s)"+p.className+"(\\s|$)")).test(f.className)||!p.applyClass||!0!==p.applyClass&&!0!==p.applyClass(f)||(g=C(g,p.className,!0))}f.className=g}}}function A(a){return T+"-"+(6==
q&&U?V++:a.replace(W,function(a){return a.charCodeAt(0)}))}function J(a){return a.replace(D,m).replace(X,u)}function r(a,b,d){var c=a.className;b=C(c,b,d);b!=c&&(a.className=b,a.parentNode.className+=k)}function C(a,b,d){var c=RegExp("(^|\\s)"+b+"(\\s|$)"),e=c.test(a);return d?e?a:a+u+b:e?a.replace(c,m).replace(D,m):a}function l(a,b,d){a.attachEvent("on"+b,d)}function y(a,b,d){b||(b=Y);"//"==a.substring(0,2)&&(a=b.substring(0,b.indexOf("//"))+a);if(/^https?:\/\//i.test(a))return d||b.substring(0,
b.indexOf("/",8))==a.substring(0,a.indexOf("/",8))?a:null;if("/"==a.charAt(0))return b.substring(0,b.indexOf("/",8))+a;b=b.split(/[?#]/)[0];"?"!=a.charAt(0)&&"/"!=b.charAt(b.length-1)&&(b=b.substring(0,b.lastIndexOf("/")+1));return b+a}function E(a){return a?(s.open("GET",a,!1),s.send(),(200==s.status?s.responseText:k).replace(Z,k).replace($,function(b,d,c,e,g,f){b=E(y(c||g,a));return f?"@media "+f+" {"+b+"}":b}).replace(aa,function(b,d,c,e){c=c||k;return d?b:" url("+c+y(e,a,!0)+c+") "})):k}function ba(){for(var a,
b,d=0;d<g.styleSheets.length;d++)if(b=g.styleSheets[d],b.href!=k&&(a=y(b.href)))b.cssText=b.rawCssText=G(E(a))}function ca(){R();0<x.length&&setInterval(function(){for(var a=0,b=x.length;a<b;a++){var d=x[a];d.disabled!==d.$disabled&&(d.disabled?(d.disabled=!1,d.$disabled=!0,d.disabled=!0):d.$disabled=d.disabled)}},250)}function da(a,b){var d=!1,c=!0,e=function(c){if("readystatechange"!=c.type||"complete"==g.readyState)("load"==c.type?a:g).detachEvent("on"+c.type,e,!1),!d&&(d=!0)&&b.call(a,c.type||
c)},h=function(){try{w.doScroll("left")}catch(a){setTimeout(h,50);return}e("poll")};if("complete"==g.readyState)b.call(a,k);else{if(g.createEventObject&&w.doScroll){try{c=!a.frameElement}catch(f){}c&&h()}l(g,"readystatechange",e);l(a,"load",e)}}var t=navigator.userAgent.match(/MSIE (\d+)/);if(!t)return!1;var g=document,w=g.documentElement,s=function(){if(n.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){return null}}(),q=t[1];if(!("CSS1Compat"!=
g.compatMode||6>q||8<q)&&s){var F={NW:"*.Dom.select",MooTools:"$$",DOMAssistant:"*.$",Prototype:"$$",YAHOO:"*.util.Selector.query",Sizzle:"*",jQuery:"*",dojo:"*.query"},B,x=[],v=[],V=0,U=!0,T="slvzr",Z=/(\/\*[^*]*\*+([^\/][^*]*\*+)*\/)\s*?/g,$=/@import\s*(?:(?:(?:url\(\s*(['"]?)(.*)\1)\s*\))|(?:(['"])(.*)\3))\s*([^;]*);/g,aa=/(behavior\s*?:\s*)?\burl\(\s*(["']?)(?!data:)([^"')]+)\2\s*\)/g,Q=/^:(empty|(first|last|only|nth(-last)?)-(child|of-type))$/,H=/:(:first-(?:line|letter))/g,I=/((?:^|(?:\s*})+)(?:\s*@media[^{]+{)?)\s*([^\{]*?[\[:][^{]+)/g,
M=/([ +~>])|(:[a-z-]+(?:\(.*?\)+)?)|(\[.*?\])/g,S=/(:not\()?:(hover|enabled|disabled|focus|checked|target|active|visited|first-line|first-letter)\)?/g,W=/[^\w-]/g,P=/^(INPUT|SELECT|TEXTAREA|BUTTON)$/,O=/^(checkbox|radio)$/,z=6<q?/[\$\^*]=(['"])\1/:null,K=/([(\[+~])\s+/g,L=/\s+([)\]+~])/g,X=/\s+/g,D=/^\s*((?:[\S\s]*\S)?)\s*$/,k="",u=" ",m="$1",t=g.getElementsByTagName("BASE"),Y=0<t.length?t[0].href:g.location.href;ba();da(n,function(){for(var a in F){var b,d,c=n;if(n[a]){for(b=F[a].replace("*",a).split(".");(d=
b.shift())&&(c=c[d]););if("function"==typeof c){B=c;ca();break}}}})}})(this);