;(function($){
$.ui=$.ui||{};
$.extend($.ui,{plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,arguments){var set=instance.plugins[name];if(!set) return;for (var i=0;i<set.length;i++){if (instance.options[set[i][0]]) set[i][1].apply(instance.element,arguments);}}},cssCache:{},css:function(name){if ($.ui.cssCache[name]) return $.ui.cssCache[name];var tmp=$(
'<div class="ui-resizable-gen">'
).addClass(name).css({position:
'absolute'
,top:
'-5000px'
,left:
'-5000px'
,display:
'block'
}).appendTo(
'body'
);
$.ui.cssCache[name]=!!((!
/auto|default/.test(tmp.css(
'cursor'
))||(
/^[1-9]/).test(tmp.css(
'height'
))||(
/^[1-9]/).test(tmp.css(
'width'
))||!(
/none/).test(tmp.css(
'backgroundImage'
))||!(
/transparent|rgba\(0, 0, 0, 0\)/).test(tmp.css(
'backgroundColor'
))));try {$(
'body'
).get(0).removeChild(tmp.get(0));} catch(e){}
return $.ui.cssCache[name];},disableSelection:function(e){e.unselectable=
"on"
;e.onselectstart=function(){return false;};if (e.style) e.style.MozUserSelect=
"none"
;},enableSelection:function(e){e.unselectable=
"off"
;e.onselectstart=function(){return true;};if (e.style) e.style.MozUserSelect=
""
;},hasScroll:function(e,a){var scroll=
/top/.test(a||
"top"
)?
'scrollTop'
:
'scrollLeft'
,has=false;if (e[scroll]>0) return true;e[scroll]=1;has=e[scroll]>0?true:false;e[scroll]=0;return has;}});
$.each([
'Left'
,
'Top'
],function(i,name){if(!$.fn[
'scroll'
+name]) $.fn[
'scroll'
+name]=function(v){return v !=undefined?this.each(function(){this==window||this==document?window.scrollTo(name==
'Left'
?v:$(window)[
'scrollLeft'
](),name==
'Top'
?v:$(window)[
'scrollTop'
]()):this[
'scroll'
+name]=v;}):this[0]==window||this[0]==document?self[(name==
'Left'
?
'pageXOffset'
:
'pageYOffset'
)]||$.boxModel&&document.documentElement[
'scroll'
+name]||document.body[
'scroll'
+name]:this[0][
'scroll'
+name ];};});var _remove=$.fn.remove;$.fn.extend({position:function(){var offset=this.offset();var offsetParent=this.offsetParent();var parentOffset=offsetParent.offset();return {top:offset.top-num(this[0],
'marginTop'
)-parentOffset.top-num(offsetParent,
'borderTopWidth'
),left:offset.left-num(this[0],
'marginLeft'
)-parentOffset.left-num(offsetParent,
'borderLeftWidth'
)};},offsetParent:function(){var offsetParent=this[0].offsetParent;while (offsetParent&&(!
/^body|html$/i.test(offsetParent.tagName)&&$.css(offsetParent,
'position'
)==
'static'
))
offsetParent=offsetParent.offsetParent;return $(offsetParent);},mouseInteraction:function(o){return this.each(function(){new $.ui.mouseInteraction(this,o);});},removeMouseInteraction:function(o){return this.each(function(){if($.data(this,
"ui-mouse"
))
$.data(this,
"ui-mouse"
).destroy();});},remove:function(){jQuery(
"*"
,this).add(this).trigger(
"remove"
);return _remove.apply(this,arguments);}});function num(el,prop){return parseInt($.curCSS(el.jquery?el[0]:el,prop,true))||0;};
$.ui.mouseInteraction=function(element,options){var self=this;this.element=element;$.data(this.element,
"ui-mouse"
,this);this.options=$.extend({},options);$(element).bind(
'mousedown.draggable'
,function(){return self.click.apply(self,arguments);});if($.browser.msie) $(element).attr(
'unselectable'
,
'on'
);
$(element).mouseup(function(){if(self.timer) clearInterval(self.timer);});};$.extend($.ui.mouseInteraction.prototype,{destroy:function(){$(this.element).unbind(
'mousedown.draggable'
);},trigger:function(){return this.click.apply(this,arguments);},click:function(e){if(e.which !=1
||$.inArray(e.target.nodeName.toLowerCase(),this.options.dragPrevention||[]) !=-1
||(this.options.condition&&!this.options.condition.apply(this.options.executor||this,[e,this.element]))
) return true;var self=this;var initialize=function(){self._MP={left:e.pageX,top:e.pageY};
$(document).bind(
'mouseup.draggable'
,function(){return self.stop.apply(self,arguments);});$(document).bind(
'mousemove.draggable'
,function(){return self.drag.apply(self,arguments);});if(!self.initalized&&Math.abs(self._MP.left-e.pageX)>=self.options.distance||Math.abs(self._MP.top-e.pageY)>=self.options.distance){if(self.options.start) self.options.start.call(self.options.executor||self,e,self.element);if(self.options.drag) self.options.drag.call(self.options.executor||self,e,this.element);
self.initialized=true;}};if(this.options.delay){if(this.timer) clearInterval(this.timer);this.timer=setTimeout(initialize,this.options.delay);} else {initialize();}
return false;},stop:function(e){var o=this.options;if(!this.initialized) return $(document).unbind(
'mouseup.draggable'
).unbind(
'mousemove.draggable'
);if(this.options.stop) this.options.stop.call(this.options.executor||this,e,this.element);$(document).unbind(
'mouseup.draggable'
).unbind(
'mousemove.draggable'
);this.initialized=false;return false;},drag:function(e){var o=this.options;if ($.browser.msie&&!e.button) return this.stop.apply(this,[e]);
if(!this.initialized&&(Math.abs(this._MP.left-e.pageX)>=o.distance||Math.abs(this._MP.top-e.pageY)>=o.distance)){if(this.options.start) this.options.start.call(this.options.executor||this,e,this.element);this.initialized=true;} else {if(!this.initialized) return false;}
if(o.drag) o.drag.call(this.options.executor||this,e,this.element);return false;}});})(jQuery);
;(function($){$.fn.extend({slider:function(options){var args=Array.prototype.slice.call(arguments,1);if (options==
"value"
)
return $.data(this[0],
"slider"
).value(arguments[1]);return this.each(function(){if (typeof options==
"string"
){var slider=$.data(this,
"slider"
);if (slider) slider[options].apply(slider,args);} else if(!$.data(this,
"slider"
))
new $.ui.slider(this,options);});}});$.ui.slider=function(element,options){
var self=this;this.element=$(element);$.data(element,
"slider"
,this);this.element.addClass(
"ui-slider"
);
this.options=$.extend({},$.ui.slider.defaults,options);var o=this.options;$.extend(o,{axis:o.axis||(element.offsetWidth<element.offsetHeight?
'vertical'
:
'horizontal'
),max:!isNaN(parseInt(o.max,10))?{x:parseInt(o.max,10),y:parseInt(o.max,10)}:({x:o.max&&o.max.x||100,y:o.max&&o.max.y||100}),min:!isNaN(parseInt(o.min,10))?{x:parseInt(o.min,10),y:parseInt(o.min,10)}:({x:o.min&&o.min.x||0,y:o.min&&o.min.y||0})});
o.realMax={x:o.max.x-o.min.x,y:o.max.y-o.min.y};
o.stepping={x:o.stepping&&o.stepping.x||parseInt(o.stepping,10)||(o.steps&&o.steps.x?o.realMax.x/o.steps.x:0),y:o.stepping&&o.stepping.y||parseInt(o.stepping,10)||(o.steps&&o.steps.y?o.realMax.y/o.steps.y:0)};$(element).bind(
"setData.slider"
,function(event,key,value){self.options[key]=value;}).bind(
"getData.slider"
,function(event,key){return self.options[key];});
this.handle=$(o.handle,element);if (!this.handle.length){self.handle=self.generated=$(o.handles||[0]).map(function(){var handle=$(
"<div/>"
).addClass(
"ui-slider-handle"
).appendTo(element);if (this.id)
handle.attr(
"id"
,this.id);return handle[0];});}
$(this.handle)
.mouseInteraction({executor:this,delay:o.delay,distance:o.distance !=undefined?o.distance:1,dragPrevention:o.prevention?o.prevention.toLowerCase().split(
','
):[
'input'
,
'textarea'
,
'button'
,
'select'
,
'option'
],start:this.start,stop:this.stop,drag:this.drag,condition:function(e,handle){if(!this.disabled){if(this.currentHandle) this.blur(this.currentHandle);this.focus(handle,1);return !this.disabled;}}})
.wrap(
'<a href="javascript:void(0)" style="cursor:default;"></a>'
)
.parent()
.bind(
'focus'
,function(e){self.focus(this.firstChild);})
.bind(
'blur'
,function(e){self.blur(this.firstChild);})
.bind(
'keydown'
,function(e){if(
/(37|38|39|40)/.test(e.keyCode)){self.moveTo({x:
/(37|39)/.test(e.keyCode)?(e.keyCode==37?
'-'
:
'+'
)+
'='
+self.oneStep(1):null,y:
/(38|40)/.test(e.keyCode)?(e.keyCode==38?
'-'
:
'+'
)+
'='
+self.oneStep(2):null},this.firstChild);}});
this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};
this.element.bind(
'mousedown.slider'
,function(e){self.click.apply(self,[e]);self.currentHandle.data(
"ui-mouse"
).trigger(e);self.firstValue=self.firstValue+1;
});
$.each(o.handles||[],function(index,handle){self.moveTo(handle.start,index,true);});if (!isNaN(o.startValue))
this.moveTo(o.startValue,0,true);
if(this.handle.length==1) this.previousHandle=this.handle;if(this.handle.length==2&&o.range) this.createRange();};$.extend($.ui.slider.prototype,{plugins:{},createRange:function(){this.rangeElement=$(
'<div></div>'
)
.addClass(
'ui-slider-range'
)
.css({position:
'absolute'
})
.appendTo(this.element);this.updateRange();},updateRange:function(){var prop=this.options.axis==
"vertical"
?
"top"
:
"left"
;var size=this.options.axis==
"vertical"
?
"height"
:
"width"
;this.rangeElement.css(prop,parseInt($(this.handle[0]).css(prop),10)+this.handleSize(0,this.options.axis==
"vertical"
?2:1)/2);this.rangeElement.css(size,parseInt($(this.handle[1]).css(prop),10)-parseInt($(this.handle[0]).css(prop),10));},getRange:function(){return this.rangeElement?this.convertValue(parseInt(this.rangeElement.css(this.options.axis==
"vertical"
?
"height"
:
"width"
),10)):null;},ui:function(e){return {instance:this,options:this.options,handle:this.currentHandle,value:this.options.axis !=
"both"
||!this.options.axis?Math.round(this.value(null,this.options.axis==
"vertical"
?2:1)):{x:Math.round(this.value(null,1)),y:Math.round(this.value(null,2))},range:this.getRange()};},propagate:function(n,e){$.ui.plugin.call(this,n,[e,this.ui()]);this.element.triggerHandler(n==
"slide"
?n:
"slide"
+n,[e,this.ui()],this.options[n]);},destroy:function(){this.element
.removeClass(
"ui-slider ui-slider-disabled"
)
.removeData(
"slider"
)
.unbind(
".slider"
);this.handle.removeMouseInteraction();this.generated&&this.generated.remove();},enable:function(){this.element.removeClass(
"ui-slider-disabled"
);this.disabled=false;},disable:function(){this.element.addClass(
"ui-slider-disabled"
);this.disabled=true;},focus:function(handle,hard){this.currentHandle=$(handle).addClass(
'ui-slider-handle-active'
);if(hard) this.currentHandle.parent()[0].focus();},blur:function(handle){$(handle).removeClass(
'ui-slider-handle-active'
);if(this.currentHandle&&this.currentHandle[0]==handle){this.previousHandle=this.currentHandle;this.currentHandle=null;};},value:function(handle,axis){if(this.handle.length==1) this.currentHandle=this.handle;if(!axis) axis=this.options.axis==
"vertical"
?2:1;var value=((parseInt($(handle !=undefined&&handle !==null?this.handle[handle]||handle:this.currentHandle).css(axis==1?
"left"
:
"top"
),10) / (this.actualSize[axis==1?
"width"
:
"height"
]-this.handleSize(null,axis))) * this.options.realMax[axis==1?
"x"
:
"y"
])+this.options.min[axis==1?
"x"
:
"y"
];var o=this.options;if (o.stepping[axis==1?
"x"
:
"y"
]){value=Math.round(value / o.stepping[axis==1?
"x"
:
"y"
]) * o.stepping[axis==1?
"x"
:
"y"
];}
return value;},convertValue:function(value,axis){if(!axis) axis=this.options.axis==
"vertical"
?2:1;return this.options.min[axis==1?
"x"
:
"y"
]+(value / (this.actualSize[axis==1?
"width"
:
"height"
]-this.handleSize(null,axis))) * this.options.realMax[axis==1?
"x"
:
"y"
];},translateValue:function(value,axis){if(!axis) axis=this.options.axis==
"vertical"
?2:1;return ((value-this.options.min[axis==1?
"x"
:
"y"
]) / this.options.realMax[axis==1?
"x"
:
"y"
]) * (this.actualSize[axis==1?
"width"
:
"height"
]-this.handleSize(null,axis));},handleSize:function(handle,axis){if(!axis) axis=this.options.axis==
"vertical"
?2:1;return $(handle !=undefined&&handle !==null?this.handle[handle]:this.currentHandle)[axis==1?
"outerWidth"
:
"outerHeight"
]();},click:function(e){
var pointer=[e.pageX,e.pageY];var clickedHandle=false;this.handle.each(function(){if(this==e.target) clickedHandle=true;});if(clickedHandle||this.disabled||!(this.currentHandle||this.previousHandle)) return;
if(this.previousHandle) this.focus(this.previousHandle,1);
this.offset=this.element.offset();this.moveTo({y:this.convertValue(e.pageY-this.offset.top-this.currentHandle.outerHeight()/2),x:this.convertValue(e.pageX-this.offset.left-this.currentHandle.outerWidth()/2)},null);
},start:function(e,handle){var o=this.options;if(!this.currentHandle) this.focus(this.previousHandle,true);
this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:e.pageY-this.handleOffset.top,left:e.pageX-this.handleOffset.left};this.firstValue=this.value();this.propagate(
'start'
,e);return false;},stop:function(e){this.propagate(
'stop'
,e);if (this.firstValue !=this.value())
this.propagate(
'change'
,e);this.focus(this.currentHandle,true);
return false;},oneStep:function(axis){if(!axis) axis=this.options.axis==
"vertical"
?2:1;return this.options.stepping[axis==1?
"x"
:
"y"
]?this.options.stepping[axis==1?
"x"
:
"y"
]:(this.options.realMax[axis==1?
"x"
:
"y"
] / this.actualSize[axis==1?
"width"
:
"height"
]) * 5;},translateRange:function(value,axis){if (this.rangeElement){if (this.currentHandle[0]==this.handle[0]&&value>=this.translateValue(this.value(1),axis))
value=this.translateValue(this.value(1,axis)-this.oneStep(axis),axis);if (this.currentHandle[0]==this.handle[1]&&value<=this.translateValue(this.value(0),axis))
value=this.translateValue(this.value(0,axis)+this.oneStep(axis));}
if (this.options.handles){var handle=this.options.handles[this.handleIndex()];if (value<this.translateValue(handle.min,axis)){value=this.translateValue(handle.min,axis);} else if (value>this.translateValue(handle.max,axis)){value=this.translateValue(handle.max,axis);}}
return value;},handleIndex:function(){return this.handle.index(this.currentHandle[0])},translateLimits:function(value,axis){if(!axis) axis=this.options.axis==
"vertical"
?2:1;if (value>=this.actualSize[axis==1?
"width"
:
"height"
]-this.handleSize(null,axis))
value=this.actualSize[axis==1?
"width"
:
"height"
]-this.handleSize(null,axis);if (value<=0)
value=0;return value;},drag:function(e,handle){var o=this.options;var position={top:e.pageY-this.offset.top-this.clickOffset.top,left:e.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle) this.focus(this.previousHandle,true);
position.left=this.translateLimits(position.left,1);position.top=this.translateLimits(position.top,2);if (o.stepping.x){var value=this.convertValue(position.left,1);value=Math.round(value / o.stepping.x) * o.stepping.x;position.left=this.translateValue(value,1);}
if (o.stepping.y){var value=this.convertValue(position.top,2);value=Math.round(value / o.stepping.y) * o.stepping.y;position.top=this.translateValue(value,2);}
position.left=this.translateRange(position.left,1);position.top=this.translateRange(position.top,2);if(o.axis !=
"vertical"
) this.currentHandle.css({left:position.left});if(o.axis !=
"horizontal"
) this.currentHandle.css({top:position.top});if (this.rangeElement)
this.updateRange();this.propagate(
'slide'
,e);return false;},moveTo:function(value,handle,noPropagation){var o=this.options;if (handle==undefined&&!this.currentHandle&&this.handle.length !=1)
return false;
if (handle==undefined&&!this.currentHandle)
handle=0;
if (handle !=undefined)
this.currentHandle=this.previousHandle=$(this.handle[handle]||handle);if(value.x !==undefined&&value.y !==undefined){var x=value.x;var y=value.y;} else {var x=value,y=value;}
if(x&&x.constructor !=Number){var me=
/^\-\=/.test(x),pe=
/^\+\=/.test(x);if (me){x=this.value(null,1)-parseInt(x.replace(
'-='
,
''
),10);} else if (pe){x=this.value(null,1)+parseInt(x.replace(
'+='
,
''
),10);}}
if(y&&y.constructor !=Number){var me=
/^\-\=/.test(y),pe=
/^\+\=/.test(y);if (me){y=this.value(null,2)-parseInt(y.replace(
'-='
,
''
),10);} else if (pe){y=this.value(null,2)+parseInt(y.replace(
'+='
,
''
),10);}}
if(o.axis !=
"vertical"
&&x){if(o.stepping.x) x=Math.round(x / o.stepping.x) * o.stepping.x;x=this.translateValue(x,1);x=this.translateLimits(x,1);x=this.translateRange(x,1);this.currentHandle.css({left:x});}
if(o.axis !=
"horizontal"
&&y){if(o.stepping.y) y=Math.round(y / o.stepping.y) * o.stepping.y;y=this.translateValue(y,2);y=this.translateLimits(y,2);y=this.translateRange(y,2);this.currentHandle.css({top:y});}
if (this.rangeElement)
this.updateRange();if (!noPropagation){this.propagate(
'start'
,null);this.propagate(
'stop'
,null);this.propagate(
'change'
,null);this.propagate(
"slide"
,null);}}});$.ui.slider.defaults={handle:
".ui-slider-handle"
};})(jQuery);function resetSlider(e){$(e+
" .sliderbg"
).slider(
"moveTo"
,
"0"
,0).slider(
"moveTo"
,100,1);$(e+
" .plus"
).css(
"display"
,
"inline"
);}
function getStartDisplayValue(e){var _v=$(e+
" .startvalue"
).html();if (_v==
""
){_v=null;}
return _v;}
function getEndDisplayValue(e){var _v=$(e+
" .endvalue"
).html();if (_v==
""
){_v=null;}
return _v;}
function applyrange_v2(obj,key){applyform=$(obj).parents(
"form"
);applyform.children(
"[name=startValue]"
).each(function(){$(this).attr(
"value"
,getStartDisplayValue(key));});applyform.children(
"[name=endValue]"
).each(function(){$(this).attr(
"value"
,getEndDisplayValue(key));});}
function initSlider(elm,minV,maxV,iMin,iMax){iMin=iMin?Math.round((iMin-minV)*100/(maxV-minV)):0;iMax=iMax?Math.round((iMax-minV)*100/(maxV-minV)):100;$(elm+
" .sliderbg"
).slider({steps:1,range:true,startValue:iMin,slide:function(e,ui){$(elm+
" .startvalue"
).html((Math.round((maxV-minV)/100*$(this).slider(
"value"
,0)+minV)).toString());$(elm+
" .endvalue"
).html((Math.round((maxV-minV)/100*$(this).slider(
"value"
,1)+minV)).toString());},change:function(e,ui){var plus=($(this).slider(
"value"
,1)==100)?
"inline"
:
"none"
;$(elm+
" .plus"
).css(
"display"
,plus);if ($(this).slider(
"value"
,0)>0||$(this).slider(
"value"
,1)<100){$(elm).prev(
"a.empty"
).show();} else {$(elm).prev(
"a.empty"
).hide();}}}).slider(
"moveTo"
,iMax.toString(),1);}