var mooSelectSlider=new Class({version:1.2,Implements:[Options,Events],options:{selector:"extStyleSlider",sliderClass:"extStyleSliderSlider",knobClass:"extStyleSliderKnob",tipClass:"extStyleSliderTip",stepsClass:"extStyleSliderSteps",ignoreFirstOption:true,showSteps:true},initialize:function(a){this.setOptions(a);var b=$$("select."+this.options.selector);if(!b.length){return"nothing to do, selector came up empty!"}b.each(this.replaceSelect.bind(this))},replaceSelect:function(d){var d=document.id(d);if(!d){return}var c=d.getElements("option");var a=0;if(this.options.ignoreFirstOption){c=c.filter(function(g,f){return f>0})}c.each(function(g,f){if(g.getProperty("selected")){a=f}});if(d.retrieve("sliderElement")){d.retrieve("sliderElement").dispose()}if(d.retrieve("knobElement")){d.retrieve("knobElement").dispose()}if(d.retrieve("tipElement")){d.retrieve("tipElement").dispose()}if(d.retrieve("stepsElement")){d.retrieve("stepsElement").dispose()}d.store("sliderElement",new Element("div",{"class":this.options.sliderClass,styles:{position:"relative"}}).inject(d,"after"));var b=d.retrieve("sliderElement").getSize();var e=Math.ceil((100/c.length)/100*b.x);d.store("knobElement",new Element("div",{"class":this.options.knobClass,styles:{width:e+"px"}}).inject(d.retrieve("sliderElement")));b.x=Math.ceil(b.x/c.length-e/c.length)*c.length+e;d.retrieve("sliderElement").setStyle("width",b.x+"px");d.store("tipElement",new Element("div",{"class":this.options.tipClass,styles:{}}).inject(d.retrieve("knobElement")));d.store("slider",new Slider(d.retrieve("sliderElement"),d.retrieve("knobElement"),{range:[0,c.length-1],steps:c.length,snap:true,onChange:function(f){d.set("value",c[f].get("value"));d.retrieve("tipElement").set("html",c[f].get("html"))}}).set(a));if(this.options.showSteps){d.store("stepsElement",new Element("ol",{"class":this.options.stepsClass,styles:{position:"absolute",left:Math.ceil((b.x-e*c.length)/2)+"px",top:0,margin:0,padding:0,"z-index":-2,width:e*c.length+"px"}}).inject(d.retrieve("sliderElement"),"bottom"));for(index=0;index<c.length;index++){new Element("li",{styles:{width:"10px","float":"left",display:"block",width:e+"px",height:b.y+"px",margin:0,padding:0}}).inject(d.retrieve("stepsElement"),"bottom")}}d.setStyle("display","none")}});
