var CSSTools=Class.create({initialize:function(){var aa;var ba;this.resetColors();},getRule:function(ca,da){ca=ca.toLowerCase();if(document.styleSheets){for(var i=0;i<document.styleSheets.length;i++){var ea=document.styleSheets[i];var ii=0;var fa=false;do{if(ea.cssRules){fa=ea.cssRules[ii];}
else{fa=ea.rules[ii];}
if(fa){if(fa.selectorText.toLowerCase()==ca){if(da=='delete'){if(ea.cssRules){ea.deleteRule(ii);}
else{ea.removeRule(ii);}
return true;}
else{return fa;}}}
ii++;}
while(fa)}}
return false;},killRule:function(ga){return getRule(ga,'delete');},addRule:function(ha){if(document.styleSheets){if(!getCSSRule(ha)){if(document.styleSheets[0].addRule){document.styleSheets[0].addRule(ha,null,0);}
else{document.styleSheets[0].insertRule(ha+' { }',0);}}}
return getCSSRule(ha);},setRuleColor:function(ia,ja,ka){var la=this.getSheetRule(ia,ja);if(la){la.style.color=ka;}},setRuleBackgroundColor:function(ma,na,oa){var pa=this.getSheetRule(ma,na);if(pa){pa.style.backgroundColor=oa;}},getRuleColor:function(qa,ra){var sa=this.getSheetRule(qa,ra);if(sa){return sa.style.color;}
return false;},getSheetRule:function(ta,ua){ua=ua.toLowerCase();if(document.styleSheets){for(var i=0;i<document.styleSheets.length;i++){var va=document.styleSheets[i];if(va.href.indexOf(ta)>0){var ii=0;var wa=false;do{if(va.cssRules){wa=va.cssRules[ii];}
else{wa=va.rules[ii];}
if(wa){if(wa.selectorText.toLowerCase()==ua){return wa;}}
ii++;}
while(wa)return false;}}}
return false;},resetColors:function(){this.removedcolors=["#FFFFFF"];this.removedcolors.shift();this.colors=["#EC1A48","#EE4823","#EDC31A","#0E9246","#21BBD0","#E280B3","#A072C0"];},removeColor:function(xa){var n=this.colors.length,k,t;if(n==0)return false;while(n>0){t=this.colors[--n];if(t==xa){this.removedcolors.unshift(t);this.colors[n]=this.colors[0];this.colors.shift();n=0;}}},removeColorByName:function(ya,za){var Aa=this.getRule(ya);if(Aa){this.removeColor(za);return za;}
return false;},shuffleColors:function(){var n=this.colors.length,k,t;if(n>0){while(--n){k=Math.floor(Math.random()*(n+1));t=this.colors[n];this.colors[n]=this.colors[k];this.colors[k]=t;}}
n=this.removedcolors.length;if(n>0){while(--n){k=Math.floor(Math.random()*(n+1));t=this.removedcolors[n];this.removedcolors[n]=this.removedcolors[k];this.removedcolors[k]=t;}}},getFirstColor:function(){return this.colors[0];},getRemovedColor:function(){var n=this.removedcolors.length;if(n==0)return this.getFirstColor();this.shuffleColors();return this.removedcolors[0];},getRandomColor:function(Ba){this.shuffleColors();this.shuffleColors();var Ca=this.getFirstColor();if(Ba){this.removedcolors.unshift();this.removedcolors[0]=this.colors[0];this.colors.shift();}
return Ca;},updateColors:function(Da){this.setRuleColor('boxes','.couleur',Da);this.setRuleColor('boxes','.tabs li.active a, .tabs li.active a:hover',Da);},updateCharte:function(Ea,Fa){for(i=0;i<Ea.length;i++){var Ga=Ea[i];var el=document.getElementById(Ga);if(el){el.style.display=Fa[i];}}},updateFocus:function(Ha,Ia,Ja){if(Ha==1){el=document.getElementById('focus_text');if(el){el.innerHTML=Ia;}
elt=document.getElementById('focus_text_teaser');if(elt){var Ka=CSSLeft(Ia,105)+'...';elt.innerHTML=Ka;}
el=document.getElementById('stickers_text');if(el){el.innerHTML=Ja;}}
else{el=document.getElementById('focus-formulation');if(el){el.style.display='hidden';}}},refreshElement:function(id){el=document.getElementById(id);if(el){dis=el.style.display;el.style.display='hidden';el.style.display=dis;}}});function CSSLeft(La,n){var Ma="";var st=String(La);var ln=st.length;if(n<=0)return Ma;else if(n>ln)Ma=La;else Ma=st.substring(0,n);var lr=String(Ma).length;for(i=lr;i<ln;i++){var c=st.charAt(i);if(c!=" "){Ma=Ma+c;}
else{i=ln+1;}}
return Ma;}