/*______________
|       ______  |   U I Z E     J A V A S C R I P T     A P I
|     /      /  |   -----------------------------------------
|    /    O /   |    MODULE : Uize.Widget.Bar Class (version 1.2.0)
|   /    / /    |    AUTHOR : Chris van Rensburg (http://www.tomkidding.com)
|  /    / /  /| |    ONLINE : http://www.tomkidding.com/uize/uize-js-api
| /____/ /__/_| | COPYRIGHT : (c)2005-2006 Chris van Rensburg
|           |__ |   LICENSE : Distributed under the terms of the GNU General Public License
|_______________|             http://www.gnu.org/licenses/gpl.txt
*/
(function(){var c_a=true,c_b=false,c_c=Uize.Element;var c_d=Uize.Widget,c_e=c_d.Bar=c_d.subclass(),c_f=c_e.prototype;c_f.c_g=function(){var c_h=this,c_i=Math.abs(c_h.c_j-c_h.c_k);if(c_h.c_l!=0)c_h.c_m=c_h.c_k+Math.round((c_h.c_m-c_h.c_k)/c_h.c_l)*c_h.c_l;if(Math.abs(c_h.c_j-c_h.c_m)>c_i){c_h.c_m=c_h.c_k;}else if(Math.abs(c_h.c_m-c_h.c_k)>c_i){c_h.c_m=c_h.c_j;}};c_f.c_n=function(){var c_h=this;if(c_h.wired()){var
 c_o=c_h.c_p=='vertical'?1:0,c_q=c_c.getDimensions(c_h.getNode('track')),c_r=[c_q.width,c_q.height],c_s=c_h.getNode('knob'),c_t=c_c.getDimensions(c_s),c_u=[c_t.width,c_t.height],c_v=Math.round(((c_h.c_m-c_h.c_k)/(c_h.c_j-c_h.c_k))*(c_r[c_o]-c_u[c_o])),c_w=c_o?c_r[1]-c_u[1]-c_v:c_v,c_x=Math.round(c_w+c_u[c_o]/2);c_s.style[c_o?'top':'left']=c_w+'px';c_s.title=c_h.c_m;c_h.setNodeClipRect('full',c_o?c_x:0,c_o?c_r[0]:c_x,c_r[1],0);c_h.setNodeClipRect('empty',0,c_r[0],c_o?c_x:c_r[1],c_o?0:c_x);c_h.setNodeInnerHtml('value',c_h.c_y!=null?c_h.c_m.toFixed(c_h.c_y):c_h.c_m);}};c_f.updateUi=c_f.c_n;c_e.presets={};function c_z(){this.c_g();this.c_n();}c_e.registerProperties({c_y:'decimalPlacesToDisplay',c_l:{name:'increments',onChange:c_z},c_k:{name:'minValue',onChange:c_z},c_j:{name:'maxValue',onChange:c_z},c_p:'orientation',c_m:{name:'value',onChange:function(){var c_h=this;c_h.c_g();if(c_h.c_m!=c_h.c_A){c_h.c_A=c_h.c_m;c_h.fireEvent('Value Change');c_h.c_n();}}}});c_e.set({c_y:null,c_l:1,c_k:0,c_j:100,c_p:'vertical',
useNewIdSyntax:c_a,c_m:0});})();
