function Drags(obj){

  var drag=document.getElementById(obj);
  if(!drag){return}
  //var longbar=getByClass(drag,"long_bar")[0];拖拽区域宽度
  var smallbar=getByClass(drag,"small_bar")[0];//拖拽灰色区域
  var arrbtn=drag.getElementsByTagName("a")[0];//拖拽模块
  var minP=drag.getElementsByTagName("b")[0];
  var maxP=drag.getElementsByTagName("b")[1];
  var minprice=parseInt(minP.innerHTML);//最大
  var maxprice=parseInt(maxP.innerHTML);//最小

  var total=maxprice-minprice;
  var Isclick=false;//
  var zindex=2;

  smallbar.style.width=100+"%";
  smallbar.style.left=0;
  arrbtn.style.left=100+"%";
  var maxwidth=300;//最大移动值

  arrbtn.onmousedown=function(e){//拖拽模块鼠标按下事件

    Isclick=true;//改变状态
    this.style.zIndex=++zindex;

    var x=(e||window.event).clientX;//鼠标x坐标

    var lenght=this.offsetLeft+(this.offsetWidth/2-1);

    var btn1lenght=0;//0+(arrbtn[0].offsetWidth/2-1);
    var minlenght=Math.max(0,btn1lenght);
    var btn1=this;

    document.onmousemove=function(e){
      if(Isclick){

        var thisX=(e||window.event).clientX;
        var golenght=Math.max(minlenght,Math.min(maxwidth,lenght+(thisX-x)));
        var leftVal=(golenght/maxwidth)*100;

        btn1.style.left=leftVal+"%";
        smallwidth();
        price(maxP,leftVal);

      }else{

        return false;

      }
    //window.getSelection ? window.getSelection.removeAllRanges : document.selection.empty;
    }

    document.onmouseup=btn1.onlosecapture=function(){

      Isclick=false;

      btn1.releaseCapture && btn1.releaseCapture();

    };

    this.setCapture && this.setCapture();
    return false; 
    
  }


  function smallwidth(){

    var left=0;

    var right=parseFloat(arrbtn.style.left);
     
    smallbar.style.width=(right-left>0?Math.floor(right-left):0)+"%";

  function price(obj,leftVal){
      
    //var p=parseInt((total/200)*leftVal)+minprice;
     /* if( p>minprice && p<maxprice ){
       // p=p%5>3?p+(5-(p%5)):p-(p%5);
      }*/
      
      var p=leftVal;
      if(leftVal<=5){
       p=5;
      }else if(leftVal>5&&leftVal<=10){
       p=10;
      }else if(leftVal>10&&leftVal<=15){
      p=15;
      }else if(leftVal>15&&leftVal<=20){
       p=20;
      }else if(leftVal>20&&leftVal<=25){
       p=25;
      }else if(leftVal>25&&leftVal<=30){
       p=30;
      }else if(leftVal>30&&leftVal<=35){
        p=35;
      }else if(leftVal>35&&leftVal<=40){
       p=40;
      }else if(leftVal>40&&leftVal<=45){
       p=45;
      }else if(leftVal>45&&leftVal<=50){
       p=50;
      }else if(leftVal>50&&leftVal<=55){
       p=55;
      }else if(leftVal>55&&leftVal<=60){
       p=60;
      }else if(leftVal>60&&leftVal<=65){
       p=65;
      }else if(leftVal>65&&leftVal<=70){
       p=70;
      }else if(leftVal>70&&leftVal<=75){
       p=75;
      }else if(leftVal>75&&leftVal<=80){
       p=80;
      }else if(leftVal>80&&leftVal<=85){
       p=85;
      }else if(leftVal>85&&leftVal<=90){
       p=90;
      }else if(leftVal>90&&leftVal<=95){
       p=95;
      }else if(leftVal>95&&leftVal<=100){
       p=100;
      }
      obj.innerHTML=p;
  }

}

//class
function getByClass( oParent,sClass ){

  var oParents=oParent||document;

  var aEle=oParents.getElementsByTagName("*");

  var aResult=[];

  var reg=new RegExp("\\b"+sClass+"\\b","i");

  for(var i=0;i<aEle.length;i++){

    if(reg.test(aEle[i].className)){

      aResult.push(aEle[i]);
    }
  }
  return aResult;
}

  }

