From: <jay...@us...> - 2007-01-31 21:50:28
|
Author: jaytraxx Date: Wed Jan 31 22:44:44 2007 New Revision: 23357 URL: http://www.egroupware.org/viewvc?rev=3D3D23357&view=3D3Drev Log: importing initial 4.87 wz_dragdrop.js vendor drop Added: branches/VENDOR/wz_dragdrop/ branches/VENDOR/wz_dragdrop/current Added: branches/VENDOR/wz_dragdrop/current URL: http://www.egroupware.org/viewvc/branches/VENDOR/wz_dragdrop/current?r= =3D ev=3D3D23357&view=3D3Dauto =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D= =3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D3D=3D =3D3D=3D3D=3D3D --- branches/VENDOR/wz_dragdrop/current (added) +++ branches/VENDOR/wz_dragdrop/current Wed Jan 31 22:44:44 2007 @@ -1,0 +1,1429 @@ +/* This notice must be untouched at all times. + +wz_dragdrop.js v. 4.87 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2003 Walter Zorn. All rights reserved. +Created 26. 8. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 29. 11. 2006 + +This DHTML & Drag&Drop Library adds Drag&Drop functionality +to the following types of html-elements: +- images, even if not positioned via layers, + nor via stylesheets or any other kind of "hard-coding" +- relatively and absolutely positioned layers (DIV elements). +Moreover, it provides extended DHTML abilities. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +For more details on the GNU Lesser General Public License, +see http://www.gnu.org/copyleft/lesser.html +*/ + + +// PATH TO THE TRANSPARENT 1*1 PX IMAGE (required by NS 4 as spacer) +var spacer =3D3D 'transparentpixel.gif'; + + + + +//window.onerror =3D3D new Function('return true;'); + + +// Optional commands passed to SET_DHTML() on the html-page (g: may be app= =3D lied globally, i: individually) +var CLONE =3D3D 'C10nE'; // i img clone image +var COPY =3D3D 'C0pY'; // i img create copies +var DETACH_CHILDREN =3D3D 'd37aCH'; // i lyr detach images +var HORIZONTAL =3D3D 'H0r1Z'; // i img,lyr horizontally draggable only +var MAXHEIGHT =3D3D 'm7x8I'; // i img,lyr maximum height limit, " +var MAXOFFBOTTOM =3D3D 'm7xd0wN'; // i img,lyr downward offset limit +var MAXOFFLEFT =3D3D 'm7x23Ft'; // i img,lyr leftward offset limit +var MAXOFFRIGHT =3D3D 'm7x0Ff8'; // i img,lyr rightward offset limit +var MAXOFFTOP =3D3D 'm7xu9'; // i img,lyr upward offset limit +var MAXWIDTH =3D3D 'm7xW1'; // i img,lyr maximum width limit, use wit= h =3D resizable or scalable +var MINWIDTH =3D3D 'm1nw1'; // i img,lyr minimum width limit, " +var MINHEIGHT =3D3D 'm1n8I'; // i img,lyr minimum height limit, " +var NO_ALT =3D3D 'no81T'; // gi img disable alt and title attributes +var NO_DRAG =3D3D 'N0d4Ag'; // i img,lyr disable draggability +var RESET_Z =3D3D 'r35E7z'; // gi img,lyr reset z-index when dropped +var RESIZABLE =3D3D 'r5IZbl'; // gi img,lyr resizable if <ctrl> or <shi= ft=3D > pressed +var SCALABLE =3D3D 'SCLbl'; // gi img,lyr scalable " +var SCROLL =3D3D 'sC8lL'; // gi img,lyr enable auto scroll functional= ity +var TRANSPARENT =3D3D 'dIApHAn'; // gi img,lyr translucent while dragged +var VERTICAL =3D3D 'V3Rt1C'; // i img,lyr vertically draggable only +var dd_cursors =3D3D new Array( + 'c:default', + 'c:crosshair', + 'c:e-resize', + 'c:hand', + 'c:help', + 'c:move', + 'c:n-resize', + 'c:ne-resize', + 'c:nw-resize', + 'c:s-resize', + 'c:se-resize', + 'c:sw-resize', + 'c:text', + 'c:w-resize', + 'c:wait' +); +for(var dd_i =3D3D dd_cursors.length; dd_i;) +{--dd_i; + eval('var CURSOR_' + (dd_cursors[dd_i].substring(2).toUpperCase().replace= =3D ('-', '_')) + ' =3D3D "' + dd_cursors[dd_i] + '";'); +} +var dd_u =3D3D "undefined"; +function WZDD() +{ + this.elements =3D3D new Array(0); + this.obj =3D3D null; + this.n =3D3D navigator.userAgent.toLowerCase(); + this.db =3D3D (document.compatMode && document.compatMode.toLowerCase() != =3D =3D3D "backcompat")? + document.documentElement + : (document.body || null); + this.op =3D3D !!(window.opera && document.getElementById); + if(this.op) document.onmousedown =3D3D new Function('e', + 'if(((e =3D3D e || window.event).target || e.srcElement).tagName =3D3D= =3D3D "I=3D MAGE") return false;'); + this.ie =3D3D !!(this.n.indexOf("msie") >=3D3D 0 && document.all && this.= db &=3D & !this.op); + this.iemac =3D3D !!(this.ie && this.n.indexOf("mac") >=3D3D 0); + this.ie4 =3D3D !!(this.ie && !document.getElementById); + this.n4 =3D3D !!(document.layers && typeof document.classes !=3D3D dd_u); + this.n6 =3D3D !!(typeof window.getComputedStyle !=3D3D dd_u && typeof doc= umen=3D t=2EcreateRange !=3D3D dd_u); + this.w3c =3D3D !!(!this.op && !this.ie && !this.n6 && document.getElement= By=3D Id); + this.ce =3D3D !!(document.captureEvents && document.releaseEvents && !thi= s=2E=3D n6); + this.px =3D3D this.n4? '' : 'px'; + this.tiv =3D3D this.w3c? 40 : 10; +} +var dd =3D3D new WZDD(); + +dd.Int =3D3D function(d_x, d_y) +{ + return isNaN(d_y =3D3D parseInt(d_x))? 0 : d_y; +}; +dd.getWndW =3D3D function() +{ + return dd.Int( + (dd.db && !dd.op && !dd.w3c && dd.db.clientWidth)? dd.db.clientWidth + : (window.innerWidth || 0) + ); +}; +dd.getWndH =3D3D function() +{ + return dd.Int( + (dd.db && !dd.op && !dd.w3c && dd.db.clientHeight)? dd.db.clientHeight + : (window.innerHeight || 0) + ); +}; +dd.getScrollX =3D3D function() +{ + return dd.Int(window.pageXOffset || (dd.db? dd.db.scrollLeft : 0)); +}; +dd.getScrollY =3D3D function() +{ + return dd.Int(window.pageYOffset || (dd.db? dd.db.scrollTop : 0)); +}; +dd.getPageXY =3D3D function(d_o) +{ + if(dd.n4 && d_o) + { + dd.x =3D3D d_o.pageX || 0; + dd.y =3D3D d_o.pageY || 0; + } + else + { + dd.x =3D3D dd.y =3D3D 0; //global helper vars + while(d_o) + { + dd.x +=3D3D dd.Int(d_o.offsetLeft); + dd.y +=3D3D dd.Int(d_o.offsetTop); + d_o =3D3D d_o.offsetParent || null; + } + } +}; +dd.getCssXY =3D3D function(d_o) +{ + if(d_o.div) + { + if(dd.n4) + { + d_o.cssx =3D3D d_o.div.x; + d_o.cssy =3D3D d_o.div.y; + } + else if(dd.ie4) + { + d_o.cssx =3D3D d_o.css.pixelLeft; + d_o.cssy =3D3D d_o.css.pixelTop; + } + else + { + d_o.css.left =3D3D d_o.css.top =3D3D 0 + dd.px; + dd.getPageXY(d_o.div); + d_o.cssx =3D3D d_o.x - dd.x; + d_o.cssy =3D3D d_o.y - dd.y; + d_o.css.left =3D3D d_o.cssx + dd.px; + d_o.css.top =3D3D d_o.cssy + dd.px; + } + } + else + { + d_o.cssx =3D3D 0; + d_o.cssy =3D3D 0; + } +}; +dd.getImgW =3D3D function(d_o) +{ + return d_o? dd.Int(d_o.width) : 0; +}; +dd.getImgH =3D3D function(d_o) +{ + return d_o? dd.Int(d_o.height) : 0; +}; +dd.getDivW =3D3D function(d_o) +{ + return dd.Int( + dd.n4? (d_o.div? d_o.div.clip.width : 0) + : d_o.div? (d_o.div.offsetWidth || d_o.css.pixelWidth || d_o.css.width |= =3D | 0) + : 0 + ); +}; +dd.getDivH =3D3D function(d_o) +{ + return dd.Int( + dd.n4? (d_o.div? d_o.div.clip.height : 0) + : d_o.div? (d_o.div.offsetHeight || d_o.css.pixelHeight || d_o.css.heigh= =3D t || 0) + : 0 + ); +}; +dd.getWH =3D3D function(d_o) +{ + d_o.w =3D3D dd.getDivW(d_o); + d_o.h =3D3D dd.getDivH(d_o); + if(d_o.css) + { + d_o.css.width =3D3D d_o.w + dd.px; + d_o.css.height =3D3D d_o.h + dd.px; + d_o.dw =3D3D dd.getDivW(d_o)-d_o.w; + d_o.dh =3D3D dd.getDivH(d_o)-d_o.h; + d_o.css.width =3D3D (d_o.w-d_o.dw) + dd.px; + d_o.css.height =3D3D (d_o.h-d_o.dh) + dd.px; + } + else d_o.dw =3D3D d_o.dh =3D3D 0; +}; +dd.getCssProp =3D3D function(d_o, d_pn6, d_pstyle, d_pn4) +{ + if(d_o && dd.n6) return ''+window.getComputedStyle(d_o, null).getProperty= =3D Value(d_pn6); + if(d_o && d_o.currentStyle) return ''+eval('d_o.currentStyle.'+d_pstyle); + if(d_o && d_o.style) return ''+eval('d_o.style.'+d_pstyle); + if(d_o && dd.n4) return ''+eval('d_o.'+d_pn4); + return ''; +}; +dd.getDiv =3D3D function(d_x, d_d) +{ + d_d =3D3D d_d || document; + if(dd.n4) + { + if(d_d.layers[d_x]) return d_d.layers[d_x]; + for(var d_i =3D3D d_d.layers.length; d_i;) + { + var d_y =3D3D dd.getDiv(d_x, d_d.layers[--d_i].document); + if(d_y) return d_y; + } + } + if(dd.ie) return d_d.all[d_x] || null; + if(d_d.getElementById) return d_d.getElementById(d_x) || null; + return null; +}; +dd.getImg =3D3D function(d_o, d_nm, d_xy, d_w) +{ + d_w =3D3D d_w || window; + var d_img; + if(document.images && (d_img =3D3D d_w.document.images[d_nm])) + { + if(d_xy) + { + if(dd.n4) + { + dd.getPageXY(d_w); + d_o.defx =3D3D d_img.x + dd.x; + d_o.defy =3D3D d_img.y + dd.y; + } + else + { + dd.getPageXY(d_img); + d_o.defx =3D3D dd.x; + d_o.defy =3D3D dd.y; + } + } + return d_img; + } + if(dd.n4) for(var d_i =3D3D d_w.document.layers.length; d_i;) + { + var d_y =3D3D dd.getImg(d_o, d_nm, d_xy, d_w.document.layers[--d_i]); + if(d_y) return d_y; + } + return null; +}; +dd.getParent =3D3D function(d_o, d_p) +{ + if(dd.n4) + { + for(var d_i =3D3D dd.elements.length; d_i;) + { + if(!((d_p =3D3D dd.elements[--d_i]).is_image) && d_p.div && (d_p.div.do= cu=3D ment.layers[d_o.name] || d_o.oimg && d_p.div.document.images[d_o.oimg.name]= =3D )) + d_p.addChild(d_o, d_p.detach, 1); + } + } + else + { + d_p =3D3D d_o.is_image? dd.getImg(d_o, d_o.oimg.name) : (d_o.div || null= ); + while(d_p && !!(d_p =3D3D d_p.offsetParent || d_p.parentNode || null)) + { + if(d_p.ddObj) + { + d_p.ddObj.addChild(d_o, d_p.ddObj.detach, 1); + break; + } + } + } +}; +dd.getCmd =3D3D function(d_o, d_cmd, d_cmdStr) +{ + var d_i =3D3D d_o.id.indexOf(d_cmd), d_j, + d_y =3D3D (d_i >=3D3D 0)*1; + if(d_y) + { + d_j =3D3D d_i+d_cmd.length; + if(d_cmdStr) d_o.cmd +=3D3D d_o.id.substring(d_i, d_j); + d_o.id =3D3D d_o.id.substring(0, d_i) + d_o.id.substring(d_j); + } + return d_y; +}; +dd.getCmdVal =3D3D function(d_o, d_cmd, d_cmdStr, int0) +{ + var d_i =3D3D d_o.id.indexOf(d_cmd), d_j, + d_y =3D3D (d_o.id.indexOf(d_cmd) >=3D3D 0)? dd.Int(d_o.id.substring(d_o.i= d=2Ein=3D dexOf(d_cmd)+d_cmd.length)) : int0? -1 : 0; + if(!int0 && d_y || int0 && d_y >=3D3D 0) + { + d_j =3D3D d_i+d_cmd.length+(""+d_y).length; + if(d_cmdStr) d_o.cmd +=3D3D d_o.id.substring(d_i, d_j); + d_o.id =3D3D d_o.id.substring(0, d_i) + d_o.id.substring(d_j); + } + return d_y; +}; +dd.addElt =3D3D function(d_o, d_p) +{ + dd.elements[d_o.name] =3D3D dd.elements[d_o.index =3D3D dd.elements.lengt= h] =3D =3D3D d_o; + if(d_p) d_p.copies[d_o.name] =3D3D d_p.copies[d_p.copies.length] =3D3D d_= o; +}; +dd.mkWzDom =3D3D function() +{ + var d_o, d_l =3D3D dd.elements.length, d_i; + for(d_i =3D3D d_l; d_i;) dd.getParent(dd.elements[--d_i]); + for(d_i =3D3D d_l; d_i;) + { + if((d_o =3D3D dd.elements[--d_i]).children && !d_o.parent) + { + for(var d_j =3D3D d_o.children.length; d_j;) + {--d_j; + d_o.children[d_j].setZ(d_o.z+d_o.children[d_j].z, 1); + } + } + } +}; +dd.addProps =3D3D function(d_o) +{ + if(d_o.is_image) + { + d_o.div =3D3D dd.getDiv(d_o.id); + d_o.css =3D3D (d_o.div && typeof d_o.div.style !=3D3D dd_u)? d_o.div.sty= le :=3D null; + d_o.nimg =3D3D (dd.n4 && d_o.div)? d_o.div.document.images[0] : (documen= t=2E=3D images[d_o.id+"NI1m6G"] || null); + if(!d_o.noalt && !dd.noalt && d_o.nimg && d_o.oimg) + { + d_o.nimg.alt =3D3D d_o.oimg.alt || ''; + if(d_o.oimg.title) d_o.nimg.title =3D3D d_o.oimg.title; + } + d_o.bgColor =3D3D ''; + } + else + { + d_o.bgColor =3D3D dd.getCssProp(d_o.div, 'background-color','backgroundC= ol=3D or','bgColor').toLowerCase(); + if(dd.n6 && d_o.div) + { + var d_c =3D3D d_o.bgColor.toLowerCase(); + if(d_c.indexOf('rgb') >=3D3D 0) + { + d_c =3D3D d_c.substring(4, d_c.length-1).split(','); + d_o.bgColor =3D3D '#'; + for(var d_l =3D3D d_c.length, d_i =3D3D 0; d_i < d_l; d_i++) d_o.bgCol= or +=3D =3D3D parseInt(d_c[d_i]).toString(0x10); + } + else d_o.bgColor =3D3D d_c; + } + } + if(dd.scalable) d_o.scalable =3D3D d_o.resizable^1; + else if(dd.resizable) d_o.resizable =3D3D d_o.scalable^1; + d_o.setZ(d_o.defz); + d_o.cursor =3D3D d_o.cursor || dd.cursor || 'auto'; + d_o._setCrs(d_o.nodrag? 'auto' : d_o.cursor); + d_o.diaphan =3D3D d_o.diaphan || dd.diaphan || 0; + d_o.opacity =3D3D 1.0; + d_o.visible =3D3D true; +}; +dd.initz =3D3D function() +{ + if(!(dd && (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c))) return; + else if(dd.n6 || dd.ie || dd.op || dd.w3c) dd.recalc(1); + var d_drag =3D3D (document.onmousemove =3D3D=3D3D DRAG), + d_resize =3D3D (document.onmousemove =3D3D=3D3D RESIZE); + if(dd.loadFunc) dd.loadFunc(); + if(d_drag) dd.setMovHdl(DRAG); + else if(d_resize) dd.setMovHdl(RESIZE); + if(d_drag || d_resize) dd.setUpHdl(DROP); + dd.setDwnHdl(PICK); +}; +dd.finlz =3D3D function() +{ + if(dd.ie && dd.elements) + { + for(var d_i =3D3D dd.elements.length; d_i;) + dd.elements[--d_i].del(); + } + if(dd.uloadFunc) dd.uloadFunc(); +}; +dd.setCe =3D3D function(d_e, d_fnc) +{ + d_fnc? document.captureEvents(d_e) : document.releaseEvents(d_e); +}; +dd.setDwnHdl =3D3D function(d_x) +{ + if(document.onmousedown !=3D3D d_x) + { + dd.downFunc =3D3D document.onmousedown; + document.onmousedown =3D3D d_x; + if(dd.ce) dd.setCe(Event.MOUSEDOWN, d_x); + } +}; +dd.setMovHdl =3D3D function(d_x) +{ + if(document.onmousemove !=3D3D d_x) + { + dd.moveFunc =3D3D document.onmousemove; + document.onmousemove =3D3D d_x; + if(dd.ce) dd.setCe(Event.MOUSEMOVE, d_x); + } +}; +dd.setUpHdl =3D3D function(d_x) +{ + if(document.onmouseup !=3D3D d_x) + { + dd.upFunc =3D3D document.onmouseup; + document.onmouseup =3D3D d_x; + if(dd.ce) dd.setCe(Event.MOUSEUP, d_x); + } +}; +dd.evt =3D3D function(d_e) +{ + this.but =3D3D (this.e =3D3D d_e || window.event).which || this.e.button = || 0; + this.button =3D3D (this.e.type =3D3D=3D3D 'mousedown')? this.but + : (dd.e && dd.e.button)? dd.e.button + : 0; + this.src =3D3D this.e.target || this.e.srcElement || null; + this.src.tag =3D3D ("" + (this.src.tagName || this.src)).toLowerCase(); + this.x =3D3D dd.Int(this.e.pageX || this.e.clientX || 0); + this.y =3D3D dd.Int(this.e.pageY || this.e.clientY || 0); + if(dd.ie) + { + this.x +=3D3D dd.getScrollX() - (dd.ie && !dd.iemac)*1; + this.y +=3D3D dd.getScrollY() - (dd.ie && !dd.iemac)*1; + } + this.modifKey =3D3D this.e.modifiers? this.e.modifiers&Event.SHIFT_MASK := (=3D this.e.shiftKey || false); +}; +dd.getEventTarget =3D3D function(d_e, d_s, d_n) +{ + d_e =3D3D d_e || window.event; + if(d_e && (d_s =3D3D d_e.target || d_e.srcElement || null) !=3D3D null) + { + if(null !=3D3D (d_n =3D3D d_s.id || d_s.name || null)) + { + if(d_n.indexOf("dIi15vNI1m6G") =3D3D=3D3D d_n.length-12) + return dd.elements[d_n.substring(0, d_n.length-12)] || null; + if(d_n.indexOf("dIi15v") =3D3D=3D3D d_n.length-6) + return dd.elements[d_n.substring(0, d_n.length-6)] || null; + return dd.elements[d_n] || null; + } + } + return null; +}; +dd.recalc =3D3D function(d_x) +{ + for(var d_o, d_i =3D3D dd.elements.length; d_i;) + { + if(!(d_o =3D3D dd.elements[--d_i]).is_image && d_o.div) + { + dd.getWH(d_o); + if(d_o.div.pos_rel) + { + dd.getPageXY(d_o.div); + var d_dx =3D3D dd.x - d_o.x, d_dy =3D3D dd.y - d_o.y; + d_o.defx +=3D3D d_dx; + d_o.x +=3D3D d_dx; + d_o.defy +=3D3D d_dy; + d_o.y +=3D3D d_dy; + for(var d_p, d_j =3D3D d_o.children.length; d_j;) + { + if(!(d_p =3D3D d_o.children[--d_j]).detached && (d_o !=3D3D d_p.defpa= rent=3D || !(d_p.is_image && dd.getImg(d_p, d_p.oimg.name, 1)))) + { + d_p.defx +=3D3D d_dx; + d_p.defy +=3D3D d_dy; + d_p.moveBy(d_dx, d_dy); + } + } + } + } + else if(d_o.is_image && !dd.n4) + { + if(dd.n6 && d_x && !d_o.defw) d_o.resizeTo(d_o.defw =3D3D dd.getImgW(d_= o=2E=3D oimg), d_o.defh =3D3D dd.getImgH(d_o.oimg)); + var d_defx =3D3D d_o.defx, d_defy =3D3D d_o.defy; + if(!(d_o.parent && d_o.parent !=3D3D d_o.defparent) && (d_x || !d_o.det= ac=3D hed || d_o.horizontal || d_o.vertical) && dd.getImg(d_o, d_o.oimg.name, 1)) + d_o.moveBy(d_o.defx-d_defx, d_o.defy-d_defy); + } + } +}; +function WINSZ(d_x) +{ + if(d_x) + { + if(dd.n4) + { + dd.iW =3D3D innerWidth; + dd.iH =3D3D innerHeight; + } + window.onresize =3D3D new Function('WINSZ();'); + } + else if(dd.n4 && (innerWidth !=3D3D dd.iW || innerHeight !=3D3D dd.iH)) l= ocat=3D ion.reload(); + else if(!dd.n4) setTimeout('dd.recalc()', 0xa); +} +WINSZ(1); + +function DDObj(d_o, d_i) +{ + this.id =3D3D d_o; + this.cmd =3D3D ''; + this.cpy_n =3D3D dd.getCmdVal(this, COPY); + this.maxoffb =3D3D dd.getCmdVal(this, MAXOFFBOTTOM, 0, 1); + this.maxoffl =3D3D dd.getCmdVal(this, MAXOFFLEFT, 0, 1); + this.maxoffr =3D3D dd.getCmdVal(this, MAXOFFRIGHT, 0, 1); + this.maxofft =3D3D dd.getCmdVal(this, MAXOFFTOP, 0, 1); + var d_j =3D3D dd_cursors.length; while(d_j--) + if(dd.getCmd(this, dd_cursors[d_j], 1)) this.cursor =3D3D dd_cursors[d_j= ]=2E=3D substring(2); + this.clone =3D3D dd.getCmd(this, CLONE, 1); + this.detach =3D3D dd.getCmd(this, DETACH_CHILDREN); + this.scalable =3D3D dd.getCmd(this, SCALABLE, 1); + this.horizontal =3D3D dd.getCmd(this, HORIZONTAL); + this.noalt =3D3D dd.getCmd(this, NO_ALT, 1); + this.nodrag =3D3D dd.getCmd(this, NO_DRAG); + this.scroll =3D3D dd.getCmd(this, SCROLL, 1); + this.resizable =3D3D dd.getCmd(this, RESIZABLE, 1); + this.re_z =3D3D dd.getCmd(this, RESET_Z, 1); + this.diaphan =3D3D dd.getCmd(this, TRANSPARENT, 1); + this.vertical =3D3D dd.getCmd(this, VERTICAL); + this.maxw =3D3D dd.getCmdVal(this, MAXWIDTH, 1, 1); + this.minw =3D3D Math.abs(dd.getCmdVal(this, MINWIDTH, 1, 1)); + this.maxh =3D3D dd.getCmdVal(this, MAXHEIGHT, 1, 1); + this.minh =3D3D Math.abs(dd.getCmdVal(this, MINHEIGHT, 1, 1)); + this.pickFunc =3D3D this.dragFunc =3D3D this.resizeFunc =3D3D this.dropFu= nc =3D3D=3D null; + + this.name =3D3D this.id + (d_i || ''); + this.oimg =3D3D dd.getImg(this, this.id, 1); + this.is_image =3D3D !!this.oimg; + this.copies =3D3D new Array(); + this.children =3D3D new Array(); + this.parent =3D3D this.original =3D3D null; + if(this.oimg) + { + this.id =3D3D this.name + "dIi15v"; + this.w =3D3D dd.getImgW(this.oimg); + this.h =3D3D dd.getImgH(this.oimg); + this.dw =3D3D this.dh =3D3D 0; + this.defz =3D3D dd.Int(dd.getCssProp(this.oimg, 'z-index','zIndex','zInd= ex=3D ')) || 1; + this.defsrc =3D3D this.src =3D3D this.oimg.src; + this.htm =3D3D '<img name=3D3D"' + this.id + 'NI1m6G"'+ + ' src=3D3D"' + this.oimg.src + '" '+ + 'width=3D3D"' + this.w + '" height=3D3D"' + this.h + '">'; + this.t_htm =3D3D '<div id=3D3D"' + this.id + + '" style=3D3D"position:absolute;'+ + 'left:' + (this.cssx =3D3D this.x =3D3D this.defx) + 'px;'+ + 'top:' + (this.cssy =3D3D this.y =3D3D this.defy) + 'px;'+ + 'width:' + this.w + 'px;'+ + 'height:' + this.h + 'px;">'+ + this.htm + '</div>'; + } + else + { + if(!!(this.div =3D3D dd.getDiv(this.id)) && typeof this.div.style !=3D3D= dd_=3D u) this.css =3D3D this.div.style; + dd.getWH(this); + if(this.div) + { + this.div.ddObj =3D3D this; + this.div.pos_rel =3D3D ("" + (this.div.parentNode? this.div.parentNode.= ta=3D gName : this.div.parentElement? this.div.parentElement.tagName : '').toLowe= =3D rCase().indexOf('body') < 0); + } + dd.getPageXY(this.div); + this.defx =3D3D this.x =3D3D dd.x; + this.defy =3D3D this.y =3D3D dd.y; + dd.getCssXY(this); + this.defz =3D3D dd.Int(dd.getCssProp(this.div, 'z-index','zIndex','zInde= x'=3D )); + } + this.defw =3D3D this.w || 0; + this.defh =3D3D this.h || 0; +} +DDObj.prototype.setPickFunc =3D3D function(d_x) +{ + this.pickFunc =3D3D d_x; +}; +DDObj.prototype.setDragFunc =3D3D function(d_x) +{ + this.dragFunc =3D3D d_x; +}; +DDObj.prototype.setResizeFunc =3D3D function(d_x) +{ + this.resizeFunc =3D3D d_x; +}; +DDObj.prototype.setDropFunc =3D3D function(d_x) +{ + this.dropFunc =3D3D d_x; +}; +DDObj.prototype.moveBy =3D3D function(d_x, d_y, d_kds, d_o) +{ + if(!this.div) return; + this.x +=3D3D (d_x =3D3D dd.Int(d_x)); + this.y +=3D3D (d_y =3D3D dd.Int(d_y)); + if(!d_kds || this.is_image || this.parent !=3D3D this.defparent) + { + (d_o =3D3D this.css || this.div).left =3D3D (this.cssx +=3D3D d_x) + dd.= px; + d_o.top =3D3D (this.cssy +=3D3D d_y) + dd.px; + } + for(var d_i =3D3D this.children.length; d_i;) + { + if(!(d_o =3D3D this.children[--d_i]).detached) d_o.moveBy(d_x, d_y, 1); + d_o.defx +=3D3D d_x; + d_o.defy +=3D3D d_y; + } +}; + +DDObj.prototype.moveTo =3D3D function(d_x, d_y) +{ + this.moveBy(dd.Int(d_x)-this.x, dd.Int(d_y)-this.y); +}; +DDObj.prototype.hide =3D3D function(d_m, d_o, d_p) +{ + if(this.div && this.visible) + { + d_p =3D3D this.css || this.div; + if(d_m && !dd.n4) + { + this.display =3D3D dd.getCssProp(this.div, "display", "display", "displ= ay=3D "); + if(this.oimg) + { + this.oimg.display =3D3D dd.getCssProp(this.oimg, "display", "display",= "=3D display"); + this.oimg.style.display =3D3D "none"; + } + d_p.display =3D3D "none"; + dd.recalc(); + } + else d_p.visibility =3D3D "hidden"; + } + this.visible =3D3D false; + for(var d_i =3D3D this.children.length; d_i;) + if(!(d_o =3D3D this.children[--d_i]).detached) d_o.hide(d_m); +}; +DDObj.prototype.show =3D3D function(d_o, d_p) +{ + if(this.div) + { + d_p =3D3D this.css || this.div; + if(d_p.display && d_p.display =3D3D=3D3D "none") + { + d_p.display =3D3D this.display || "block"; + if(this.oimg) this.oimg.style.display =3D3D this.oimg.display || "inlin= e"; + dd.recalc(); + } + else d_p.visibility =3D3D "visible"; + } + this.visible =3D3D true; + for(var d_i =3D3D this.children.length; d_i;) + if(!(d_o =3D3D this.children[--d_i]).detached) d_o.show(); +}; +DDObj.prototype.resizeTo =3D3D function(d_w, d_h, d_o) +{ + if(!this.div) return; + d_w =3D3D (this.w =3D3D dd.Int(d_w))-this.dw; + d_h =3D3D (this.h =3D3D dd.Int(d_h))-this.dh; + if(dd.n4) + { + this.div.resizeTo(d_w, d_h); + if(this.is_image) + { + this.write('<img src=3D3D"' + this.src + '" width=3D3D"' + d_w + '" hei= ght=3D =3D3D"' + d_h + '">'); + (this.nimg =3D3D this.div.document.images[0]).src =3D3D this.src; + } + } + else if(typeof this.css.pixelWidth !=3D3D dd_u) + { + this.css.pixelWidth =3D3D d_w; + this.css.pixelHeight =3D3D d_h; + if(this.is_image) + { + (d_o =3D3D this.nimg.style).pixelWidth =3D3D d_w; + d_o.pixelHeight =3D3D d_h; + } + } + else + { + this.css.width =3D3D d_w + dd.px; + this.css.height =3D3D d_h + dd.px; + if(this.is_image) + { + (d_o =3D3D this.nimg).width =3D3D d_w; + d_o.height =3D3D d_h; + if(!d_o.complete) d_o.src =3D3D this.src; + } + } +}; +DDObj.prototype.resizeBy =3D3D function(d_dw, d_dh) +{ + this.resizeTo(this.w+dd.Int(d_dw), this.h+dd.Int(d_dh)); +}; +DDObj.prototype.swapImage =3D3D function(d_x, d_cp) +{ + if(!this.nimg) return; + this.nimg.src =3D3D d_x; + this.src =3D3D this.nimg.src; + if(d_cp) + { + for(var d_i =3D3D this.copies.length; d_i;) + {--d_i; + this.copies[d_i].src =3D3D this.copies[d_i].nimg.src =3D3D this.nimg.sr= c; + } + } +}; +DDObj.prototype.setBgColor =3D3D function(d_x) +{ + if(dd.n4 && this.div) this.div.bgColor =3D3D d_x; + else if(this.css) this.css.background =3D3D d_x; + this.bgColor =3D3D d_x; +}; +DDObj.prototype.write =3D3D function(d_x, d_o) +{ + this.text =3D3D d_x; + if(!this.div) return; + if(dd.n4) + { + (d_o =3D3D this.div.document).open(); + d_o.write(d_x); + d_o.close(); + dd.getWH(this); + } + else + { + this.css.height =3D3D 'auto'; + this.div.innerHTML =3D3D d_x; + if(!dd.ie4) dd.recalc(); + if(dd.ie4 || dd.n6) setTimeout('dd.recalc();', 0); // n6.0: recalc twice + } +}; +DDObj.prototype.copy =3D3D function(d_n, d_p, d_b) +{ + if(!this.oimg) return; + d_b =3D3D (dd.ie && document.all.tags('body'))? document.all.tags('body')= [0=3D ] : document.getElementsByTagName? (document.getElementsByTagName('body')[0= =3D ] || dd.db) : dd.db; + for(d_n =3D3D d_n || 1; d_n > 0; --d_n) + { + var d_l =3D3D this.copies.length, + d_o =3D3D new DDObj(this.name+this.cmd, d_l+1); + if(dd.n4) + { + d_o.id =3D3D (d_p =3D3D new Layer(d_o.w)).name; + d_p.clip.height =3D3D d_o.h; + d_p.visibility =3D3D 'show'; + (d_p =3D3D d_p.document).open(); + d_p.write(d_o.htm); + d_p.close(); + } + else if(d_b && d_b.insertAdjacentHTML) d_b.insertAdjacentHTML("AfterBegi= =3D n", d_o.t_htm); + else if(document.createElement && d_b && d_b.appendChild) + { + d_b.appendChild(d_p =3D3D document.createElement("dIi15v")); + d_p.innerHTML =3D3D d_o.htm; + d_p.id =3D3D d_o.id; + d_p.style.position =3D3D 'absolute'; + d_p.style.width =3D3D d_o.w + 'px'; + d_p.style.height =3D3D d_o.h + 'px'; + } + else if(d_b && d_b.innerHTML) d_b.innerHTML +=3D3D d_o.t_htm; + d_o.defz =3D3D this.defz+1+d_l; + dd.addProps(d_o); + d_o.original =3D3D this; + dd.addElt(d_o, this); + if(this.parent) + { + this.parent.addChild(d_o, this.detached); + d_o.defparent =3D3D this.defparent; + } + d_o.moveTo(d_o.defx =3D3D this.defx, d_o.defy =3D3D this.defy); + if(dd.n4) d_o.defsrc =3D3D d_o.src =3D3D this.defsrc; + d_o.swapImage(this.src); + } +}; +DDObj.prototype.addChild =3D3D function(d_kd, detach, defp) +{ + if(typeof d_kd !=3D3D "object") d_kd =3D3D dd.elements[d_kd]; + if(d_kd.parent && d_kd.parent =3D3D=3D3D this || d_kd =3D3D=3D3D this || = !d_kd.is=3D _image && d_kd.defparent && !defp) return; + + this.children[this.children.length] =3D3D this.children[d_kd.name] =3D3D = d_kd; + d_kd.detached =3D3D detach || 0; + if(defp) d_kd.defparent =3D3D this; + else if(this =3D3D=3D3D d_kd.defparent && d_kd.is_image) dd.getImg(this, = d_kd=3D .oimg.name, 1); + if(!d_kd.defparent || this !=3D3D d_kd.defparent) + { + d_kd.defx =3D3D d_kd.x; + d_kd.defy =3D3D d_kd.y; + } + if(!detach) + { + d_kd.defz =3D3D d_kd.defz+this.defz-(d_kd.parent? d_kd.parent.defz : 0)+= (!=3D d_kd.is_image*1); + d_kd.setZ(d_kd.z+this.z-(d_kd.parent? d_kd.parent.z : 0)+(!d_kd.is_image= =3D *1), 1); + } + if(d_kd.parent) d_kd.parent._removeChild(d_kd, 1); + d_kd.parent =3D3D this; +}; +DDObj.prototype._removeChild =3D3D function(d_kd, d_newp) +{ + if(typeof d_kd !=3D3D "object") d_kd =3D3D this.children[d_kd]; + var d_oc =3D3D this.children, d_nc =3D3D new Array(); + for(var d_i =3D3D 0; d_i < d_oc.length; d_i++) + if(d_oc[d_i] !=3D3D d_kd) d_nc[d_nc.length] =3D3D d_oc[d_i]; + this.children =3D3D d_nc; + d_kd.parent =3D3D null; + if(!d_newp) + { + d_kd.detached =3D3D d_kd.defp =3D3D 0; + if(d_kd.is_image) dd.getImg(d_kd, d_kd.oimg.name, 1); + } +}; +DDObj.prototype.attachChild =3D3D function(d_kd) +{ + (d_kd =3D3D (typeof d_kd !=3D3D "object")? this.children[d_kd]: d_kd).det= ache=3D d =3D3D 0; + d_kd.setZ(d_kd.defz + this.z-this.defz, 1); +}; +DDObj.prototype.detachChild =3D3D function(d_kd) +{ + (d_kd =3D3D (typeof d_kd !=3D3D "object")? this.children[d_kd]: d_kd).det= ache=3D d =3D3D 1; +}; +DDObj.prototype.setZ =3D3D function(d_x, d_kds, d_o) +{ + if(d_kds) + { + for(var d_dz =3D3D d_x-this.z, d_i =3D3D this.children.length; d_i;) + if(!(d_o =3D3D this.children[--d_i]).detached) d_o.setZ(d_o.z+d_dz, 1); + } + dd.z =3D3D Math.max(dd.z, this.z =3D3D this.div? ((this.css || this.div).= zInd=3D ex =3D3D d_x) : 0); +}; +DDObj.prototype.maximizeZ =3D3D function() +{ + this.setZ(dd.z+1, 1); +}; +DDObj.prototype._resetZ =3D3D function(d_o) +{ + if(this.re_z || dd.re_z) + { + this.setZ(this.defz); + for(var d_i =3D3D this.children.length; d_i;) + if(!(d_o =3D3D this.children[--d_i]).detached) d_o.setZ(d_o.defz); + } +}; +DDObj.prototype.setOpacity =3D3D function(d_x) +{ + this.opacity =3D3D d_x; + this._setOpaRel(1.0, 1); +}; +DDObj.prototype._setOpaRel =3D3D function(d_x, d_kd, d_y, d_o) +{ + if(this.css && (this.diaphan || d_kd)) + { + d_y =3D3D this.opacity*d_x; + if(typeof this.css.MozOpacity !=3D3D dd_u) this.css.MozOpacity =3D3D d_y; + else if(typeof this.css.filter !=3D3D dd_u) + this.css.filter =3D3D "Alpha(opacity=3D3D"+parseInt(100*d_y)+")"; + else this.css.opacity =3D3D d_y; + for(var d_i =3D3D this.children.length; d_i;) + if(!(d_o =3D3D this.children[--d_i]).detached) d_o._setOpaRel(d_x, 1); + } +}; +DDObj.prototype.setCursor =3D3D function(d_x) +{ + this._setCrs(this.cursor =3D3D (d_x.indexOf('c:')+1)? d_x.substring(2) : = d_=3D x); +}; +DDObj.prototype._setCrs =3D3D function(d_x) +{ + if(this.css) this.css.cursor =3D3D ((!dd.ie || dd.iemac) && d_x =3D3D=3D3= D 'han=3D d')? 'pointer' : d_x; +}; +DDObj.prototype.setDraggable =3D3D function(d_x) +{ + this.nodrag =3D3D !d_x*1; + this._setCrs(d_x? this.cursor : 'auto'); +}; +DDObj.prototype.setResizable =3D3D function(d_x) +{ + this.resizable =3D3D d_x*1; + if(d_x) this.scalable =3D3D 0; +}; +DDObj.prototype.setScalable =3D3D function(d_x) +{ + this.scalable =3D3D d_x*1; + if(d_x) this.resizable =3D3D 0; +}; +DDObj.prototype.setHorizontal =3D3D function(d_x) +{ + this.horizontal =3D3D d_x*1; +}; +DDObj.prototype.setVertical =3D3D function(d_x) +{ + this.vertical =3D3D d_x*1; +}; +DDObj.prototype.getEltBelow =3D3D function(d_ret, d_x, d_y) +{ + var d_o, d_cmp =3D3D -1, d_i =3D3D dd.elements.length; while(d_i--) + { + d_o =3D3D dd.elements[d_i]; + d_x =3D3D d_o.x-this.w/2; + d_y =3D3D d_o.y-this.h/2; + if(d_o.visible && d_o.z < this.z && this.x >=3D3D d_x && this.x <=3D3D d= _x+d=3D _o.w && this.y >=3D3D d_y && this.y <=3D3D d_y+d_o.h) + { + if(d_o.z > d_cmp) + { + d_cmp =3D3D d_o.z; + d_ret =3D3D d_o; + } + } + } + return d_ret; +}; +DDObj.prototype.del =3D3D function(d_os, d_o) +{ + var d_i, d_l; + if(this.parent && this.parent._removeChild) this.parent._removeChild(this= =3D ); + if(this.original) + { + this.hide(); + if(this.original.copies) + { + d_os =3D3D new Array(); + for(d_l =3D3D this.original.copies.length, d_i =3D3D 0; d_i < d_l; d_i+= +) + if((d_o =3D3D this.original.copies[d_i]) !=3D3D this) d_os[d_o.name] = =3D3D d=3D _os[d_os.length] =3D3D d_o; + this.original.copies =3D3D d_os; + } + } + else if(this.is_image) + { + this.hide(); + if(this.oimg) + { + if(dd.n4) this.oimg.src =3D3D this.defsrc; + else this.oimg.style.visibility =3D3D 'visible'; + } + } + else if(this.moveTo) + { + if(this.css) this.css.cursor =3D3D 'default'; + this.moveTo(this.defx, this.defy); + this.resizeTo(this.defw, this.defh); + } + d_os =3D3D new Array(); + for(d_l =3D3D dd.elements.length, d_i =3D3D 0; d_i < d_l; d_i++) + { + if((d_o =3D3D dd.elements[d_i]) !=3D3D this) d_os[d_o.name] =3D3D d_os[d= _o.ind=3D ex =3D3D d_os.length] =3D3D d_o; + else d_o._free(); + } + dd.elements =3D3D d_os; + if(!dd.n4) dd.recalc(); +}; +DDObj.prototype._free =3D3D function() +{ + for(var d_i in this) + this[d_i] =3D3D null; + dd.elements[this.name] =3D3D null; +}; +dd.n4RectVis =3D3D function(vis) +{ + for(var d_i =3D3D 4; d_i;) + {--d_i; + dd.rectI[d_i].visibility =3D3D dd.rectA[d_i].visibility =3D3D vis? 'show= ' : =3D 'hide'; + if(vis) dd.rectI[d_i].zIndex =3D3D dd.rectA[d_i].zIndex =3D3D dd.z+2; + } +}; +dd.n4RectPos =3D3D function(d_o, d_x, d_y, d_w, d_h) +{ + d_o.x =3D3D d_x; + d_o.y =3D3D d_y; + d_o.clip.width =3D3D d_w; + d_o.clip.height =3D3D d_h; +}; +// NN4: Draw img sizing rect +dd.n4Rect =3D3D function(d_w, d_h) +{ + var d_i; + if(!dd.rectI) + { + dd.rectI =3D3D new Array(); + dd.rectA =3D3D new Array(); + } + if(!dd.rectI[0]) + { + for(d_i =3D3D 4; d_i;) + { + (dd.rectI[--d_i] =3D3D new Layer(1)).bgColor =3D3D '#000000'; + (dd.rectA[d_i] =3D3D new Layer(1)).bgColor =3D3D '#ffffff'; + } + } + if(!dd.rectI[0].visibility || dd.rectI[0].visibility =3D3D=3D3D 'hide') d= d=2En4=3D RectVis(1); + dd.obj.w =3D3D d_w; + dd.obj.h =3D3D d_h; + for(d_i =3D3D 4; d_i;) + {--d_i; + dd.n4RectPos(dd.rectI[d_i], dd.obj.x + (!(d_i-1)? (dd.obj.w-1) : 0), dd.= =3D obj.y + (!(d_i-2)? (dd.obj.h-1) : 0), d_i&1 || dd.obj.w, !(d_i&1) || dd.obj= =3D .h); + dd.n4RectPos(dd.rectA[d_i], !(d_i-1)? dd.rectI[1].x+1 : (dd.obj.x-1), !(= =3D d_i-2)? dd.rectI[2].y+1 : (dd.obj.y-1), d_i&1 || dd.obj.w+2, !(d_i&1) || dd= =3D .obj.h+2); + } +}; +dd.reszTo =3D3D function(d_w, d_h) +{ + if(dd.n4 && dd.obj.is_image) dd.n4Rect(d_w, d_h); + else dd.obj.resizeTo(d_w, d_h); +}; +dd.embedVis =3D3D function(d_vis) +{ + var d_o =3D3D new Array('iframe', 'applet', 'embed', 'object'); + for(var d_i =3D3D d_o.length; d_i;) + {--d_i; + var d_p =3D3D dd.ie? document.all.tags(d_o[d_i]) : document.getElementsB= yT=3D agName? document.getElementsByTagName(d_o[d_i]) : null; + if(d_p) + { + for(var d_j =3D3D d_p.length; d_j;) + { + var d_q =3D3D d_p[--d_j]; + while(d_q.offsetParent || d_q.parentNode) + { + if((d_q =3D3D d_q.parentNode || d_q.offsetParent || null) =3D3D=3D3D = dd.obj=3D .div) + { + d_p[d_j].style.visibility =3D3D d_vis; + break; + } + } + } + } + } +}; + +dd.maxOffX =3D3D function(d_x, d_y) +{ + return( + (dd.obj.maxoffl+1 && (d_y =3D3D dd.obj.defx-dd.obj.maxoffl)-d_x > 0 + || dd.obj.maxoffr+1 && (d_y =3D3D dd.obj.defx+dd.obj.maxoffr)-d_x < 0)? = d_y + : d_x + ); +}; +dd.maxOffY =3D3D function(d_x, d_y) +{ + return( + (dd.obj.maxofft+1 && (d_y =3D3D dd.obj.defy-dd.obj.maxofft)-d_x > 0 + || dd.obj.maxoffb+1 && (d_y =3D3D dd.obj.defy+dd.obj.maxoffb)-d_x < 0)? = d_y + : d_x + ); +}; +dd.inWndW =3D3D function(d_x, d_y) +{ + var d_wx =3D3D dd.getScrollX(), + d_ww =3D3D dd.getWndW(); + return( + ((d_y =3D3D d_wx+2)-d_x > 0) || ((d_y =3D3D d_wx+d_ww+dd.obj.w-2)-d_x < = 0)? =3D d_y + : d_x + ); +}; +dd.inWndH =3D3D function(d_x, d_y) +{ + var d_wy =3D3D dd.getScrollY(), + d_wh =3D3D dd.getWndH(); + return( + ((d_y =3D3D d_wy+2)-d_x > 0) || ((d_y =3D3D d_wy+d_wh+dd.obj.h-2)-d_x < = 0)? =3D d_y + : d_x + ); +}; +// These two funcs limit the size of element when mouseresized. +// Implemented 22.5.2003 by Gregor Ltolf, modified by Walter Zorn +dd.limW =3D3D function(d_w) +{ + return( + (dd.obj.minw-d_w > 0)? dd.obj.minw + : (dd.obj.maxw > 0 && dd.obj.maxw-d_w < 0)? dd.obj.maxw + : d_w + ); +}; +dd.limH =3D3D function(d_h) +{ + return( + (dd.obj.minh-d_h > 0)? dd.obj.minh + : (dd.obj.maxh > 0 && dd.obj.maxh-d_h < 0)? dd.obj.maxh + : d_h + ); +}; +// Optional autoscroll-page functionality. Courtesy Cedric Savarese. +// Modified by Walter Zorn. +function DDScroll() +{ + if(!dd.obj || !dd.obj.scroll && !dd.scroll || dd.ie4 || dd.whratio) + { + dd.scrx =3D3D dd.scry =3D3D 0; + return; + } + var d_bnd =3D3D 0x1c, + d_wx =3D3D dd.getScrollX(), d_wy =3D3D dd.getScrollY(); + if(dd.msmoved) + { + var d_ww =3D3D dd.getWndW(), d_wh =3D3D dd.getWndH(), d_y; + dd.scrx =3D3D ((d_y =3D3D dd.e.x-d_ww-d_wx+d_bnd) > 0)? (d_y>>=3D3D2)*d_y + : ((d_y =3D3D d_wx+d_bnd-dd.e.x) > 0)? -(d_y>>=3D3D2)*d_y + : 0; + dd.scry =3D3D ((d_y =3D3D dd.e.y-d_wh-d_wy+d_bnd) > 0)? (d_y>>=3D3D2)*d_y + : ((d_y =3D3D d_wy+d_bnd-dd.e.y) > 0)? -(d_y>>=3D3D2)*d_y + : 0; + } + if(dd.scrx || dd.scry) + { + window.scrollTo( + d_wx + (dd.scrx =3D3D dd.obj.is_resized? dd.limW(dd.obj.w+dd.scrx)-dd.o= bj=3D .w : dd.obj.vertical? 0 : (dd.maxOffX(dd.obj.x+dd.scrx)-dd.obj.x)), + d_wy + (dd.scry =3D3D dd.obj.is_resized? dd.limH(dd.obj.h+dd.scry)-dd.o= bj=3D .h : dd.obj.horizontal? 0 : (dd.maxOffY(dd.obj.y+dd.scry)-dd.obj.y)) + ); + dd.obj.is_dragged? dd.obj.moveTo(dd.obj.x+dd.getScrollX()-d_wx, dd.obj.y= =3D +dd.getScrollY()-d_wy) + : dd.reszTo(dd.obj.w+dd.getScrollX()-d_wx, dd.obj.h+dd.getScrollY()-d_w= =3D y); + } + dd.msmoved =3D3D 0; + window.setTimeout('DDScroll()', 0x33); +} +function PICK(d_ev) +{ + dd.e =3D3D new dd.evt(d_ev); + if(dd.e.x >=3D3D dd.getWndW()+dd.getScrollX() || dd.e.y >=3D3D dd.getWndH= ()+d=3D d=2EgetScrollY()) return true; // on scrollbar + for(var d_o, d_t, d_cmp =3D3D -1, d_i =3D3D dd.elements.length; d_i;) + { + d_o =3D3D dd.elements[--d_i]; + if(dd.n4 && dd.e.but > 1 && dd.e.src =3D3D=3D3D d_o.oimg && !d_o.clone) = retu=3D rn false; + if(d_o.visible && dd.e.but <=3D3D 1 && dd.e.x >=3D3D d_o.x && dd.e.x <= =3D3D d_=3D o=2Ex+d_o.w && dd.e.y >=3D3D d_o.y && dd.e.y <=3D3D d_o.y+d_o.h) + { + if(d_o.z > d_cmp && (d_t =3D3D dd.e.src.tag).indexOf('inpu') < 0 && d_t= .i=3D ndexOf('texta') < 0 && d_t.indexOf('sele') < 0 && d_t.indexOf('opti') < 0 &= =3D & d_t.indexOf('scrol') < 0) + { + d_cmp =3D3D d_o.z; + dd.obj =3D3D d_o; + } + } + } + if(dd.obj) + { + if(dd.obj.nodrag) dd.obj =3D3D null; + else + { + dd.e.e.cancelBubble =3D3D true; + var d_rsz =3D3D dd.e.modifKey && (dd.obj.resizable || dd.obj.scalable); + if(dd.op) + { + (d_o =3D3D document.getElementById('OpBlUr')).style.pixelLeft =3D3D dd= .e.x; + d_o.style.pixelTop =3D3D dd.e.y; + (d_o =3D3D d_o.children[0].children[0]).focus(); + d_o.blur(); + } + else if(dd.ie && !dd.ie4) + { + if(document.selection && document.selection.empty) document.selection.= =3D empty(); + dd.db.onselectstart =3D3D function() + { + event.returnValue =3D3D false; + }; + } + if(d_rsz) + { + dd.obj._setCrs('se-resize'); + dd.obj.is_resized =3D3D 1; + dd.whratio =3D3D dd.obj.scalable? dd.obj.defw/dd.obj.defh : 0; + if(dd.ie) + { + if(dd.ie4) + { + window.dd_x =3D3D dd.getScrollX(); + window.dd_y =3D3D dd.getScrollY(); + } + setTimeout( + 'if(dd.obj && document.selection && document.selection.empty)'+ + '{'+ + 'document.selection.empty();'+ + 'if(dd.ie4) window.scrollTo(window.dd_x, window.dd_y);'+ + '}' + ,0); + } + dd.setMovHdl(RESIZE); + dd.reszTo(dd.obj.w, dd.obj.h); + } + else + { + dd.obj.is_dragged =3D3D 1; + dd.setMovHdl(DRAG); + } + dd.setUpHdl(DROP); + dd.embedVis('hidden'); + dd.obj._setOpaRel(0.7); + dd.obj.maximizeZ(); + dd.ofx =3D3D dd.obj.x+dd.obj.w-dd.e.x; + dd.ofy =3D3D dd.obj.y+dd.obj.h-dd.e.y; + if(window.my_PickFunc) my_PickFunc(); + if(dd.obj.pickFunc) dd.obj.pickFunc(); + DDScroll(); + return !( + dd.obj.is_resized + || dd.n4 && dd.obj.is_image + || dd.n6 || dd.w3c + ); + } + } + if(dd.downFunc) return dd.downFunc(d_ev); + return true; +} +function DRAG(d_ev) +{ + if(!dd.obj || !dd.obj.visible) return true; + if(dd.ie4 || dd.w3c || dd.n6 || dd.obj.children.length > 0xf) + { + if(dd.wait) return false; + dd.wait =3D3D 1; + setTimeout('dd.wait =3D3D 0;', dd.tiv); + } + dd.e =3D3D new dd.evt(d_ev); + if(dd.ie && !dd.e.but) + { + DROP(d_ev); + return true; + } + dd.msmoved =3D3D 1; + dd.obj.moveTo( + dd.obj.vertical? dd.obj.x : dd.maxOffX(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.w= =3D ), + dd.obj.horizontal? dd.obj.y : dd.maxOffY(dd.inWndH(dd.ofy+dd.e.y)-dd.obj= =3D .h) + ); + + if(window.my_DragFunc) my_DragFunc(); + if(dd.obj.dragFunc) dd.obj.dragFunc(); + if(dd.moveFunc) return dd.moveFunc(d_ev); + return false; +} +function RESIZE(d_ev) +{ + if(!dd.obj || !dd.obj.visible) return true; + if(dd.wait) return false; + dd.wait =3D3D 1; + setTimeout('dd.wait =3D3D 0;', dd.tiv); + dd.e =3D3D new dd.evt(d_ev); + if(dd.ie && !dd.e.but) + { + DROP(d_ev); + return true; + } + dd.msmoved =3D3D 1; + var d_w =3D3D dd.limW(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.x), d_h; + if(!dd.whratio) d_h =3D3D dd.limH(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.y); + else + { + d_h =3D3D dd.limH(dd.inWndH(Math.round(d_w/dd.whratio)+dd.obj.y)-dd.obj.= y); + d_w =3D3D Math.round(d_h*dd.whratio); + } + dd.reszTo(d_w, d_h); + if(window.my_ResizeFunc) my_ResizeFunc(); + if(dd.obj.resizeFunc) dd.obj.resizeFunc(); + if(dd.moveFunc) return dd.moveFunc(d_ev); + return false; +} +function DROP(d_ev) +{ + if(dd.obj) + { + if(dd.obj.is_dragged) + { + if(!dd.obj.is_image) dd.getWH(dd.obj); + } + else if(dd.n4) + { + if(dd.obj.is_image) + { + dd.n4RectVis(0); + dd.obj.resizeTo(dd.obj.w, dd.obj.h); + } + } + if(!dd.n4 || !dd.obj.is_image) dd.recalc(); + dd.setMovHdl(dd.moveFunc); + dd.setUpHdl(dd.upFunc); + if(dd.db) dd.db.onselectstart =3D3D null; + dd.obj._setOpaRel(1.0); + dd.obj._setCrs(dd.obj.cursor); + dd.embedVis('visible'); + dd.obj._resetZ(); + dd.e =3D3D new dd.evt(d_ev); + if(window.my_DropFunc) my_DropFunc(); + if(dd.obj.dropFunc) dd.obj.dropFunc(); + dd.msmoved =3D3D dd.obj.is_dragged =3D3D dd.obj.is_resized =3D3D dd.whra= tio =3D =3D3D 0; + dd.obj =3D3D null; + } + dd.setDwnHdl(PICK); +} +function SET_DHTML() +{ + var d_a =3D3D arguments, d_ai, d_htm =3D3D '', d_o, d_i =3D3D d_a.length; + while(d_i) + { + if(!(d_ai =3D3D d_a[--d_i]).indexOf('c:')) dd.cursor =3D3D d_ai.substrin= g(2); + else if(d_ai =3D3D=3D3D NO_ALT) dd.noalt =3D3D 1; + else if(d_ai =3D3D=3D3D SCROLL) dd.scroll =3D3D 1; + else if(d_ai =3D3D=3D3D RESET_Z) dd.re_z =3D3D 1; + else if(d_ai =3D3D=3D3D RESIZABLE) dd.resizable =3D3D 1; + else if(d_ai =3D3D=3D3D SCALABLE) dd.scalable =3D3D 1; + else if(d_ai =3D3D=3D3D TRANSPARENT) dd.diaphan =3D3D 1; + else + { + d_o =3D3D new DDObj(d_ai); + dd.addElt(d_o); + d_htm +=3D3D d_o.t_htm || ''; + if(d_o.oimg && d_o.cpy_n) + { + for(var d_l =3D3D d_o.cpy_n, d_j =3D3D 0; d_j < d_l;) + { + var d_p =3D3D new DDObj(d_o.name+d_o.cmd, ++d_j); + dd.addElt(d_p, d_o); + d_p.defz =3D3D d_o.defz+d_j; + d_p.original =3D3D d_o; + d_htm +=3D3D d_p.t_htm; + } + } + } + } + if (dd.n4 || dd.n6 || dd.ie || dd.op || dd.w3c) document.write( + (dd.n4? '<div style=3D3D"position:absolute;"><\/div>\n' + : (dd.op && !dd.op6)? '<div id=3D3D"OpBlUr" style=3D3D"position:absolute= ;vis=3D ibility:hidden;width:0px;height:0px;"><form><input type=3D3D"text" style=3D= 3D"w=3D idth:0px;height:0px;"><\/form><\/div>' + : '') + d_htm + ); + dd.z =3D3D 0x33; + for(d_i =3D3D dd.elements.length; d_i;) + { + dd.addProps(d_o =3D3D dd.elements[--d_i]); + if(d_o.is_image && !d_o.original && !d_o.clone) + dd.n4? d_o.oimg.src =3D3D spacer : d_o.oimg.style.visibility =3D3D 'hid= den'; + } + dd.mkWzDom(); + if(window.onload) dd.loadFunc =3D3D window.onload; + if(window.onunload) dd.uloadFunc =3D3D window.onunload; + window.onload =3D3D dd.initz; + window.onunload =3D3D dd.finlz; + dd.setDwnHdl(PICK); +} +function ADD_DHTML(d_o) // layers only! +{ + d_o =3D3D new DDObj(d_o); + dd.addElt(d_o); + dd.addProps(d_o); + dd.mkWzDom(); +} + + + + +//////////////////////////////////////////////////////////// +// If not needed, all code below this line may be removed + + +// For backward compatibility +dd.d =3D3D document; // < v. 2.72 +var RESET_ZINDEX =3D3D RESET_Z; // < 3.44 +var KEYDOWN_RESIZE =3D3D RESIZABLE; // < 4.43 +var CURSOR_POINTER =3D3D CURSOR_HAND; // < 4.44 +var NO_SCROLL =3D3D ''; // < v. 4.49 + + + + +//////////////////////////////////////////////////////////// +// FUNCTIONS FOR EXTENDED SCRIPTING +// Use these for your own extensions, +// or to call functions defined elsewhere + + + +/* my_PickFunc IS AUTOMATICALLY CALLED WHEN AN ITEM STARTS TO BE DRAGGED. +The following objects/properties are accessible from here: + +- dd.e: current mouse event +- dd.e.property: access to a property of the current mouse event. + Mostly requested properties: + - dd.e.x: document-related x co-ordinate + - dd.e.y: document-related y co-ord + - dd.e.src: target of mouse event (not identical with the drag drop obje= =3D ct itself). + - dd.e.button: currently pressed mouse button. Left button: dd.e.button = =3D <=3D3D 1 + +- dd.obj: reference to currently dragged item. +- dd.obj.property: access to any property of that item. +- dd.obj.method(): for example dd.obj.resizeTo() or dd.obj.swapImage() . + Mostly requested properties: + - dd.obj.name: image name or layer ID passed to SET_DHTML(); + - dd.obj.x and dd.obj.y: co-ordinates; + - dd.obj.w and dd.obj.h: size; + - dd.obj.is_dragged: 1 while item is dragged, else 0; + - dd.obj.is_resized: 1 while item is resized, i.e. if <ctrl> or <shift> i= =3D s pressed, else 0 + +For more properties and details, visit the API documentation +at http://www.walterzorn.com/dragdrop/api_e.htm (english) or +http://www.walterzorn.de/dragdrop/api.htm (german) */ +function my_PickFunc() +{ +} + + + + +/* my_DragFunc IS CALLED WHILE AN ITEM IS DRAGGED +See the description of my_PickFunc above for what's accessible from here. = =3D */ +function my_DragFunc() +{ + //window.status =3D3D 'dd.elements.' + dd.obj.name + '.x =3D3D ' + dd.ob= j=2Ex =3D + ' dd.elements.' + dd.obj.name + '.y =3D3D ' + dd.obj.y; +} + + + + +/* my_ResizeFunc IS CALLED WHILE AN ITEM IS RESIZED +See the description of my_PickFunc above for what's accessible from here. = =3D */ +function my_ResizeFunc() +{ + //window.status =3D3D 'dd.elements.' + dd.obj.name + '.w =3D3D ' + dd.ob= j=2Ew =3D + ' dd.elements.' + dd.obj.name + '.h =3D3D ' + dd.obj.h; +} + + + + +/* THIS ONE IS CALLED ONCE AN ITEM IS DROPPED +See the description of my_PickFunc for what's accessible from here. +Here may be investigated, for example, what's the name (dd.obj.name) +of the dropped item, and where (dd.obj.x, dd.obj.y) it has been dropped...= =3D */ +function my_DropFunc() +{ +} |