DoubleSlider.isSupported=typeof document.createElement!="undefined"&&typeof document.documentElement!="undefined"&&typeof document.documentElement.offsetWidth=="number";function DoubleSlider(c,d,a,e){if(!c){return}this._orientation=e||"horizontal";this._top_range=new Range();this._top_range.setExtent(0);this._bottom_range=new Range();this._bottom_range.setExtent(0);this._blockIncrement=10;this._unitIncrement=1;this._timer=new Timer(100);if(DoubleSlider.isSupported&&c){this.document=c.ownerDocument||c.document;this.element=c;this.element.double_slider=this;this.element.unselectable="on";this.element.className=this._orientation+" "+this.classNameTag+" "+this.element.className;this.slider_field=this.document.createElement("DIV");this.slider_field.className="slider_field";this.slider_field.unselectable="on";this.slider_field.appendChild(this.document.createElement("DIV"));this.element.appendChild(this.slider_field);this.top_handle=this.document.createElement("DIV");this.top_handle.className="top_handle";this.top_handle.unselectable="on";this.top_handle.appendChild(this.document.createElement("DIV"));this.top_handle.firstChild.appendChild(this.document.createTextNode(String.fromCharCode(160)));this.element.appendChild(this.top_handle);this.bottom_handle=this.document.createElement("DIV");this.bottom_handle.className="bottom_handle";this.bottom_handle.unselectable="on";this.bottom_handle.appendChild(this.document.createElement("DIV"));this.bottom_handle.firstChild.appendChild(this.document.createTextNode(String.fromCharCode(160)));this.element.appendChild(this.bottom_handle)}this.top_input=d;this.bottom_input=a;var b=this;this._top_range.onchange=function(){b.recalculate();if(typeof b.onchange=="function"){b.onchange()}};this._bottom_range.onchange=function(){b.recalculate();if(typeof b.onchange=="function"){b.onchange()}};if(DoubleSlider.isSupported&&c){this.element.onfocus=DoubleSlider.eventHandlers.onfocus;this.element.onblur=DoubleSlider.eventHandlers.onblur;this.element.onmousedown=DoubleSlider.eventHandlers.onmousedown;this.element.onmouseover=DoubleSlider.eventHandlers.onmouseover;this.element.onmouseout=DoubleSlider.eventHandlers.onmouseout;this.element.onkeydown=DoubleSlider.eventHandlers.onkeydown;this.element.onkeypress=DoubleSlider.eventHandlers.onkeypress;this.element.onmousewheel=DoubleSlider.eventHandlers.onmousewheel;this.top_handle.onselectstart=this.bottom_handle.onselectstart=this.element.onselectstart=function(){return false};this._timer.ontimer=function(){b.ontimer()};window.setTimeout(function(){b.recalculate()},1)}else{this.top_input.onchange=function(f){b.setTopValue(b.top_input.value)};this.bottom_input.onchange=function(f){b.setBottomValue(b.bottom_input.value)}}}DoubleSlider.eventHandlers={getEvent:function(b,a){if(!b){if(a){b=a.document.parentWindow.event}else{b=window.event}}if(!b.srcElement){var a=b.target;while(a!=null&&a.nodeType!=1){a=a.parentNode}b.srcElement=a}if(typeof b.offsetX=="undefined"){b.offsetX=b.layerX;b.offsetY=b.layerY}return b},getDocument:function(a){if(a.target){return a.target.ownerDocument}return a.srcElement.document},getDoubleSlider:function(b){var a=b.target||b.srcElement;while(a!=null&&a.double_slider==null){a=a.parentNode}if(a){return a.double_slider}return null},getSliderField:function(b){var a=b.target||b.srcElement;while(a!=null&&a.className!="slider_field"){a=a.parentNode}return a},getTopHandle:function(c){var b=c.target||c.srcElement;var a=/top_handle/;while(b!=null&&!a.test(b.className)){b=b.parentNode}return b},getBottomHandle:function(c){var b=c.target||c.srcElement;var a=/bottom_handle/;while(b!=null&&!a.test(b.className)){b=b.parentNode}return b},onfocus:function(b){var a=this.double_slider;a._focused=true;a.top_handle.className="top_handle hover";a.bottom_handle.className="bottom_handle hover"},onblur:function(b){var a=this.double_slider;a._focused=false;a.top_handle.className="top_handle";a.bottom_handle.className="bottom_handle"},onmouseover:function(b){b=DoubleSlider.eventHandlers.getEvent(b,this);var a=this.double_slider;if(b.srcElement==a.top_handle){a.top_handle.className="top_handle hover"}if(b.srcElement==a.bottom_handle){a.bottom_handle.className="bottom_handle hover"}},onmouseout:function(b){b=DoubleSlider.eventHandlers.getEvent(b,this);var a=this.double_slider;if(b.srcElement==a.top_handle&&!a._focused){a.top_handle.className="top_handle"}if(b.srcElement==a.bottom_handle&&!a._focused){a.bottom_handle.className="bottom_handle"}},onmousedown:function(d){d=DoubleSlider.eventHandlers.getEvent(d,this);var a=this.double_slider;if(a.element.focus){a.element.focus()}DoubleSlider._currentInstance=a;var c=a.document;if(c.addEventListener){c.addEventListener("mousemove",DoubleSlider.eventHandlers.onmousemove,true);c.addEventListener("mouseup",DoubleSlider.eventHandlers.onmouseup,true)}else{if(c.attachEvent){c.attachEvent("onmousemove",DoubleSlider.eventHandlers.onmousemove);c.attachEvent("onmouseup",DoubleSlider.eventHandlers.onmouseup);c.attachEvent("onlosecapture",DoubleSlider.eventHandlers.onmouseup);a.element.setCapture()}}if(DoubleSlider.eventHandlers.getTopHandle(d)){DoubleSlider._sliderDragData={screenX:d.screenX,screenY:d.screenY,dx:d.screenX-a.top_handle.offsetLeft,dy:d.screenY-a.top_handle.offsetTop,startValue:a.getTopValue(),double_slider:a,drag_handle:a.top_handle,handle_offset_h:a.top_handle.offsetWidth/2*-1,handle_offset_v:a.top_handle.offsetHeight/2*-1}}else{if(DoubleSlider.eventHandlers.getBottomHandle(d)){DoubleSlider._sliderDragData={screenX:d.screenX,screenY:d.screenY,dx:d.screenX-a.bottom_handle.offsetLeft,dy:d.screenY-a.bottom_handle.offsetTop,startValue:a.getBottomValue(),double_slider:a,drag_handle:a.bottom_handle,handle_offset_h:a.bottom_handle.offsetWidth/2,handle_offset_v:a.bottom_handle.offsetHeight/2}}else{var b=DoubleSlider.eventHandlers.getSliderField(d);a._mouseX=d.offsetX+(b?a.slider_field.offsetLeft:0);a._mouseY=d.offsetY+(b?a.slider_field.offsetTop:0);a._top_increasing=null;a._bottom_increasing=null;a.ontimer()}}},onmousemove:function(f){f=DoubleSlider.eventHandlers.getEvent(f,this);if(DoubleSlider._sliderDragData){var j=DoubleSlider._sliderDragData.double_slider;var b=DoubleSlider._sliderDragData.drag_handle;var c=j.getMaximum()-j.getMinimum();var k,g,d;var h;if(j._orientation=="horizontal"){k=j.element.offsetWidth-b.offsetWidth;g=f.screenX-DoubleSlider._sliderDragData.dx;d=Math.abs(f.screenY-DoubleSlider._sliderDragData.screenY)>100;h=DoubleSlider._sliderDragData.handle_offset_h}else{k=j.element.offsetHeight-b.offsetHeight;g=j.element.offsetHeight-b.offsetHeight-(f.screenY-DoubleSlider._sliderDragData.dy);d=Math.abs(f.screenX-DoubleSlider._sliderDragData.screenX)>100;h=DoubleSlider._sliderDragData.handle_offset_v}var a=j.getMinimum()+c*(g+h)/k;a=Math.round((a/j._unitIncrement))*j._unitIncrement;j.setValue(d?DoubleSlider._sliderDragData.startValue:a,b);return false}else{var j=DoubleSlider._currentInstance;if(j!=null){var i=DoubleSlider.eventHandlers.getSliderField(f);j._mouseX=f.offsetX+(i?j.slider_field.offsetLeft:0);j._mouseY=f.offsetY+(i?j.slider_field.offsetTop:0)}}},onmouseup:function(c){c=DoubleSlider.eventHandlers.getEvent(c,this);var a=DoubleSlider._currentInstance;var b=a.document;if(b.removeEventListener){b.removeEventListener("mousemove",DoubleSlider.eventHandlers.onmousemove,true);b.removeEventListener("mouseup",DoubleSlider.eventHandlers.onmouseup,true)}else{if(b.detachEvent){b.detachEvent("onmousemove",DoubleSlider.eventHandlers.onmousemove);b.detachEvent("onmouseup",DoubleSlider.eventHandlers.onmouseup);b.detachEvent("onlosecapture",DoubleSlider.eventHandlers.onmouseup);a.element.releaseCapture()}}if(DoubleSlider._sliderDragData){DoubleSlider._sliderDragData=null}else{a._timer.stop();a._top_increasing=null;a._bottom_increasing=null}DoubleSlider._currentInstance=null},onkeydown:function(c){c=DoubleSlider.eventHandlers.getEvent(c,this);var b=this.double_slider;var a=c.keyCode;switch(a){case 33:b.setTopValue(b.getTopValue()+b.getBlockIncrement());break;case 34:b.setTopValue(b.getTopValue()-b.getBlockIncrement());break;case 35:b.setTopValue(b.getOrientation()=="horizontal"?b.getMaximum():b.getMinimum());break;case 36:b.setTopValue(b.getOrientation()=="horizontal"?b.getMinimum():b.getMaximum());break;case 38:case 39:b.setTopValue(b.getTopValue()+b.getUnitIncrement());break;case 37:case 40:b.setTopValue(b.getTopValue()-b.getUnitIncrement());break}if(a>=33&&a<=40){return false}},onkeypress:function(b){b=DoubleSlider.eventHandlers.getEvent(b,this);var a=b.keyCode;if(a>=33&&a<=40){return false}},onmousewheel:function(b){b=DoubleSlider.eventHandlers.getEvent(b,this);var a=this.double_slider;if(a._focused){a.setTopValue(a.getTopValue()+b.wheelDelta/120*a.getUnitIncrement());return false}}};DoubleSlider.prototype.classNameTag="double-slider-control",DoubleSlider.prototype.setValue=function(a,b){if(b==this.top_handle){this.setTopValue(a)}else{this.setBottomValue(a)}};DoubleSlider.prototype.setTopValue=function(a){this._top_range.setValue(a);this.top_input.value=this.getTopValue();if(this.getBottomValue()>a){this.setBottomValue(a)}};DoubleSlider.prototype.setBottomValue=function(a){this._bottom_range.setValue(a);this.bottom_input.value=this.getBottomValue();if(this.getTopValue()<a){this.setTopValue(a)}};DoubleSlider.prototype.getTopValue=function(){return this._top_range.getValue()};DoubleSlider.prototype.getBottomValue=function(){return this._bottom_range.getValue()};DoubleSlider.prototype.setMinimum=function(a){this._top_range.setMinimum(a);this._bottom_range.setMinimum(a);this.bottom_input.value=this.getBottomValue();this.top_input.value=this.getTopValue()};DoubleSlider.prototype.getMinimum=function(){return this._top_range.getMinimum()};DoubleSlider.prototype.setMaximum=function(a){this._top_range.setMaximum(a);this.top_input.value=this.getTopValue();this._bottom_range.setMaximum(a);this.bottom_input.value=this.getBottomValue()};DoubleSlider.prototype.getMaximum=function(){return this._top_range.getMaximum()};DoubleSlider.prototype.setUnitIncrement=function(a){this._unitIncrement=a};DoubleSlider.prototype.getUnitIncrement=function(){return this._unitIncrement};DoubleSlider.prototype.setBlockIncrement=function(a){this._blockIncrement=a};DoubleSlider.prototype.getBlockIncrement=function(){return this._blockIncrement};DoubleSlider.prototype.getOrientation=function(){return this._orientation};DoubleSlider.prototype.setOrientation=function(a){if(a!=this._orientation){if(DoubleSlider.isSupported&&this.element){this.element.className=this.element.className.replace(this._orientation,a)}this._orientation=a;this.recalculate()}};DoubleSlider.prototype.recalculate=function(){if(!DoubleSlider.isSupported||!this.element){return}var b=this.element.offsetWidth;var e=this.element.offsetHeight;var i=this.top_handle.offsetWidth;var c=this.top_handle.offsetHeight;var d=this.bottom_handle.offsetWidth;var g=this.bottom_handle.offsetHeight;var f=this.slider_field.offsetWidth;var a=this.slider_field.offsetHeight;if(this._orientation=="horizontal"){this.top_handle.style.left=(b-i)*(this.getTopValue()-this.getMinimum())/(this.getMaximum()-this.getMinimum())+6+"px";this.top_handle.style.top=(e-c)/2+"px";this.slider_field.style.top=(e-a)/2+"px";this.slider_field.style.left=i/2+"px";this.slider_field.style.width=Math.max(0,b-i-2)+"px";this.slider_field.firstChild.style.width=Math.max(0,b-i-4)+"px"}else{this.top_handle.style.left=(b-i)/2+"px";this.top_handle.style.top=(e-c-(e-c)*(this.getTopValue()-this.getMinimum())/(this.getMaximum()-this.getMinimum()))-6+"px";this.slider_field.style.left=(b-f)/2+"px";this.slider_field.style.top=c/2+"px";this.slider_field.style.height=Math.max(0,e-c-2)+"px";this.slider_field.firstChild.style.height=Math.max(0,e-c-4)+"px"}if(this._orientation=="horizontal"){this.bottom_handle.style.left=(b-d)*(this.getBottomValue()-this.getMinimum())/(this.getMaximum()-this.getMinimum())-6+"px";this.bottom_handle.style.top=(e-g)/2+"px";this.slider_field.style.top=(e-a)/2+"px";this.slider_field.style.left=d/2+"px";this.slider_field.style.width=Math.max(0,b-d-2)+"px";this.slider_field.firstChild.style.width=Math.max(0,b-d-4)+"px"}else{this.bottom_handle.style.left=(b-d)/2+"px";this.bottom_handle.style.top=(e-g-(e-g)*(this.getBottomValue()-this.getMinimum())/(this.getMaximum()-this.getMinimum()))+6+"px";this.slider_field.style.left=(b-f)/2+"px";this.slider_field.style.top=g/2+"px";this.slider_field.style.height=Math.max(0,e-g-2)+"px";this.slider_field.firstChild.style.height=Math.max(0,e-g-4)+"px"}};DoubleSlider.prototype.ontimer=function(){var b=this.top_handle.offsetWidth;var d=this.top_handle.offsetHeight;var a=this.top_handle.offsetLeft;var c=this.top_handle.offsetTop;if(this._orientation=="horizontal"){if(this._mouseX>a+b&&(this._top_increasing==null||this._top_increasing)){this.setTopValue(this.getTopValue()+this.getBlockIncrement());this._top_increasing=true}else{if(this._mouseX<a&&(this._top_increasing==null||!this._top_increasing)){this.setTopValue(this.getTopValue()-this.getBlockIncrement());this._top_increasing=false}}}else{if(this._mouseY>c+d&&(this._top_increasing==null||!this._top_increasing)){this.setTopValue(this.getTopValue()-this.getBlockIncrement());this._top_increasing=false}else{if(this._mouseY<c&&(this._top_increasing==null||this._top_increasing)){this.setTopValue(this.getTopValue()+this.getBlockIncrement());this._top_increasing=true}}}b=this.bottom_handle.offsetWidth;d=this.bottom_handle.offsetHeight;a=this.bottom_handle.offsetLeft;c=this.bottom_handle.offsetTop;if(this._orientation=="horizontal"){if(this._mouseX>a+b&&(this._bottom_increasing==null||this._bottom_increasing)){this.setBottomValue(this.getBottomValue()+this.getBlockIncrement());this._bottom_increasing=true}else{if(this._mouseX<a&&(this._bottom_increasing==null||!this._bottom_increasing)){this.setBottomValue(this.getBottomValue()-this.getBlockIncrement());this._bottom_increasing=false}}}else{if(this._mouseY>c+d&&(this._bottom_increasing==null||!this._bottom_increasing)){this.setBottomValue(this.getBottomValue()-this.getBlockIncrement());this._bottom_increasing=false}else{if(this._mouseY<c&&(this._bottom_increasing==null||this._bottom_increasing)){this.setBottomValue(this.getBottomValue()+this.getBlockIncrement());this._bottom_increasing=true}}}this._timer.start()};