3 * $Revision: 1.3 $ $Date: 2003/03/17 03:44:20 $
6 /* ***** BEGIN LICENSE BLOCK *****
7 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
9 * The contents of this file are subject to the Mozilla Public License Version
10 * 1.1 (the "License"); you may not use this file except in compliance with
11 * the License. You may obtain a copy of the License at
12 * http://www.mozilla.org/MPL/
14 * Software distributed under the License is distributed on an "AS IS" basis,
15 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
16 * for the specific language governing rights and limitations under the
19 * The Original Code is Bob Clary code.
21 * The Initial Developer of the Original Code is
23 * Portions created by the Initial Developer are Copyright (C) 2000
24 * the Initial Developer. All Rights Reserved.
26 * Contributor(s): Bob Clary <bc@bclary.com>
28 * ***** END LICENSE BLOCK ***** */
30 if (!document.getElementById || navigator.userAgent.indexOf('Opera') != -1)
32 // assign error handler for downlevel browsers
33 // Note until Opera improves it's overall support
34 // for JavaScript and the DOM, it must be considered downlevel
36 window.onerror = defaultOnError;
38 function defaultOnError(msg, url, line)
40 // handle bug in NS6.1, N6.2
41 // where an Event is passed to error handlers
42 if (typeof(msg) != 'string')
44 msg = 'unknown error';
46 if (typeof(url) != 'string')
48 url = document.location;
51 alert('An error has occurred at ' + url + ', line ' + line + ': ' + msg);
55 function xbLibrary(path)
57 if (path.charAt(path.length-1) == '/')
59 path = path.substr(0, path.length-1)
64 // dynamically loaded scripts
66 // it is an error to reference anything from the dynamically loaded file inside the
67 // same script block. This means that a file can not check its dependencies and
68 // load the files for it's own use. someone else must do this.
70 xbLibrary.prototype.loadScript =
73 document.write('<script language="javascript" src="' + this.path + '/' + scriptName + '"><\/script>');
78 xblibrary = new xbLibrary('./');