/***
 * Excerpted from "HTML5 and CSS3",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/bhh5 for more book information.
***/
/*
IE-CSS3.js v0.9.4b - (c) 2009 by Keith Clark, freely distributable under the terms of the MIT license.
www.keithclark.co.uk/labs/ie-css3/
*/
(function(){function F(){if(window.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null}function i(a,b,c){var d=" "+a.className+" ",e=" "+b+" ";if(c){if(d.indexOf(e)>-1)return;a.className+=" "+b}else{if(d.indexOf(e)==-1)return;a.className=u(d.replace(e," "))}if(a.parentNode)a.parentNode.className+=""}function v(a){var b,c=[];m.open("GET",a,false);m.send();for(var d=G(m.status==200?m.responseText:""),e=0;e<d.imports.length;e++)if(b=w(d.imports[e],a)){b=v(b);c=c.concat(b)}return c.concat(d.a)}function r(a){try{return x(a)||[]}catch(b){return[]}}function y(){i(event.srcElement,k+"hover",event.type=="mouseenter")}function z(){i(event.srcElement,k+"focus",event.type=="focus")}function H(a){(a=s(a,"disabled"))&&i(a,k+"disabled",a.disabled)}function I(a){(a=s(a,"disabled"))&&i(a,k+"enabled",!a.disabled)}function J(a){(a=s(a,"checked"))&&i(a,k+"checked",a.checked)}function s(a,b){return a.nodeType?a:a.propertyName==b?a.srcElement:null}function A(a,b){for(var c in b){a.attachEvent(c,b[c]);c=="onpropertychange"&&b[c](a)}}function t(a,b){for(var c=a.length-1;c>=0;c--)b(a[c])}function u(a){return a.replace(K,"$1")}function G(a){var b,c,d,e,g,n,B,o,j,f,C=[];a=a.replace(L,"");a=a.replace(M,function(h,T,N){C.push(N);return""});if(e=a.match(O))for(var p=0;p<e.length;p++){ruleSet=P.exec(e[p]);n=ruleSet[1].split(",");B=ruleSet[2];for(var q=0;q<n.length;q++){g=n[q].replace("::",":");if(g.indexOf(":not(")==-1){if(b=D.exec(g))for(;b;){a=b[0];b=b.index;c=a.length;c=b+c;o=u(g.substring(0,c));j=o.substring(0,o.length-a.length);if(j==""||j.charAt(j.length-1)==" ")j+="*";d=k+a.replace(Q,"").replace(R,"-");switch(a){case ":hover":f={onmouseenter:y,onmouseleave:y};case ":focus":f||(f={onfocus:z,onblur:z});t(r(j),function(h){A(h,f)});f=null;break;case ":checked":f=J;case ":disabled":f||(f=H);case ":enabled":f||(f=I);t(r(j),function(h){if(h.tagName=="INPUT"||h.tagName=="SELECT"||h.tagName=="BUTTON")A(h,{onpropertychange:f})});f=null;break;case ":root":i(document.documentElement,d,true);break;default:t(r(o),function(h){i(h,d,true)});break}g=g.substring(0,b)+"."+d+g.substring(c);b=D.exec(g)}n[q]=g}}e[p]=n.join(" ,")+" {"+B+"}"}return{imports:C,a:e||[]}}function w(a,b){if(/^https?:\/\//.test(a))return 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;if(b.charAt(b.length-1)!="/")b=b.substring(0,b.lastIndexOf("/")+1);return b+a}var S=/*@cc_on!@*/false,l=/MSIE ([\d])/.exec(navigator.userAgent),m=F();if(!(!S||!l||!m||(l=parseInt(l[1]))>8)){var O=/\s*([a-zA-Z\.#@*:][\w\W]*?{[^{}]*(}|{[\w\W]*?}\s*}))/g,M=/@import\s*url\(\s*(["'])?(.*?)\1\s*\)[\w\W]*?;/g,L=/\/\*[^*]*\*+([^\/][^*]*\*+)*\//g,P=/^([\w\W]*?)\s*{\s*([\w\W]*?)\s*}$/,Q=/[):\s]/g,R=/[(+]/g,D=new RegExp(":(?:(?:(?:"+(l<7?"first|":"")+"last|only)-child|(?:only|first|last)-of-type|empty|root|checked|enabled|disabled"+(l<7?"|hover":"")+(l<8?"|focus":"")+")|(?:(?:nth-(?:last-)?(?:child|of-type))\\(([^)]*?)\\)))","g"),K=/^\s*((?:[\S\s]*\S)?)\s*$/,x,k="iecss3-",E={DOMAssistant:"DOMAssistant.$",NW:"NW.Dom.select",Prototype:"$$",YAHOO:"YAHOO.util.Selector.query",MooTools:"$$",Sizzle:"Sizzle",jQuery:"jQuery",Sly:"Sly.search"};document.write("<script id=iecss3DOMReady defer src=javascript:void(0)><\/script>");document.getElementById("iecss3DOMReady").onreadystatechange=function(){if(this.readyState=="complete"){var a;a:{for(a in E)if(window[a])if(x=eval(E[a])){a=true;break a}a=false}if(a){var b;a=document.getElementsByTagName("BASE");for(var c=a.length>0?a[0].href:document.location.href,d=0;d<document.styleSheets.length;d++){a=document.styleSheets[d];if(a.href!="")if(b=w(a.href,c))a.cssText=v(b).join("\n")}this.parentNode.removeChild(this)}}}}})();