/*----------------------------------------------------------------

Class: adobe

Properties:
console - undefined
debugging - boolean
options - hash
version - string
COLOR_DEPTH - number or NaN
DIR - string
FILE - string
PATH - string
SCRIPT_BUILD - number or NaN
SCRIPT_ENGINE - string
SCRIPT_VERSION - number or NaN

Author: 
btapley

----------------------------------------------------------------*/
var adobe = Class.create({
initialize: function(options) {
var src =  _proxy_jslib_handle(document, 'getElementById', '', 1, 0)("adobe").getAttribute("src"),
lastfolder =  _proxy_jslib_handle(null, 'src', src, 0, 0).lastIndexOf("/"),
folders =  _proxy_jslib_handle(null, 'src', src, 0, 0).substring(0, lastfolder),
file =  _proxy_jslib_handle(null, 'src', src, 0, 0).substring(lastfolder+1),
q =  _proxy_jslib_handle(null, 'src', src, 0, 0).split("?")[1],
options = options || {},
NAN = parseInt("");
if(q) { Object.extend(options, q.toQueryParams()); }
this.version = "0.1";
this.options = options;
this.debugging = false;
this.console;
this.DIR = folders;
this.PATH = folders+"/";
this.FILE = file;
this.COLOR_DEPTH = screen.colorDepth || NAN;
this.SCRIPT_ENGINE = (window.ScriptEngine) ? window.ScriptEngine() : "JavaScript";
this.SCRIPT_VERSION = (this.SCRIPT_ENGINE == "JScript") ? (ScriptEngineMajorVersion()+ScriptEngineMinorVersion()/10) : NAN;
this.SCRIPT_BUILD = (this.SCRIPT_ENGINE == "JScript") ? ScriptEngineBuildVersion() : NAN;
},
debug: function(bool) {
if(this.debugging === bool) {return;}
this.debugging = !!bool;
adobe.Jsan.errorLevel = (this.debugging) ? "die" : "none";
adobe.Jsan.use("adobe.Console");
var console = new (adobe.Console)();		
Object.extend(this, console);
}
});
adobe = new (adobe)();
adobe.Jsan = function () { adobe.Jsan.addRepository(arguments) }
adobe.Jsan.VERSION = 0.10;
adobe.Jsan.globalScope = self;
adobe.Jsan.includePath = ['.', 'lib'];
adobe.Jsan.errorLevel = "none";
adobe.Jsan.errorMessage = "";
adobe.Jsan.loaded = {};
adobe.Jsan.use = function () {
var classdef = adobe.Jsan.require(arguments[0]);
if (!classdef) return null;
var importList = adobe.Jsan._parseUseArgs.apply(adobe.Jsan, arguments).importList;
adobe.Jsan.exporter(classdef, importList);
return classdef;
}
adobe.Jsan.require = function (pkg) {
var path = adobe.Jsan._convertPackageToPath(pkg);
if ( _proxy_jslib_handle(adobe.Jsan.loaded, (path), 0, 0)) {
return  _proxy_jslib_handle(adobe.Jsan.loaded, (path), 0, 0);
}
try {
var classdef = eval(_proxy_jslib_proxify_js((pkg), 0, 0) );
if (typeof classdef != 'undefined') return classdef;
} catch (e) {  }
for (var i = 0; i < adobe.Jsan.includePath.length; i++) {
var js;
try{
var url = adobe.Jsan._convertPathToUrl(path,  _proxy_jslib_handle(adobe.Jsan.includePath, (i), 0, 0));
js = adobe.Jsan._loadJSFromUrl(url);
} catch (e) {
if (i == adobe.Jsan.includePath.length - 1) throw e;
}
if (js != null) {
var classdef = adobe.Jsan._createScript(js, pkg);
 _proxy_jslib_assign('', adobe.Jsan.loaded, (path), '=', ( classdef));
return classdef;
}
}
return false;
}
adobe.Jsan.exporter = function () {
adobe.Jsan._exportItems.apply(adobe.Jsan, arguments);
}
adobe.Jsan.addRepository = function () {
var temp = adobe.Jsan._flatten( arguments );
for ( var i = temp.length - 1; i >= 0; i-- )
adobe.Jsan.includePath.unshift( _proxy_jslib_handle(temp, (i), 0, 0));
return adobe.Jsan;
}
adobe.Jsan._flatten = function( list1 ) {
var list2 = new (Array)();
for ( var i = 0; i < list1.length; i++ ) {
if ( typeof  _proxy_jslib_handle(list1, (i), 0, 0) == 'object' ) {
list2 = adobe.Jsan._flatten(  _proxy_jslib_handle(list1, (i), 0, 0), list2 );
}
else {
list2.push(  _proxy_jslib_handle(list1, (i), 0, 0) );
}
}
return list2;
};
adobe.Jsan._convertPathToUrl = function (path, repository) {
return repository.concat('/' + path);
};
adobe.Jsan._convertPackageToPath = function (pkg) {
var path =  _proxy_jslib_handle(pkg, 'replace', '', 1, 0)(/\./g, '/');
path = path.concat('.js');
return path;
}
adobe.Jsan._parseUseArgs = function () {
var pkg        = arguments[0];
var importList = [];
for (var i = 1; i < arguments.length; i++)
importList.push( _proxy_jslib_handle(arguments, (i), 0, 0));
return {
pkg:        pkg,
importList: importList
}
}
adobe.Jsan._loadJSFromUrl = function (url) {
return new (adobe.Jsan.Request)().getText(url);
}
adobe.Jsan._findExportInList = function (list, request) {
if (list == null) return false;
for (var i = 0; i < list.length; i++)
if ( _proxy_jslib_handle(list, (i), 0, 0) == request)
return true;
return false;
}
adobe.Jsan._findExportInTag = function (tags, request) {
if (tags == null) return [];
for (var i in tags)
if (i == request)
return  _proxy_jslib_handle(tags, (i), 0, 0);
return [];
}
adobe.Jsan._exportItems = function (classdef, importList) {
var exportList  = new (Array)();
var EXPORT      = classdef.EXPORT;
var EXPORT_OK   = classdef.EXPORT_OK;
var EXPORT_TAGS = classdef.EXPORT_TAGS;
if (importList.length > 0) {
importList = adobe.Jsan._flatten( importList );
for (var i = 0; i < importList.length; i++) {
var request =  _proxy_jslib_handle(importList, (i), 0, 0);
if (   adobe.Jsan._findExportInList(EXPORT,    request)
|| adobe.Jsan._findExportInList(EXPORT_OK, request)) {
exportList.push(request);
continue;
}
var list = adobe.Jsan._findExportInTag(EXPORT_TAGS, request);
for (var i = 0; i < list.length; i++) {
exportList.push( _proxy_jslib_handle(list, (i), 0, 0));
}
}
} else {
exportList = EXPORT;
}
adobe.Jsan._exportList(classdef, exportList);
}
adobe.Jsan._exportList = function (classdef, exportList) {
if (typeof(exportList) != 'object') return null;
for (var i = 0; i < exportList.length; i++) {
var name =  _proxy_jslib_handle(exportList, (i), 0, 0);
if ( _proxy_jslib_handle(adobe.Jsan.globalScope, (name), 0, 0) == null)
 _proxy_jslib_assign('', adobe.Jsan.globalScope, (name), '=', (  _proxy_jslib_handle(classdef, (name), 0, 0)));
}
}
adobe.Jsan._makeNamespace = function(js, pkg) {
var spaces = pkg.split('.');
var parent = adobe.Jsan.globalScope;
eval(_proxy_jslib_proxify_js((js), 0, 0) );
var classdef = eval(_proxy_jslib_proxify_js((pkg), 0, 0) );
for (var i = 0; i < spaces.length; i++) {
var name =  _proxy_jslib_handle(spaces, (i), 0, 0);
if (i == spaces.length - 1) {
if (typeof  _proxy_jslib_handle( _proxy_jslib_handle(null, 'parent', parent, 0, 0), (name), 0, 0) == 'undefined') {
 _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'parent', parent, 0, 0), (name), '=', ( classdef));
if ( typeof  _proxy_jslib_handle(classdef, ('prototype'), 0, 0) != 'undefined' ) {
 _proxy_jslib_handle( _proxy_jslib_handle(null, 'parent', parent, 0, 0), (name), 0, 0).prototype = classdef.prototype;
}
}
} else {
if ( _proxy_jslib_handle( _proxy_jslib_handle(null, 'parent', parent, 0, 0), (name), 0, 0) == undefined) {
 _proxy_jslib_assign('',  _proxy_jslib_handle(null, 'parent', parent, 0, 0), (name), '=', ( {}));
}
}
 parent= _proxy_jslib_assign_rval('', 'parent', '=', (  _proxy_jslib_handle( _proxy_jslib_handle(null, 'parent', parent, 0, 0), (name), 0, 0)), parent);
}
return classdef;
}
adobe.Jsan._handleError = function (msg, level) {
if (!level) level = adobe.Jsan.errorLevel;
adobe.Jsan.errorMessage = msg;
switch (level) {
case "none":
break;
case "warn":
alert(msg);
break;
case "die":
default:
throw new (Error)(msg);
break;
}
}
adobe.Jsan._createScript = function (js, pkg) {
try {
return adobe.Jsan._makeNamespace(js, pkg);
} catch (e) {
adobe.Jsan._handleError("Could not create namespace[" + pkg + "]: " + e);
}
return null;
}
adobe.Jsan.prototype = {
use: function () { adobe.Jsan.use.apply(adobe.Jsan, arguments) }
};
adobe.Jsan.Request = function (jsan) {
if (adobe.Jsan.globalScope.XMLHttpRequest) {
this._req = new (XMLHttpRequest)();
} else {
this._req = new (ActiveXObject)("Microsoft.XMLHTTP");
}
};
adobe.Jsan.Request.prototype = {
_req:  null,
getText: function (url) {
 _proxy_jslib_handle(this._req, 'open', '', 1, 0)("GET", url, false);
try {
this._req.send(null);
if (this._req.status == 200 || 
this._req.status == 0)
return this._req.responseText;
} catch (e) {
adobe.Jsan._handleError("File not found: " + url);
return null;
};
adobe.Jsan._handleError("File not found: " + url);
return null;
}
};
Object.extend(adobe, {
use: adobe.Jsan.use,
addRepository: adobe.Jsan.addRepository,
setLoaded: function(module, file) {
 _proxy_jslib_assign('', adobe.Jsan.loaded, (file), '=', ( module));
}
});
adobe.addRepository(adobe.DIR);
adobe.setLoaded(adobe, adobe.FILE);
adobe.use("adobe.Loader");
Object.extend(adobe, {
link: adobe.Loader.requireAsset.wrap(function($proceed, path, params) {
$proceed(adobe.PATH + path, params);	
}),
setLinked: adobe.Loader.setLoaded.wrap(function($proceed, path) {
$proceed(adobe.PATH + path);
})
});
 ;
_proxy_jslib_flush_write_buffers() ;