var form_widget_amount_slider_handle="msc_sliderhandle.gif",slider_handle_image_obj=!1,sliderObjectArray=[],slider_counter=0,slideInProgress=!1,handle_start_x,event_start_x,currentSliderIndex,sliderHandleWidth=9;function form_widget_cancel_event(){return!1}function getImageSliderHeight(){if(!slider_handle_image_obj)slider_handle_image_obj=new Image,slider_handle_image_obj.src=form_widget_amount_slider_handle;0<slider_handle_image_obj.width||setTimeout("getImageSliderHeight()",50)} function positionSliderImage(a,b){b||(b=this.getAttribute("sliderIndex"));var c=sliderObjectArray[b].formTarget.value;c.match(/^[0-9]*$/g)||(c=sliderObjectArray[b].min+"");c/1>sliderObjectArray[b].max&&(c=sliderObjectArray[b].max);c/1<sliderObjectArray[b].min&&(c=sliderObjectArray[b].min);sliderObjectArray[b].formTarget.value=c;document.getElementById("slider_handle"+b).style.left=Math.round((sliderObjectArray[b].formTarget.value-sliderObjectArray[b].min)*(sliderObjectArray[b].width/(sliderObjectArray[b].max- sliderObjectArray[b].min)))+"px"}function adjustFormValue(a){var b=document.getElementById("slider_handle"+a),c=sliderObjectArray[a].width/(sliderObjectArray[a].max-sliderObjectArray[a].min),b=b.style.left.replace("px","");sliderObjectArray[a].formTarget.value=Math.round(b/c)+sliderObjectArray[a].min} function initMoveSlider(a){document.all&&(a=event);slideInProgress=!0;event_start_x=a.clientX;handle_start_x=this.style.left.replace("px","");currentSliderIndex=this.id.replace(/[^\d]/g,"");return!1} function startMoveSlider(a){document.all&&(a=event);if(slideInProgress)a=handle_start_x/1+a.clientX/1-event_start_x,0>a&&(a=0),a/1>sliderObjectArray[currentSliderIndex].width&&(a=sliderObjectArray[currentSliderIndex].width),document.getElementById("slider_handle"+currentSliderIndex).style.left=a+"px",adjustFormValue(currentSliderIndex),sliderObjectArray[currentSliderIndex].onchangeAction&&eval(sliderObjectArray[currentSliderIndex].onchangeAction)}function stopMoveSlider(){slideInProgress=!1} function form_widget_amount_slider(a,b,c,d,e,f){slider_handle_image_obj||getImageSliderHeight();slider_counter+=1;1<slider_counter&&(slider_counter=1,document.getElementById(a).removeChild(document.getElementById("slider_container"+slider_counter)));sliderObjectArray[slider_counter]=[];sliderObjectArray[slider_counter]={width:c-sliderHandleWidth,min:d,max:e,formTarget:b,onchangeAction:f};b.setAttribute("sliderIndex",slider_counter);b.onchange=positionSliderImage;b=document.createElement("DIV");b.style.height= "12px";b.style.position="relative";b.id="slider_container"+slider_counter;document.getElementById(a).appendChild(b);a=document.createElement("DIV");a.className="form_widget_amount_slider";a.innerHTML="<span></span>";a.style.width=c+"px";a.id="slider_slider"+slider_counter;a.style.position="absolute";a.style.bottom="0px";b.appendChild(a);c=document.createElement("IMG");c.style.position="absolute";c.style.left="0px";c.style.zIndex=5;c.src=slider_handle_image_obj.src;c.id="slider_handle"+slider_counter; c.onmousedown=initMoveSlider;b.style.width=a.offsetWidth+"px";document.body.onmouseup?-1==document.body.onmouseup.toString().indexOf("stopMoveSlider")&&alert("You allready have an onmouseup event assigned to the body tag"):(document.body.onmouseup=stopMoveSlider,document.body.onmousemove=startMoveSlider);c.ondragstart=form_widget_cancel_event;b.appendChild(c);positionSliderImage(!1,slider_counter)};
