(function($){ $.fn.jqdrag=function(h){return i(this,h,'d');}; $.fn.jqresize=function(h){return i(this,h,'r');}; $.jqdnr={dnr:{},e:0, drag:function(v){ if(m.k == 'd')e.css({left:m.x+v.pagex-m.px,top:m.y+v.pagey-m.py}); else e.css({width:math.max(v.pagex-m.px+m.w,0),height:math.max(v.pagey-m.py+m.h,0)}); return false;}, stop:function(){e.css('opacity',1);$().unbind('mousemove',j.drag).unbind('mouseup',j.stop);} }; var j=$.jqdnr,m=j.dnr,e=j.e, i=function(e,h,k){return e.each(function(){h=(h)?$(h,e):e; h.bind('mousedown',{e:e,k:k},function(v){var d=v.data,p={};e=d.e; // attempt utilization of dimensions plugin to fix ie issues if(v.button==2)return; if(e.css('position') != 'relative'){try{e.position(p);}catch(e){}} m={x:p.left||f('left')||0,y:p.top||f('top')||0,w:f('width')||e[0].scrollwidth||0,h:f('height')||e[0].scrollheight||0,px:v.pagex,py:v.pagey,k:d.k,o:e.css('opacity')}; e.css({opacity:0.5});$().mousemove($.jqdnr.drag).mouseup($.jqdnr.stop); return false; }); });}, f=function(k){return parseint(e.css(k))||false;}; })(jquery);