/* DynAPI Distribution DynEvent, EventObject, DynElement Classes The DynAPI Distribution is distributed under the terms of the GNU LGPL license. */ function DynEvent(type,src) { this.type = type; this.src = src; this.origin = src; this.propagate = true; this.bubble = false; this.bubbleChild = null; this.defaultValue = true; }; var p = DynEvent.prototype; p.getType = function() {return this.type}; p.getSource = function() {return this.src}; p.getOrigin=function() {return this.origin}; p.stopPropagation = function() {this.propagate = false}; p.preventBubble = function() {this.bubble = false}; p.preventDefault = function() {this.defaultValue = false}; p.getBubbleChild = function() {return this.bubbleChild}; function EventObject() { this.DynObject = DynObject; this.DynObject(); this._listeners = []; }; EventObject._SubClass={}; p = dynapi.setPrototype('EventObject','DynObject'); p.addEventListener = function(el) { if (el) { for (var i=0;i=ch.length) break; } }; ch.length = 0; this._aSz = aSz; if(this._aSz) this._adjustSize(); // adjust size if necessary }; p.deleteChild = function(c) { // removes & destroy child var l = this.children.length; for (var i=0;i0 && a.left && typeof(a.left)=='string')? tw*(parseInt(a.left)/100):a.left; var aright=(tw>0 && a.right && typeof(a.right)=='string')? tw*(parseInt(a.right)/100):a.right; var atop=(th>0 && a.top && typeof(a.top)=='string')? th*(parseInt(a.top)/100):a.top; var abottom=(th>0 && a.bottom && typeof(a.bottom)=='string')? th*(parseInt(a.bottom)/100):a.bottom; var x = aleft; var y = atop; var w = null; var h = null; var dlyrWidth=dlyr.getWidth(); var dlyrHeight=dlyr.getHeight(); if (a.stretchH!=null) { if(typeof(a.stretchH)!='string') w=a.stretchH; else { if(a.stretchH=='*') w = tw - ((aleft!=null)? aleft:0); else w = tw*(parseInt(a.stretchH)/100); } dlyrWidth=w; } if (a.centerH!=null) { x = Math.ceil(tw/2 - dlyrWidth/2 + a.centerH); }else if (aright!=null) { if (aleft!=null) w = (tw - aright) - aleft; else x = (tw - dlyrWidth) - aright; if(tw<=0 && x<0) x=null; // ns4 needs x>=0 } if (a.stretchV!=null) { if(typeof(a.stretchV)!='string') h=a.stretchV; else { if(a.stretchV=='*') h = th - ((atop!=null)? atop:0); else h = th*(parseInt(a.stretchV)/100); } dlyrHeight=h; } if (a.centerV!=null) { y = Math.ceil(th/2 - dlyrHeight/2 + a.centerV); }else if (abottom!=null) { if (atop!=null) h = (th - abottom) - atop; else y = (th - dlyrHeight) - abottom; if(th<=0 && y<0) y=null; // ns4 needs y>=0 } if(padX) {x=(x)? x:0;x+=padX} if(padY) {y=(y)? y:0;y+=padY} var tmp=dlyr._hasAnchor; dlyr._hasAnchor=false; // ignore anchor updates of this layer if(x!=null||y!=null) dlyr.setLocation(x,y); if(w!=null||h!=null) dlyr.setSize(w,h); dlyr._hasAnchor = tmp; // useful for preventing stack overflow }; p._updateAnchors = function() { var tw = this.w; var th = this.h; if (tw==null && th==null) return; for (id in this._childAnchors) this._updateAnchor(id); }; // Bandwidth timer stop var ua=dynapi.ua; ua._bwe=new Date; ua.broadband=((ua._bwe-ua._bws)<=1500)? true:false;