Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/EditorContent.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/EditorContent.js,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/EditorContent.js 13 May 2008 18:53:49 -0000 1.5 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/ExtendedFileManager/assets/EditorContent.js 16 Jan 2009 09:05:47 -0000 1.6 @@ -1,662 +1,2 @@ -/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ -/* This file is part of version 0.95 released Mon, 12 May 2008 17:33:15 +0200 */ -/* The URL of the most recent version of this file is http://svn.xinha.webfactional.com/trunk/plugins/ExtendedFileManager/assets/EditorContent.js */ -function MM_findObj(n,d){ -var p,i,x; -if(!d){ -d=document; -} -if((p=n.indexOf("?"))>0&&parent.frames.length){ -d=parent.frames[n.substring(p+1)].document; -n=n.substring(0,p); -} -if(!(x=d[n])&&d.all){ -x=d.all[n]; -} -for(i=0;!x&&i-1&&navigator.appVersion.indexOf("Mac")>-1)){ -ox=0; -oy=0; -if(g.style.left){ -x=parseInt(g.style.left); -y=parseInt(g.style.top); -}else{ -var w1=parseInt(el.style.width); -bx=(a<0)?-5-w1:-10; -a=(Math.abs(a)<1000)?0:a; -b=(Math.abs(b)<1000)?0:b; -if(event==null){ -x=document.body.scrollLeft+bx; -}else{ -x=document.body.scrollLeft+event.clientX+bx; -} -if(event==null){ -y=document.body.scrollTop; -}else{ -y=document.body.scrollTop+event.clientY; -} -} -} -}else{ -if(document.layers){ -x=g.x; -y=g.y; -var q0=document.layers,dd=""; -for(var s=0;s4){ -xx+="px"; -yy+="px"; -} -if(navigator.appVersion.indexOf("MSIE 5")>-1&&navigator.appVersion.indexOf("Mac")>-1){ -xx+=parseInt(document.body.leftMargin); -yy+=parseInt(document.body.topMargin); -xx+="px"; -yy+="px"; -} -e.left=xx; -e.top=yy; -} -pic_x=parseInt(xx); -pic_y=parseInt(yy); -} -} -} -var ie=document.all; -var ns6=document.getElementById&&!document.all; -var dragapproved=false; -var z,x,y,status,ant,canvas,content,pic_width,pic_height,image,resizeHandle,oa_w,oa_h,oa_x,oa_y,mx2,my2; -function init_resize(){ -P7_Snap("theImage","ant",0,0); -if(canvas==null){ -canvas=MM_findObj("imgCanvas"); -} -if(pic_width==null||pic_height==null){ -image=MM_findObj("theImage"); -pic_width=image.width; -pic_height=image.height; -} -if(ant==null){ -ant=MM_findObj("ant"); -} -ant.style.left=pic_x; -ant.style.top=pic_y; -ant.style.width=pic_width; -ant.style.height=pic_height; -ant.style.visibility="visible"; -drawBoundHandle(); -jg_doc.paint(); -} -initEditor=function(){ -init_crop(); -init_resize(); -var _a=MM_findObj("markerImg",window.top.document); -if(_a.src.indexOf("img/t_white.gif")>0){ -toggleMarker(); -} -var _b=document.getElementById("theImage"); -_b._width=_b.width; -_b._height=_b.height; -}; -function init_crop(){ -P7_Snap("theImage","ant",0,0); -} -function setMode(_c){ -mode=_c; -reset(); -} -function reset(){ -if(ant==null){ -ant=MM_findObj("ant"); -} -ant.style.visibility="hidden"; -ant.style.left=0; -ant.style.top=0; -ant.style.width=0; -ant.style.height=0; -mx2=null; -my2=null; -jg_doc.clear(); -if(mode!="measure"){ -showStatus(); -} -if(mode=="scale"){ -init_resize(); -} -P7_Snap("theImage","ant",0,0); -} -function toggleMarker(){ -if(ant==null){ -ant=MM_findObj("ant"); -} -if(ant.className=="selection"){ -ant.className="selectionWhite"; -}else{ -ant.className="selection"; -} -if(jg_doc.getColor()=="#000000"){ -jg_doc.setColor("#FFFFFF"); -}else{ -jg_doc.setColor("#000000"); -} -drawBoundHandle; -jg_doc.paint(); -} -function move(e){ -if(dragapproved){ -var w=ns6?temp1+e.pageX-x:temp1+event.clientX+document.body.scrollLeft-x; -var h=ns6?temp2+e.pageY-y:temp2+event.clientY+document.body.scrollTop-y; -if(ant!=null){ -if(w>=0){ -ant.style.left=x; -ant.style.width=w; -}else{ -ant.style.left=x+w; -ant.style.width=-1*w; -} -if(h>=0){ -ant.style.top=y; -ant.style.height=h; -}else{ -ant.style.top=y+h; -ant.style.height=-1*h; -} -} -showStatus(); -return false; -} -} -function moveContent(e){ -if(dragapproved){ -var dx=ns6?oa_x+e.clientX-x:oa_x+event.clientX-x; -var dy=ns6?oa_y+e.clientY-y:oa_y+event.clientY-y; -ant.style.left=dx; -ant.style.top=dy; -showStatus(); -return false; -} -} -function moveHandle(e){ -if(dragapproved){ -var w=ns6?e.clientX-x:event.clientX-x; -var h=ns6?e.clientY-y:event.clientY-y; -var _16=MM_findObj("constProp",window.top.document); -var _17=document.theImage.height; -var _18=document.theImage.width; -rapp=_18/_17; -rapp_inv=_17/_18; -switch(resizeHandle){ -case "s-resize": -if(oa_h+h>=0){ -ant.style.height=oa_h+h; -if(_16.checked){ -ant.style.width=rapp*(oa_h+h); -ant.style.left=oa_x-rapp*h/2; -} -} -break; -case "e-resize": -if(oa_w+w>=0){ -ant.style.width=oa_w+w; -if(_16.checked){ -ant.style.height=rapp_inv*(oa_w+w); -ant.style.top=oa_y-rapp_inv*w/2; -} -} -break; -case "n-resize": -if(oa_h-h>=0){ -ant.style.top=oa_y+h; -ant.style.height=oa_h-h; -if(_16.checked){ -ant.style.width=rapp*(oa_h-h); -ant.style.left=oa_x+rapp*h/2; -} -} -break; -case "w-resize": -if(oa_w-w>=0){ -ant.style.left=oa_x+w; -ant.style.width=oa_w-w; -if(_16.checked){ -ant.style.height=rapp_inv*(oa_w-w); -ant.style.top=oa_y+rapp_inv*w/2; -} -} -break; -case "nw-resize": -if(oa_h-h>=0&&oa_w-w>=0){ -ant.style.left=oa_x+w; -ant.style.width=oa_w-w; -ant.style.top=oa_y+h; -if(_16.checked){ -ant.style.height=rapp_inv*(oa_w-w); -}else{ -ant.style.height=oa_h-h; -} -} -break; -case "ne-resize": -if(oa_h-h>=0&&oa_w+w>=0){ -ant.style.top=oa_y+h; -ant.style.width=oa_w+w; -if(_16.checked){ -ant.style.height=rapp_inv*(oa_w+w); -}else{ -ant.style.height=oa_h-h; -} -} -break; -case "se-resize": -if(oa_h+h>=0&&oa_w+w>=0){ -ant.style.width=oa_w+w; -if(_16.checked){ -ant.style.height=rapp_inv*(oa_w+w); -}else{ -ant.style.height=oa_h+h; -} -} -break; -case "sw-resize": -if(oa_h+h>=0&&oa_w-w>=0){ -ant.style.left=oa_x+w; -ant.style.width=oa_w-w; -if(_16.checked){ -ant.style.height=rapp_inv*(oa_w-w); -}else{ -ant.style.height=oa_h+h; -} -} -} -showStatus(); -return false; -} -} -function drags(e){ -if(!ie&&!ns6){ -return; -} -var _1a=ns6?e.target:event.srcElement; -var _1b=ns6?"HTML":"BODY"; -while(_1a.tagName!=_1b&&!(_1a.className=="crop"||_1a.className=="handleBox"||_1a.className=="selection"||_1a.className=="selectionWhite")){ -_1a=ns6?_1a.parentNode:_1a.parentElement; -} -if(_1a.className=="handleBox"){ -if(content!=null){ -if(content.width!=null&&content.height!=null){ -content.width=0; -content.height=0; -} -} -resizeHandle=_1a.id; -x=ns6?e.clientX:event.clientX; -y=ns6?e.clientY:event.clientY; -oa_w=parseInt(ant.style.width); -oa_h=parseInt(ant.style.height); -oa_x=parseInt(ant.style.left); -oa_y=parseInt(ant.style.top); -dragapproved=true; -document.onmousemove=moveHandle; -return false; -}else{ -if((_1a.className=="selection"||_1a.className=="selectionWhite")&&mode=="crop"){ -x=ns6?e.clientX:event.clientX; -y=ns6?e.clientY:event.clientY; -oa_x=parseInt(ant.style.left); -oa_y=parseInt(ant.style.top); -dragapproved=true; -document.onmousemove=moveContent; -return false; -}else{ -if(_1a.className=="crop"&&mode=="crop"){ -if(content!=null){ -if(content.width!=null&&content.height!=null){ -content.width=0; -content.height=0; -} -} -if(status==null){ -status=MM_findObj("status"); -} -if(ant==null){ -ant=MM_findObj("ant"); -} -if(canvas==null){ -canvas=MM_findObj("imgCanvas"); -} -if(content==null){ -content=MM_findObj("cropContent"); -} -if(pic_width==null||pic_height==null){ -image=MM_findObj("theImage"); -pic_width=image.width; -pic_height=image.height; -} -ant.style.visibility="visible"; -obj=_1a; -dragapproved=true; -z=_1a; -temp1=parseInt(z.style.left+0); -temp2=parseInt(z.style.top+0); -x=ns6?e.pageX:event.clientX+document.body.scrollLeft; -y=ns6?e.pageY:event.clientY+document.body.scrollTop; -document.onmousemove=move; -return false; -}else{ -if(_1a.className=="crop"&&mode=="measure"){ -if(ant==null){ -ant=MM_findObj("ant"); -} -if(canvas==null){ -canvas=MM_findObj("imgCanvas"); -} -x=ns6?e.pageX:event.clientX+document.body.scrollLeft; -y=ns6?e.pageY:event.clientY+document.body.scrollTop; -dragapproved=true; -document.onmousemove=measure; -return false; -} -} -} -} -} -function measure(e){ -if(dragapproved){ -mx2=ns6?e.pageX:event.clientX+document.body.scrollLeft; -my2=ns6?e.pageY:event.clientY+document.body.scrollTop; -jg_doc.clear(); -jg_doc.setStroke(Stroke.DOTTED); -jg_doc.drawLine(x,y,mx2,my2); -jg_doc.paint(); -showStatus(); -return false; -} -} -function setMarker(nx,ny,nw,nh){ -if(isNaN(nx)){ -nx=0; -} -if(isNaN(ny)){ -ny=0; -} -if(isNaN(nw)){ -nw=0; -} -if(isNaN(nh)){ -nh=0; -} -if(ant==null){ -ant=MM_findObj("ant"); -} -if(canvas==null){ -canvas=MM_findObj("imgCanvas"); -} -if(content==null){ -content=MM_findObj("cropContent"); -} -if(pic_width==null||pic_height==null){ -image=MM_findObj("theImage"); -pic_width=image.width; -pic_height=image.height; -} -ant.style.visibility="visible"; -nx=pic_x+nx; -ny=pic_y+ny; -if(nw>=0){ -ant.style.left=nx; -ant.style.width=nw; -}else{ -ant.style.left=nx+nw; -ant.style.width=-1*nw; -} -if(nh>=0){ -ant.style.top=ny; -ant.style.height=nh; -}else{ -ant.style.top=ny+nh; -ant.style.height=-1*nh; -} -} -function max(x,y){ -if(y>x){ -return x; -}else{ -return y; -} -} -function drawBoundHandle(){ -if(ant==null||ant.style==null){ -return false; -} -var ah=parseInt(ant.style.height); -var aw=parseInt(ant.style.width); -var ax=parseInt(ant.style.left); -var ay=parseInt(ant.style.top); -jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); -jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); -jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); -jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); -jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); -jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); -jg_doc.drawHandle(ax-8,ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); -jg_doc.drawHandle(ax+aw,ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); -jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); -jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); -jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); -jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); -jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); -jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); -jg_doc.drawHandleBox(ax-4,ay+ah/2-4,8,8,"w-resize"); -jg_doc.drawHandleBox(ax+aw-4,ay+ah/2-4,8,8,"e-resize"); -} -function showStatus(){ -if(ant==null||ant.style==null){ -return false; -} -var _27=100/parseInt(window.parent.document.getElementById("zoom").value,10); -if(mode=="measure"){ -mx1=x-pic_x; -my1=y-pic_y; -mw=mx2-x; -mh=my2-y; -md=parseInt(Math.sqrt(mw*mw+mh*mh)*100)/100; -ma=(Math.atan(-1*mh/mw)/Math.PI)*180; -if(mw<0&&mh<0){ -ma=ma+180; -} -if(mw<0&&mh>0){ -ma=ma-180; -} -ma=parseInt(ma*100)/100; -if(m_sx!=null&&!isNaN(mx1)){ -m_sx.value=mx1*_27+"px"; -} -if(m_sy!=null&&!isNaN(my1)){ -m_sy.value=my1*_27+"px"; -} -if(m_w!=null&&!isNaN(mw)){ -m_w.value=mw*_27+"px"; -} -if(m_h!=null&&!isNaN(mh)){ -m_h.value=mh*_27+"px"; -} -if(m_d!=null&&!isNaN(md)){ -m_d.value=md*_27+"px"; -} -if(m_a!=null&&!isNaN(ma)){ -m_a.value=ma+""; -} -if(r_ra!=null&&!isNaN(ma)){ -r_ra.value=ma; -} -return false; -} -var ah=parseInt(ant.style.height); -var aw=parseInt(ant.style.width); -var ax=parseInt(ant.style.left); -var ay=parseInt(ant.style.top); -var cx=ax-pic_x<0?0:ax-pic_x; -var cy=ay-pic_y<0?0:ay-pic_y; -cx=cx>pic_width?pic_width:cx; -cy=cy>pic_height?pic_height:cy; -var cw=ax-pic_x>0?aw:aw-(pic_x-ax); -var ch=ay-pic_y>0?ah:ah-(pic_y-ay); -ch=ay+ah0&&s_sh.value.indexOf("%")>0){ -sw=cw/pic_width; -sh=ch/pic_height; -} -if(s_sw!=null){ -s_sw.value=sw*_27; -} -if(s_sh!=null){ -s_sh.value=sh*_27; -} -} -} -} -function dragStopped(){ -dragapproved=false; -if(ant==null||ant.style==null){ -return false; -} -if(mode=="measure"){ -jg_doc.drawLine(x-4,y,x+4,y); -jg_doc.drawLine(x,y-4,x,y+4); -jg_doc.drawLine(mx2-4,my2,mx2+4,my2); -jg_doc.drawLine(mx2,my2-4,mx2,my2+4); -jg_doc.paint(); -showStatus(); -return false; -} -var ah=parseInt(ant.style.height); -var aw=parseInt(ant.style.width); -var ax=parseInt(ant.style.left); -var ay=parseInt(ant.style.top); -jg_doc.clear(); -if(content!=null){ -if(content.width!=null&&content.height!=null){ -content.width=aw-1; -content.height=ah-1; -} -} -if(mode=="crop"){ -jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern); -var h1=ah; -var y1=ay; -if(ah+ay>=pic_height+pic_y){ -h1=pic_height+pic_y-ay; -}else{ -if(ay<=pic_y){ -h1=ay+ah-pic_y; -y1=pic_y; -} -} -jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern); -jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern); -jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern); -}else{ -if(mode=="scale"){ -document.theImage.height=ah; -document.theImage.width=aw; -document.theImage.style.height=ah+" px"; -document.theImage.style.width=aw+" px"; -P7_Snap("theImage","ant",0,0); -} -} -drawBoundHandle(); -jg_doc.paint(); -showStatus(); -return false; -} -document.onmousedown=drags; -document.onmouseup=dragStopped; - +/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */ +function MM_findObj(f,e){var c,b,a;if(!e){e=document}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b-1&&navigator.appVersion.indexOf("Mac")>-1)){ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top)}else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;if(event==null){x=document.body.scrollLeft+bx}else{x=document.body.scrollLeft+event.clientX+bx}if(event==null){y=document.body.scrollTop}else{y=document.body.scrollTop+event.clientY}}}}else{if(document.layers){x=g.x;y=g.y;var q0=document.layers,dd="";for(var s=0;s4){xx+="px";yy+="px"}if(navigator.appVersion.indexOf("MSIE 5")>-1&&navigator.appVersion.indexOf("Mac")>-1){xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);xx+="px";yy+="px"}e.left=xx;e.top=yy}pic_x=parseInt(xx);pic_y=parseInt(yy)}}}var ie=document.all;var ns6=document.getElementById&&!document.all;var dragapproved=false;var z,x,y,status,ant,canvas,content,pic_width,pic_height,image,resizeHandle,oa_w,oa_h,oa_x,oa_y,mx2,my2;function init_resize(){P7_Snap("theImage","ant",0,0);if(canvas==null){canvas=MM_findObj("imgCanvas")}if(pic_width==null||pic_height==null){image=MM_findObj("theImage");pic_width=image.width;pic_height=image.height}if(ant==null){ant=MM_findObj("ant")}ant.style.left=pic_x;ant.style.top=pic_y;ant.style.width=pic_width;ant.style.height=pic_height;ant.style.visibility="visible";drawBoundHandle();jg_doc.paint()}initEditor=function(){init_crop();init_resize();var b=MM_findObj("markerImg",window.top.document);if(b.src.indexOf("img/t_white.gif")>0){toggleMarker()}var a=document.getElementById("theImage");a._width=a.width;a._height=a.height};function init_crop(){P7_Snap("theImage","ant",0,0)}function setMode(a){mode=a;reset()}function reset(){if(ant==null){ant=MM_findObj("ant")}ant.style.visibility="hidden";ant.style.left=0;ant.style.top=0;ant.style.width=0;ant.style.height=0;mx2=null;my2=null;jg_doc.clear();if(mode!="measure"){showStatus()}if(mode=="scale"){init_resize()}P7_Snap("theImage","ant",0,0)}function toggleMarker(){if(ant==null){ant=MM_findObj("ant")}if(ant.className=="selection"){ant.className="selectionWhite"}else{ant.className="selection"}if(jg_doc.getColor()=="#000000"){jg_doc.setColor("#FFFFFF")}else{jg_doc.setColor("#000000")}drawBoundHandle;jg_doc.paint()}function move(c){if(dragapproved){var a=ns6?temp1+c.pageX-x:temp1+event.clientX+document.body.scrollLeft-x;var b=ns6?temp2+c.pageY-y:temp2+event.clientY+document.body.scrollTop-y;if(ant!=null){if(a>=0){ant.style.left=x;ant.style.width=a}else{ant.style.left=x+a;ant.style.width=-1*a}if(b>=0){ant.style.top=y;ant.style.height=b}else{ant.style.top=y+b;ant.style.height=-1*b}}showStatus();return false}}function moveContent(c){if(dragapproved){var b=ns6?oa_x+c.clientX-x:oa_x+event.clientX-x;var a=ns6?oa_y+c.clientY-y:oa_y+event.clientY-y;ant.style.left=b;ant.style.top=a;showStatus();return false}}function moveHandle(i){if(dragapproved){var b=ns6?i.clientX-x:event.clientX-x;var d=ns6?i.clientY-y:event.clientY-y;var f=MM_findObj("constProp",window.top.document);var c=document.theImage.height;var a=document.theImage.width;rapp=a/c;rapp_inv=c/a;switch(resizeHandle){case"s-resize":if(oa_h+d>=0){ant.style.height=oa_h+d;if(f.checked){ant.style.width=rapp*(oa_h+d);ant.style.left=oa_x-rapp*d/2}}break;case"e-resize":if(oa_w+b>=0){ant.style.width=oa_w+b;if(f.checked){ant.style.height=rapp_inv*(oa_w+b);ant.style.top=oa_y-rapp_inv*b/2}}break;case"n-resize":if(oa_h-d>=0){ant.style.top=oa_y+d;ant.style.height=oa_h-d;if(f.checked){ant.style.width=rapp*(oa_h-d);ant.style.left=oa_x+rapp*d/2}}break;case"w-resize":if(oa_w-b>=0){ant.style.left=oa_x+b;ant.style.width=oa_w-b;if(f.checked){ant.style.height=rapp_inv*(oa_w-b);ant.style.top=oa_y+rapp_inv*b/2}}break;case"nw-resize":if(oa_h-d>=0&&oa_w-b>=0){ant.style.left=oa_x+b;ant.style.width=oa_w-b;ant.style.top=oa_y+d;if(f.checked){ant.style.height=rapp_inv*(oa_w-b)}else{ant.style.height=oa_h-d}}break;case"ne-resize":if(oa_h-d>=0&&oa_w+b>=0){ant.style.top=oa_y+d;ant.style.width=oa_w+b;if(f.checked){ant.style.height=rapp_inv*(oa_w+b)}else{ant.style.height=oa_h-d}}break;case"se-resize":if(oa_h+d>=0&&oa_w+b>=0){ant.style.width=oa_w+b;if(f.checked){ant.style.height=rapp_inv*(oa_w+b)}else{ant.style.height=oa_h+d}}break;case"sw-resize":if(oa_h+d>=0&&oa_w-b>=0){ant.style.left=oa_x+b;ant.style.width=oa_w-b;if(f.checked){ant.style.height=rapp_inv*(oa_w-b)}else{ant.style.height=oa_h+d}}}showStatus();return false}}function drags(b){if(!ie&&!ns6){return}var c=ns6?b.target:event.srcElement;var a=ns6?"HTML":"BODY";while(c.tagName!=a&&!(c.className=="crop"||c.className=="handleBox"||c.className=="selection"||c.className=="selectionWhite")){c=ns6?c.parentNode:c.parentElement}if(c.className=="handleBox"){if(content!=null){if(content.width!=null&&content.height!=null){content.width=0;content.height=0}}resizeHandle=c.id;x=ns6?b.clientX:event.clientX;y=ns6?b.clientY:event.clientY;oa_w=parseInt(ant.style.width);oa_h=parseInt(ant.style.height);oa_x=parseInt(ant.style.left);oa_y=parseInt(ant.style.top);dragapproved=true;document.onmousemove=moveHandle;return false}else{if((c.className=="selection"||c.className=="selectionWhite")&&mode=="crop"){x=ns6?b.clientX:event.clientX;y=ns6?b.clientY:event.clientY;oa_x=parseInt(ant.style.left);oa_y=parseInt(ant.style.top);dragapproved=true;document.onmousemove=moveContent;return false}else{if(c.className=="crop"&&mode=="crop"){if(content!=null){if(content.width!=null&&content.height!=null){content.width=0;content.height=0}}if(status==null){status=MM_findObj("status")}if(ant==null){ant=MM_findObj("ant")}if(canvas==null){canvas=MM_findObj("imgCanvas")}if(content==null){content=MM_findObj("cropContent")}if(pic_width==null||pic_height==null){image=MM_findObj("theImage");pic_width=image.width;pic_height=image.height}ant.style.visibility="visible";obj=c;dragapproved=true;z=c;temp1=parseInt(z.style.left+0);temp2=parseInt(z.style.top+0);x=ns6?b.pageX:event.clientX+document.body.scrollLeft;y=ns6?b.pageY:event.clientY+document.body.scrollTop;document.onmousemove=move;return false}else{if(c.className=="crop"&&mode=="measure"){if(ant==null){ant=MM_findObj("ant")}if(canvas==null){canvas=MM_findObj("imgCanvas")}x=ns6?b.pageX:event.clientX+document.body.scrollLeft;y=ns6?b.pageY:event.clientY+document.body.scrollTop;dragapproved=true;document.onmousemove=measure;return false}}}}}function measure(a){if(dragapproved){mx2=ns6?a.pageX:event.clientX+document.body.scrollLeft;my2=ns6?a.pageY:event.clientY+document.body.scrollTop;jg_doc.clear();jg_doc.setStroke(Stroke.DOTTED);jg_doc.drawLine(x,y,mx2,my2);jg_doc.paint();showStatus();return false}}function setMarker(a,d,b,c){if(isNaN(a)){a=0}if(isNaN(d)){d=0}if(isNaN(b)){b=0}if(isNaN(c)){c=0}if(ant==null){ant=MM_findObj("ant")}if(canvas==null){canvas=MM_findObj("imgCanvas")}if(content==null){content=MM_findObj("cropContent")}if(pic_width==null||pic_height==null){image=MM_findObj("theImage");pic_width=image.width;pic_height=image.height}ant.style.visibility="visible";a=pic_x+a;d=pic_y+d;if(b>=0){ant.style.left=a;ant.style.width=b}else{ant.style.left=a+b;ant.style.width=-1*b}if(c>=0){ant.style.top=d;ant.style.height=c}else{ant.style.top=d+c;ant.style.height=-1*c}}function max(a,b){if(b>a){return a}else{return b}}function drawBoundHandle(){if(ant==null||ant.style==null){return false}var a=parseInt(ant.style.height);var d=parseInt(ant.style.width);var c=parseInt(ant.style.left);var b=parseInt(ant.style.top);jg_doc.drawHandle(c-15,b-15,30,30,"nw-resize");jg_doc.drawHandle(c-15,b+a-15,30,30,"sw-resize");jg_doc.drawHandle(c+d-15,b-15,30,30,"ne-resize");jg_doc.drawHandle(c+d-15,b+a-15,30,30,"se-resize");jg_doc.drawHandle(c+max(15,d/10),b-8,d-2*max(15,d/10),8,"n-resize");jg_doc.drawHandle(c+max(15,d/10),b+a,d-2*max(15,d/10),8,"s-resize");jg_doc.drawHandle(c-8,b+max(15,a/10),8,a-2*max(15,a/10),"w-resize");jg_doc.drawHandle(c+d,b+max(15,a/10),8,a-2*max(15,a/10),"e-resize");jg_doc.drawHandleBox(c-4,b-4,8,8,"nw-resize");jg_doc.drawHandleBox(c-4,b+a-4,8,8,"sw-resize");jg_doc.drawHandleBox(c+d-4,b-4,8,8,"ne-resize");jg_doc.drawHandleBox(c+d-4,b+a-4,8,8,"se-resize");jg_doc.drawHandleBox(c+d/2-4,b-4,8,8,"n-resize");jg_doc.drawHandleBox(c+d/2-4,b+a-4,8,8,"s-resize");jg_doc.drawHandleBox(c-4,b+a/2-4,8,8,"w-resize");jg_doc.drawHandleBox(c+d-4,b+a/2-4,8,8,"e-resize")}function showStatus(){if(ant==null||ant.style==null){return false}var k=100/parseInt(window.parent.document.getElementById("zoom").value,10);if(mode=="measure"){mx1=x-pic_x;my1=y-pic_y;mw=mx2-x;mh=my2-y;md=parseInt(Math.sqrt(mw*mw+mh*mh)*100)/100;ma=(Math.atan(-1*mh/mw)/Math.PI)*180;if(mw<0&&mh<0){ma=ma+180}if(mw<0&&mh>0){ma=ma-180}ma=parseInt(ma*100)/100;if(m_sx!=null&&!isNaN(mx1)){m_sx.value=mx1*k+"px"}if(m_sy!=null&&!isNaN(my1)){m_sy.value=my1*k+"px"}if(m_w!=null&&!isNaN(mw)){m_w.value=mw*k+"px"}if(m_h!=null&&!isNaN(mh)){m_h.value=mh*k+"px"}if(m_d!=null&&!isNaN(md)){m_d.value=md*k+"px"}if(m_a!=null&&!isNaN(ma)){m_a.value=ma+""}if(r_ra!=null&&!isNaN(ma)){r_ra.value=ma}return false}var i=parseInt(ant.style.height);var c=parseInt(ant.style.width);var b=parseInt(ant.style.left);var l=parseInt(ant.style.top);var e=b-pic_x<0?0:b-pic_x;var d=l-pic_y<0?0:l-pic_y;e=e>pic_width?pic_width:e;d=d>pic_height?pic_height:d;var f=b-pic_x>0?c:c-(pic_x-b);var a=l-pic_y>0?i:i-(pic_y-l);a=l+i0&&s_sh.value.indexOf("%")>0){j=f/pic_width;h=a/pic_height}if(s_sw!=null){s_sw.value=j*k}if(s_sh!=null){s_sh.value=h*k}}}}function dragStopped(){dragapproved=false;if(ant==null||ant.style==null){return false}if(mode=="measure"){jg_doc.drawLine(x-4,y,x+4,y);jg_doc.drawLine(x,y-4,x,y+4);jg_doc.drawLine(mx2-4,my2,mx2+4,my2);jg_doc.drawLine(mx2,my2-4,mx2,my2+4);jg_doc.paint();showStatus();return false}var a=parseInt(ant.style.height);var f=parseInt(ant.style.width);var e=parseInt(ant.style.left);var d=parseInt(ant.style.top);jg_doc.clear();if(content!=null){if(content.width!=null&&content.height!=null){content.width=f-1;content.height=a-1}}if(mode=="crop"){jg_doc.fillRectPattern(pic_x,pic_y,pic_width,d-pic_y,pattern);var b=a;var c=d;if(a+d>=pic_height+pic_y){b=pic_height+pic_y-d}else{if(d<=pic_y){b=d+a-pic_y;c=pic_y}}jg_doc.fillRectPattern(pic_x,c,e-pic_x,b,pattern);jg_doc.fillRectPattern(e+f,c,pic_x+pic_width-e-f,b,pattern);jg_doc.fillRectPattern(pic_x,d+a,pic_width,pic_height+pic_y-d-a,pattern)}else{if(mode=="scale"){document.theImage.height=a;document.theImage.width=f;document.theImage.style.height=a+" px";document.theImage.style.width=f+" px";P7_Snap("theImage","ant",0,0)}}drawBoundHandle();jg_doc.paint();showStatus();return false}document.onmousedown=drags;document.onmouseup=dragStopped; \ No newline at end of file