/*______________
|       ______  |   U I Z E     J A V A S C R I P T     A P I
|     /      /  |   -----------------------------------------
|    /    O /   |    MODULE : Uize.Widget.ThumbZoom Class (version 1.0.0)
|   /    / /    |    AUTHOR : Chris van Rensburg (http://www.tomkidding.com)
|  /    / /  /| |    ONLINE : http://www.tomkidding.com/uize/uize-js-api
| /____/ /__/_| | COPYRIGHT : (c)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,c_d=document,c_e=c_d.documentElement;var c_f;var c_g=Uize.Widget,c_h=c_g.ThumbZoom=c_g.subclass(function(){var c_i=this;c_i.showFade=new Uize.Fade({duration:350,acceleration:1,deceleration:0});c_i.hideFade=new Uize.Fade({duration:250,acceleration:0,deceleration:1,startValue:1,endValue:0});c_i.shieldFade=new Uize.Fade({duration:3000,acceleration:1,deceleration:0,startValue:0,endValue:1
});}),c_j=c_h.prototype;c_j.wireUi=function(){var c_i=this;if(!c_i.wired()){var c_k,c_l,c_m=c_i.showFade,c_n=c_i.hideFade,c_o=c_i.shieldFade;function c_p(){if(!c_l){c_l=c_d.createElement('img');c_c.setStyle(c_l,{display:'none',position:'absolute',zIndex:50001});c_i.wireNodeEvent(c_l,'onload',function(c_q){c_c.display(c_l);c_c.setOpacity(c_l,1);var c_r=c_c.getCoords(c_k),c_s=c_c.getDimensions(window),c_t=c_g.ImagePort.getScaledRect({portWidth:c_s.width,portHeight:c_s.height,rectWidth:c_l.width,rectHeight:c_l.height,alignX:.5,alignY:.5,sizingLowerBound:0,sizingUpperBound:'fit',sizingValue:.95,maxScaling:1});c_t.left+=c_e.scrollLeft;c_t.top+=c_e.scrollTop;var c_u=c_d.onkeydown,c_v=c_d.onmousemove,c_w=c_d.onmousedown,c_x=c_q.clientX,c_y=c_q.clientY;function c_z(){c_m.stop();c_d.onmousemove=c_v;c_d.onmousedown=c_w;c_d.onkeydown=c_u;c_o.stop();c_c.display(c_f,c_b);c_n.start();return c_b;}c_d.onkeydown=c_d.onmousedown=c_z;c_d.onmousemove=function(c_q){c_q=c_q||event;
return c_q.clientX!=c_x||c_q.clientY!=c_y?c_z():c_b;};function c_A(c_r){return[c_r.left,c_r.top,c_r.width,c_r.height];}c_m.set({startValue:c_A(c_r),endValue:c_A(c_t)});c_m.start();});c_d.body.appendChild(c_l);if(!c_f)c_f=c_g.Drag.insertShield({zIndex:50000,backgroundColor:'#000'});c_m.addEventHandlers({Advance:function(){c_c.setCoords(c_l,c_m.get('value'));},Done:function(){c_c.setOpacity(c_f,0);c_c.display(c_f);c_o.start();}});c_n.addEventHandlers({Advance:function(){c_c.setOpacity(c_l,c_n.get('value'));},Done:function(){c_c.display(c_l,c_b);}});c_o.addEventHandlers({Advance:function(){c_c.setOpacity(c_f,c_o.get('value'));}});}}function c_B(c_C){c_i.wireNodeEvent(c_C,'onclick',function(){c_k=c_C;var c_D=c_b,c_E=c_C;while(c_E&&c_E.tagName!='A')c_E=c_E.parentNode;if(c_E){var c_F=c_E.getAttribute('href');if(c_F.search(/\.(jpg|jpeg|gif|png)/)){c_p();c_c.setStyle(c_l,{width:'',height:'',left:'-10000px',top:'-10000px'});c_l.src=c_E.href;c_D=c_a;}}return!c_D;});}var c_G=c_i.c_H;for(var c_I=0;c_I<c_G.length;c_I++)
c_B(c_G[c_I]);}};c_h.registerProperties({c_H:'thumbNodes'});c_h.set({c_H:[],useNewIdSyntax:c_a});})();
