/* 
 * CSS Transitions via jQuery Animation 0.3 <http://weston.ruter.net/projects/jquery-css-transitions/>
 *  by Weston Ruter <http://weston.ruter.net/>
 *  inspired by Chris Schneider's CSS Effects powered by mootools <http://playground.chrisbk.de/moofx/>
 *  Copyright 2009, Weston Ruter, Shepherd Interactive <http://www.shepherd-interactive.com/>
 *  License: GPL 3.0 <http://www.gnu.org/licenses/gpl.html>
 */
(function(){var i=jQuery;var k=i('<div style="-moz-transition-duration:1s; -webkit-transition-duration:1s; transition-duration:1s; -moz-binding:none; behavior:none; -ms-behavior:none;"></div>')[0];if(k.style.transitionDuration||k.style.mozTransitionDuration||k.style.webkitTransitionDuration){return}var c;var m=false,h=false;if(k.style.MozBinding){c="MozBinding";m=true}else{if(k.style.behavior){c="behavior";h=true}else{if(k.style.MsBehavior){c="MsBehavior";h=true}else{return}}}var l=["backgroundColor","backgroundImage","backgroundPosition","borderBottomColor","borderBottomWidth","borderColor","borderLeftColor","borderLeftWidth","borderRightColor","borderRightWidth","borderSpacing","borderTopColor","borderTopWidth","borderWidth","bottom","color","crop","fontSize","fontWeight","height","left","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","maxHeight","maxWidth","minHeight","minWidth","opacity","outlineColor","outlineOffset","outlineWidth","paddingBottom","paddingLeft","paddingRight","paddingTop","right","textIndent","textShadow","top","verticalAlign","visibility","width","wordspacing","zIndex","zoom"];var a=window.cssTransitions={rules:[],hackedSelectors:[],baseRules:[],baseRuleLookup:{}};var j={HOVER:1,ACTIVE:2};if(i.browser.msie){a.refreshDOMForMSIE=function(){i(a.hackedSelectors).each(function(){var o=this;i(o.primarySelector).each(function(){var r=i(this);if(!r.data("cssTransitionDescendantSelectors")){r.data("cssTransitionDescendantSelectors",{})}var q=r.data("cssTransitionDescendantSelectors");if(q[o.descendantSelector]&o.type){return}q[o.descendantSelector]|=o.type;switch(o.type){case j.HOVER:var p=function(){window.setTimeout(function(){r.addClass("temporary-ie-class").removeClass("temporary-ie-class");if(o.descendantSelector){r.find(o.descendantSelector).addClass("temporary-ie-class").removeClass("temporary-ie-class")}},0)};r.hover(p,p);break;case j.ACTIVE:r.mousedown(p).mouseup(p)}})})};i(a.refreshDOMForMSIE)}else{a.refreshDOMForMSIE=function(){}}if(window.cssTransitionsBindingURL){a.bindingURL=cssTransitionsBindingURL}else{var b="/";i(document.getElementsByTagName("script")).each(function(){if(this.src.indexOf("css-transitions")!=-1){b=this.src.replace(/[^\/]+$/,"");return true}return this.src.indexOf("jquery-css-transitions")==-1});a.bindingURL=b+"bindings.php"}var e=[];var d=[];var g=0;i(document.styleSheets).each(function(){for(var u=0;u<this.media.length;u++){var r=this.media.item?this.media.item(u):this.media;if(r&&r!="screen"&&r!="all"){return}}var s=this[this.ownerNode?"ownerNode":"owningElement"];var C;switch(s.nodeName.toLowerCase()){case"style":return;C=s.innerHTML;break;case"link":var B=i.ajax({url:s.href,async:false});C=B.responseText;break;default:return}C=C.replace(/\/\*(?!@\s*transition-rule\s*@\*\/)(.|\s)*?\*\//g," ");C=C.replace(/\s+/g," ");var A=this.cssRules?this.cssRules:this.rules;for(var u=0;u<A.length;u++){var w=A[u];var D={selectorText:w.selectorText,style:{},transitionProperty:["all"],transitionDuration:0,transitionTimingFunction:"ease",transitionDelay:0,isBaseRule:false};if(jQuery.browser.msie){D.selectorText=D.selectorText.replace(/((?:\.[a-z\-_]+?)+)(#\w+\S+)/ig,function(G,F,I){var H=F.substr(1).split(/\./).reverse();return I+"."+H.join(".")})}var q="(?:^|})\\s*"+n(D.selectorText)+'\\s*{((?:[^{}"]+|"[^"]+")+)}';var x=new RegExp(q,"i");var E=C.match(x);if(E){if(E[1].indexOf("transition-rule")==-1){continue}var v;v=E[1].match(/transition\s*:.+?\s*(?:;|$)/i);if(v){throw Error("'transition:' shorthand property is not currently supported")}v=E[1].match(/transition-property\s*:\s*(.+?)\s*(?:;|$)/i);if(v){D.transitionProperty=[];i(v[1].split(/\s*,\s*/)).map(function(){D.transitionProperty.push(this.replace(/-([a-z])/,f))});if(D.transitionProperty[0]=="none"){continue}}v=E[1].match(/transition-duration\s*:\s*(\d*\.?\d*)(ms|s)\s*(?:;|$)/i);if(v){D.transitionDuration=(v[2]=="s"?parseFloat(v[1])*1000:parseFloat(v[1]))}v=E[1].match(/transition-delay\s*:\s*(\d*\.?\d*)(ms|s)\s*(?:;|$)/i);if(v){D.transitionDelay=(v[2]=="s"?parseFloat(v[1])*1000:parseFloat(v[1]))}var v=E[1].match(/transition-timing-function\s*:\s*(.+?)\s*(?:;|$)/i);if(v){throw Error("'transition-timing-function:' is not currently supported")}}else{continue}if(D.transitionProperty[0]!="none"&&(D.transitionDelay||D.transitionDuration)){a.baseRules.push({selector:w.selectorText,index:g});D.isBaseRule=true}for(var t=0;t<l.length;t++){var p=l[t];if(w.style[p]){D.style[p]=w.style[p]}}a.rules[g]=D;if(i.browser.msie){var y;if((y=D.selectorText.indexOf(":hover"))!=-1){a.hackedSelectors.push({primarySelector:D.selectorText.substr(0,y),descendantSelector:D.selectorText.substr(y+6).replace(/^\s+$/,""),type:j.HOVER,ruleIndex:g})}if((y=D.selectorText.indexOf(":active"))!=-1){a.hackedSelectors.push({primarySelector:D.selectorText.substr(0,y),descendantSelector:D.selectorText.substr(y+7).replace(/^\s+$/,""),type:j.ACTIVE,ruleIndex:g})}}if(h){var o=a.bindingURL+"?rule="+g;w.style[c]='url("'+o+'")';var z=document.createElement("span");z.style[c]=w.style[c]}else{e.push((function(G,F){return function(){G.style[c]="url('"+a.bindingURL+"#rule"+F+"')"}})(w,g))}g++}});a.applyRule=function(q,s){var w=i(q);var v;if(a.rules[s].isBaseRule){v=a.baseRuleLookup[s]=s}else{v=a.baseRuleLookup[s];if(v==-1){return}else{if(isNaN(v)){i(a.baseRules).each(function(){var y=i(this.selector);for(var x=0;x<y.length;x++){if(q==y[x]){a.baseRuleLookup[s]=v=this.index;break}}});if(isNaN(v)){if(window.console&&console.error){console.error("No base match for ",q)}a.baseRuleLookup[s]=-1;return}}}}var u=a.rules[s];var t=a.rules[v];var r={};if(window.console&&console.info){console.info("CSS Transition Rule: "+u.selectorText)}if(t.transitionProperty[0]=="all"){for(var o in u.style){if(!q.style[o]){w.css(o,w.css(o))}r[o]=u.style[o]}}else{i(t.transitionProperty).each(function(){var x=this;if(!q.style[x]){w.css(x,w.css(x))}if(a.rules[s].style[x]){r[x]=u.style[x]}})}var p=function(){w.stop().animate(r,t.transitionDuration)};if(t.transitionDelay){window.setTimeout(p,t.transitionDelay)}else{p()}};if(m){a.bindingURL+="?count="+g;i.get(a.bindingURL,null,function(o,p){i(e).each(function(){this()})})}function f(p,o){return o.toUpperCase();if(p[1]){return p[1].toUpperCase()}else{return p.toUpperCase()}}function n(p){if(!arguments.callee.sRE){var o=["/",".","*","+","?","|","(",")","[","]","{","}","\\"];arguments.callee.sRE=new RegExp("(\\"+o.join("|\\")+")","g")}return p.replace(arguments.callee.sRE,"\\$1")}})();