/* DynAPI Distribution DynObject, DynAPI Object, UserAgent, Library, Functions The DynAPI Distribution is distributed under the terms of the GNU LGPL license. */ function DynObject() { this.id = "DynObject"+DynObject._c++; DynObject.all[this.id] = this; }; var p = DynObject.prototype; p.getClassName = function() {return this._className}; p.getClass = function() {return dynapi.frame[this._className]}; p.isClass = function(n) {return DynObject.isClass(this._className,n)}; p.addMethod = function(n,fn) {this[n] = fn}; p.removeMethod = function(n) {this[n] = null}; p.setID = function(id,isInline,noImports) { if (this.id) delete DynObject.all[this.id]; this.id = id; this.isInline=isInline; this._noInlineValues=noImports; DynObject.all[this.id] = this; }; p.toString = function() {return "DynObject.all."+this.id}; DynObject.all = []; DynObject._c = 0; DynObject.isClass = function(cn,n) { if (cn == n) return true; else { var c = dynapi.frame[cn]; var p = c.prototype._pClassName; if (p) return DynObject.isClass(p,n); else return false; } }; function _UserAgent() { var b = navigator.appName; var v = this.version = navigator.appVersion; var ua = navigator.userAgent.toLowerCase(); this.v = parseInt(v); this.safari = ua.indexOf("safari")>-1; // always check for safari & opera this.opera = ua.indexOf("opera")>-1; // before ns or ie this.ns = !this.opera && !this.safari && (b=="Netscape"); this.ie = !this.opera && (b=="Microsoft Internet Explorer"); this.gecko = ua.indexOf('gecko')>-1; // check for gecko engine if (this.ns) { this.ns4 = (this.v==4); this.ns6 = (this.v>=5); this.b = "Netscape"; }else if (this.ie) { this.ie4 = this.ie5 = this.ie55 = this.ie6 = false; if (v.indexOf('MSIE 4')>0) {this.ie4 = true; this.v = 4;} else if (v.indexOf('MSIE 5')>0) {this.ie5 = true; this.v = 5;} else if (v.indexOf('MSIE 5.5')>0) {this.ie55 = true; this.v = 5.5;} else if (v.indexOf('MSIE 6')>0) {this.ie6 = true; this.v = 6;} this.b = "MSIE"; }else if (this.opera) { this.v=parseInt(ua.substr(ua.indexOf("opera")+6,1)); // set opera version this.opera6=(this.v>=6); this.opera7=(this.v>=7); this.b = "Opera"; }else if (this.safari) { this.ns6 = (this.v>=5); // ns6 compatible correct? this.b = "Safari"; } this.dom = (document.createElement && document.appendChild && document.getElementsByTagName)? true : false; this.def = (this.ie||this.dom); this.win32 = ua.indexOf("win")>-1; this.mac = ua.indexOf("mac")>-1; this.other = (!this.win32 && !this.mac); this.supported = (this.def||this.ns4||this.ns6||this.opera)? true:false; this.broadband=false; this._bws=new Date; // bandwidth timer start }; function DynAPIObject() { this.DynObject = DynObject; this.DynObject(); this.version = '3.0.0-beta2'; this.loaded = false; this.ua = new _UserAgent(); this._loadfn = []; this._unloadfn = []; var f = this.frame = window; var url = f.document.location.href; url = url.substring(0,url.lastIndexOf('/')+1); this.documentPath = url; var o = this; this.library = {}; this.library.setPath = function(p) {o.library.path = p}; f.onload = function() { o.loaded = true; if (!o.ua.supported) return alert('Unsupported Browser. Exiting.'); if (o.library._create) o.library._create(); // calls dynapi._onLoad() after loading necessary files else setTimeout(o+'._onLoad()',1); }; f.onunload = function() { for (var i=0;i'; return t; }; dynapi.functions = { removeFromArray : function(array, index, id) { var which=(typeof(index)=="object")?index:array[index]; if (id) delete array[which.id]; else for (var i=0; i<\/script>'; document.write(s); }; // adds package(s) to the library p.addPackage = function(pkg, path) { var ps; if (pkg.indexOf('.')) ps = pkg.split('.'); else ps = [pkg]; var p = dynapi.frame; for (var i=0;i tag for the object p.include = function() { var a = arguments; if (a[0]==true) a=a[1]; // arguments used ONLY by packages.js // buffer includes until packages(.js) are loaded if (!this._pakLoaded) { if(!this._buffer) this._buffer=[]; this._buffer[this._buffer.length]=a; return; } if (dynapi.loaded) this.load(a); else { var list = this._queue(a); var src; for (var i=0;i<\/script>'); } } }; p.load = p.reload = p.loadScript = p.reloadScript = function(n) { dynapi.debug.print('Warning: dynapi.library load extensions not included'); }; dynapi.library = new DynAPILibrary(); // deprecated var DynAPI = dynapi;