$(".glfaq-link").bind("click",function(a){$(this).popupOpen({type:"note",url:$(this).attr("href"),title:$(this).attr("title")});return false});var gl_sliders={params:{currentSid:"",currentHandle:""},onSlide:function(c,b){var a=this.getValue(c);$("#ch-"+this.sliders[this.params.currentSid].real_id+"-"+this.params.currentHandle).attr("value",a)},getValue:function(a){var b=this.sliders[this.params.currentSid].result[$(a).slider("option","values")[this.params.currentHandle]];return(b=="")?"":Number(b).toFixed(this.sliders[this.params.currentSid].precision)},onStop:function(a){mvc.map("ngcheckbox").obj(this.sliders[this.params.currentSid].real_id+"-"+this.params.currentHandle).prop("value",this.getValue(a));mvc.map("ngcheckbox").obj(this.sliders[this.params.currentSid].real_id+"-"+this.params.currentHandle).prop("checked",true);gl_filters.countOffers("ch-"+this.sliders[this.params.currentSid].real_id+"-"+this.params.currentHandle)},setHandleFromInput:function(b){var e=this.getSliderParamsFromInput(b);var d=(e.side==1)?0:1;var c=Number($(b).attr("value")),a=Number($("#ch-"+e.real_id+"-"+d).attr("value"));if(e.side==0){if(c==""||c<=a||a==""){var f=this.convertHumanToSlider(c,e);$("#slider_"+e.real_id).slider("values",e.side,f)}}else{if(c==""){var f=this.convertHumanToSlider(c,e);$("#slider_"+e.real_id).slider("values",e.side,f)}else{if(c>=a){var f=this.convertHumanToSlider(c,e);$("#slider_"+e.real_id).slider("values",e.side,f)}}}},convertHumanToSlider:function(b,d){var f=0,e=this.sliders["slider_"+d.real_id];if(b==""&&d.side==0){f=0;return f}else{if(b==""&&d.side==1){f=e.w;return f}}(d.side==1)?f=e.w:true;var a=e.result.length;for(var c=0;c<a;c++){if(b>=e.result[c]&&b<=e.result[c+1]){f=c;break}}return f},getSliderParamsFromInput:function(a){var d=$(a).attr("id");var c=d.substr(3);var b=c.substr(0,c.indexOf("-"));var e=c.substr(c.indexOf("-")+1);return{real_id:b,side:e}},initSlidersProps:function(){for(var e in this.sliders){var g=this.sliders[e].diap.length;var a=this.sliders[e].w/(g-1);this.sliders[e].valueDiap=[];this.sliders[e].pixelDiap=[];this.sliders[e].diapScale=[];for(var c=0;c<g-1;c++){var d=this.sliders[e].diap[c+1]-this.sliders[e].diap[c];this.sliders[e].valueDiap.push(d);this.sliders[e].pixelDiap.push(a*(c+1))}var m=this.sliders[e].pixelDiap.shift(),b=0,l=0;this.sliders[e].result=[];for(var f=0;f<this.sliders[e].w;f++){if(f<m-1){this.sliders[e].result[f]=(f-b)/(m-b)*this.sliders[e].valueDiap[l]+this.sliders[e].diap[l]}else{b=m;m=this.sliders[e].pixelDiap.shift();l++;this.sliders[e].result[f]=this.sliders[e].diap[l]}}this.sliders[e].result[0]="";this.sliders[e].result[this.sliders[e].w-1]="";$("#"+e).removeClass("ui-corner-all").find("a.ui-slider-handle").eq(0).addClass("ui-slider-handle-left").removeClass("ui-corner-all").end().eq(1).addClass("ui-slider-handle-right").removeClass("ui-corner-all")}}};