//////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2001 - 2006 Robert Cummings.                               //
//                                                                          //
// The contents of this source file contribute to the InterJinn software    //
// package and are subject to version 1.0 of the InterJinn license. Before  //
// using the contents of this file, or any part of the InterJinn package,   //
// you must first agree to the terms of the license. The license should     //
// have been bundled with this package in the file LICENSE. If you did not  //
// receive a copy of the InterJinn license then you may find a copy at:     //
//                                                                          //
//     http://www.interjinn.com/licenses/license_1_0.txt                    //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
var gJinnGlobals = new Array();gJinnGlobals['interJinn'] = new Array();function ijinn_isset( test ){if( typeof( test ) == 'undefined' ){return false;}
return true;}
function ijinn_default( test, value ){if( ijinn_isset( test ) ){return test;}
if( ijinn_isset( value ) ){return value;}
return null;}
function ijinn_getInterJinnVar( name, dValue ){returnValue = ijinn_default( dValue, null );return ijinn_default( gJinnGlobals['interJinn'][name], returnValue );}
function ijinn_getJdl(){return ijinn_getInterJinnVar( 'jdl' );}
function ijinn_getArgsPunter( args, offset, preceded ){offset = ijinn_default( offset, 0 );preceded = ijinn_default( preceded, false );var punter = new Array();if( preceded
&&
offset < args.length ){punter[punter.length] = '';}
for( var i = offset; i < args.length; i++ ){punter[punter.length] = 'arguments[' + i + ']';}
return punter.join( ', ' );}
function ijinn_serviceExists( name ){jdl = ijinn_getJdl();return jdl.serviceExists( name );}
function ijinn_libraryExists( name ){return ijinn_serviceExists( name );}
function ijinn_getService(){jdl = ijinn_getJdl();eval('var service = '
+ 'jdl.getServiceUsingWindow( '
+ 'window' + ijinn_getArgsPunter( arguments, 0, true ) + ' );'
);return service;}
function ijinn_getLibrary(){jdl = ijinn_getJdl();eval('var service = '
+ 'jdl.getServiceUsingWindow( '
+ 'window' + ijinn_getArgsPunter( arguments, 0, true ) + ' );'
);return service;}
function ijinn_trim( aString ){return aString.replace( /^\s+|\s+$/g, '' );}
function ijinn_normalizePath( path ){return path.replace( /\/+/g, '/' );}
function ijinn_localizePath( path, root, doUnmarked ){root       = ijinn_default( root, null );doUnmarked = ijinn_default( doUnmarked, false );path = ijinn_trim( path );if( path.charAt( 0 ) == '/'
&&
path.charAt( 1 ) == '/'
&&
path.charAt( 2 ) == '/' ){path = gJinnGlobals['interJinn']['coreRoot'] + '/' + path;}
else
if( path.charAt( 0 ) == '/'
&&
path.charAt( 1 ) == '/' ){if( root === null ){root = gJinnGlobals['interJinn']['codeRoot'];}
path = root + '/' + path;}
else
if( doUnmarked
&&
path.charAt( 0 ) != '/' ){if( root === null ){root = gJinnGlobals['interJinn']['codeRoot'];}
path = root + '/' + path;}
path = ijinn_normalizePath( path );return path;}
function ijinn_getContent( path ){var content = false;path = ijinn_localizePath( path );if( navigator.appName == 'Microsoft Internet Explorer' ){httpRequest = new ActiveXObject( 'Microsoft.XMLHTTP' );}
else{httpRequest = new XMLHttpRequest();}
httpRequest.open( 'get', path, false );httpRequest.send( null );if( httpRequest.status == 200 ){content = httpRequest.responseText;}
return content;}
function ijinn_includePrimitive( path, root, doUnmarked ){if( typeof( gJinnGlobals['interJinn']['includeHistoryInit'] ) == 'undefined'
||
!gJinnGlobals['interJinn']['includeHistoryInit'] ){gJinnGlobals['interJinn']['includeHistoryInit'] = true;gJinnGlobals['interJinn']['includeHistory'] = new Array();gJinnGlobals['interJinn']['includeSourceCumulation'] = '';}
realPath = ijinn_localizePath( path, root, doUnmarked );if( gJinnGlobals['interJinn']['includeHistory'][realPath] ){return true;}
gJinnGlobals['interJinn']['includeHistory'][realPath] = true;content = ijinn_getContent( realPath );if( typeof( content ) == 'string' ){gJinnGlobals['interJinn']['includeSourceCumulation'] += content;self.eval( gJinnGlobals['interJinn']['includeSourceCumulation'] );return true;}
return false;}
function ijinn_include( path ){return ijinn_includePrimitive( path, null, false );}
function ijinn_objectHandler( obj, func, extra ){var myself = obj;var tExtra = extra;return function( event ){var tEvent = null;if( !(tEvent = event) ){if( obj.getWindow ){tEvent = obj.getWindow().event;}}
return func.call( obj, tEvent, tExtra );}}
function JinnBaseClass(){this.jinnit();}
JinnBaseClass_proto = JinnBaseClass.prototype;JinnBaseClass_proto.jinnit = function(){this.___jinnWindow = window;}
JinnBaseClass_proto.getInterJinnVars = function(){returnValue = gJinnGlobals['interJinn'];return returnValue;}
JinnBaseClass_proto.getInterJinnVar = function( name, dValue ){returnValue = this.defaultValue( dValue, null );return this.defaultValue( gJinnGlobals['interJinn'][name], returnValue );}
JinnBaseClass_proto.setInterJinnVar = function( name, value ){gJinnGlobals['interJinn'][name] = value;}
var gJinnUrl = null;var gJinnUrlBits = new Object();var gJinnUrlVars = new Object();JinnBaseClass_proto.getUrl = function(){if( gJinnUrl === null ){var win = this.getWindow();var loc = win.location;gJinnUrl = ('' + loc).replace( /\?.*$/, '' );var varString = '' + loc.search.replace( /^\?/, '' );var pairs = varString.split( '&' );var pair = null;var bits = null;for( var key = 0; key < pairs.length; key++ ){pair = pairs[key];bits = pair.split( '=' );if( ('' + bits[0]) != '' ){gJinnUrlVars['' + bits[0]] = this.defaultValue( bits[1], '' );}}
gJinnUrlBits['protocol'] = loc.protocol.replace( /:$/, '' );gJinnUrlBits['server']   = loc.hostname;gJinnUrlBits['port']     = loc.port;gJinnUrlBits['user']     = '';gJinnUrlBits['password'] = '';gJinnUrlBits['absolute'] = loc.pathname;gJinnUrlBits['relative'] = '';gJinnUrlBits['page']     = loc.pathname.replace( /\/[^/]*$/, '' );gJinnUrlBits['params']   = gJinnUrlVars;gJinnUrlBits['anchor']   = loc.hash;}
return gJinnUrl;}
JinnBaseClass_proto.getUrlAbsolute = function(){if( gJinnUrl === null ){this.getUrl();}
var url = gJinnUrlBits['absolute'];var vars = new Array();for( var name in gJinnUrlVars ){vars[vars.length] =
this.urlencode( name )
+ '='
+ this.urlencode( gJinnUrlVars[name] );}
if( vars.length ){url = url + '?' + vars.join( '&' );}
return '' + url;}
JinnBaseClass_proto.getUrlVar = function( name, dValue ){if( gJinnUrl === null ){this.getUrl();}
return this.defaultValue( gJinnUrlVars[name], dValue );}
JinnBaseClass_proto.serviceExists = function( name ){return ijinn_serviceExists( name );}
JinnBaseClass_proto.libraryExists = function( name ){return ijinn_serviceExists( name );}
JinnBaseClass_proto.getService = function(){eval('var service = '
+ 'ijinn_getService( '
+ this.getArgsPunter( arguments ) + ' );'
);return service;}
JinnBaseClass_proto.getLibrary = function(){eval('var service = '
+ 'ijinn_getService( '
+ this.getArgsPunter( arguments ) + ' );'
);return service;}
JinnBaseClass_proto.getImageBase = function(){return this.getInterJinnVar( 'imageBase', '' );}
JinnBaseClass_proto.getPageBase = function(){return this.getInterJinnVar( 'pageBase', '' );;}
JinnBaseClass_proto.getPageRoot = function(){return this.getInterJinnVar( 'pageRoot', '' );}
JinnBaseClass_proto.redirect = function( path ){path = this.localizePage( path );var window = this.getWindow();window.location = path;}
JinnBaseClass_proto.isset = function( value ){return ijinn_isset( value );}
JinnBaseClass_proto.defaultValue = function( value, dValue ){return ijinn_default( value, dValue );}
JinnBaseClass_proto.defaultForNaN = function( value, dValue ){value = parseInt( value );dValue = this.defaultValue( dValue, 0 );if( isNaN( value ) ){return dValue;}
return value;}
JinnBaseClass_proto.shallowCopy = function( obj ){if( typeof( obj ) != 'object' ){return obj;}
if( obj === null ){return obj;}
var copy = new Object();for( var property in obj ){copy[property] = obj[property];}
return copy;}
JinnBaseClass_proto.trim = function( aString ){return ijinn_trim( aString );}
JinnBaseClass_proto.numberFormat = function
( number, decimals, decimalPoint, groupSep ){decimals     = 1  * this.defaultValue( decimals, 0 );decimalPoint = '' + this.defaultValue( decimalPoint, '.' );groupSep     = '' + this.defaultValue( groupSep, ',' );var sNumber  = this.trim( '' + number ).split( '.' );var sInteger = '' + this.defaultValue( sNumber[0], 0 );var sDecimal = '' + this.defaultValue( sNumber[1], 0 );sInteger = '' + parseInt( sInteger );sDecimal = '' + parseInt( sDecimal );if( isNaN( (1 * sInteger) ) || isNaN( (1 * sDecimal) ) ){return 'NaN';}
sNumber = '';var doSep = 2;var i = sInteger.length;for( i = sInteger.length - 1; i >= 0; i-- ){sNumber = sInteger.charAt( i ) + sNumber;if( doSep === 0 && i > 0 ){doSep = 2;sNumber = groupSep + sNumber;}
else{doSep--;}}
if( sDecimal.length > decimals ){sDecimal = sDecimal.substr( 0, decimals );}
else{while( sDecimal.length < decimals ){sDecimal += '0';}}
if( decimals > 0 ){sNumber = sNumber + decimalPoint + sDecimal;}
return sNumber;}
JinnBaseClass_proto.sprintf = function(){if (!arguments || arguments.length < 1 || !RegExp){return;}
var str = arguments[0];var re = /([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X)(.*)/;var a = b = [], numSubstitutions = 0, numMatches = 0;while (a = re.exec(str)){var leftpart = a[1], pPad = a[2], pJustify = a[3], pMinLength = a[4];var pPrecision = a[5], pType = a[6], rightPart = a[7];numMatches++;if (pType == '%'){subst = '%';}
else{numSubstitutions++;if (numSubstitutions >= arguments.length){alert('Error! Not enough function arguments (' + (arguments.length - 1)
+ ', excluding the string)\n'
+ 'for the number of substitution parameters in string ('
+ numSubstitutions + ' so far).');}
var param = arguments[numSubstitutions];var pad = '';if (pPad && pPad.substr(0,1) == "'") pad = leftpart.substr(1,1);else if (pPad) pad = pPad;var justifyRight = true;if (pJustify && pJustify === "-") justifyRight = false;var minLength = -1;if (pMinLength) minLength = parseInt(pMinLength);var precision = -1;if (pPrecision && pType == 'f')
precision = parseInt(pPrecision.substring(1));var subst = param;switch (pType){case 'b':
subst = parseInt(param).toString(2);break;case 'c':
subst = String.fromCharCode(parseInt(param));break;case 'd':
subst = parseInt(param) ? parseInt(param) : 0;break;case 'u':
subst = Math.abs(param);break;case 'f':
subst = (precision > -1)
? this.numberFormat( param, precision, '.', '' )
: parseFloat( param );break;case 'o':
subst = parseInt(param).toString(8);break;case 's':
subst = param;break;case 'x':
subst = ('' + parseInt(param).toString(16)).toLowerCase();break;case 'X':
subst = ('' + parseInt(param).toString(16)).toUpperCase();break;}
var padLeft = minLength - subst.toString().length;if (padLeft > 0){var arrTmp = new Array( padLeft + 1 );var padding = arrTmp.join( pad ? pad : " " );}
else{var padding = "";}}
str = leftpart + padding + subst + rightPart;}
return str;}
JinnBaseClass_proto.getWindow = function(){return this.___jinnWindow;}
JinnBaseClass_proto.setWindow = function( window ){this.___jinnWindow = window;}
JinnBaseClass_proto.isWindowClosed = function(){return this.getWindow().closed;}
JinnBaseClass_proto.isWindowOpen = function(){return !this.isWindowClosed();}
JinnBaseClass_proto.getDocument = function(){return this.___jinnWindow.document;}
JinnBaseClass_proto.getDocumentHead = function(){var doc = this.getDocument();var temp = doc.getElementsByTagName( 'head' );if( temp ){return temp.item( 0 );}
return null;}
JinnBaseClass_proto.getDocumentBody = function(){var doc = this.getDocument();var temp = doc.getElementsByTagName( 'body' );if( temp ){return temp.item( 0 );}
return null;}
JinnBaseClass_proto.getElement = function( id ){var compat = this.getService( 'browserCompatibility' );return compat.getElement( this, id );}
JinnBaseClass_proto.getElementStyle = function( element ){var compat = this.getService( 'browserCompatibility' );return compat.getElementStyle( this, element );}
JinnBaseClass_proto.getElementsByClassName = function( className, rootElement ){var compat = this.getService( 'browserCompatibility' );return compat.getElementsByClassName( this, className, rootElement );}
JinnBaseClass_proto.getScreenWidth = function(){var win = this.getWindow();if( win && win.screen && win.screen.width ){return win.screen.width;}
return 800;}
JinnBaseClass_proto.getScreenHeight = function(){var win = this.getWindow();if( win && win.screen && win.screen.width ){return win.screen.height;}
return 600;}
JinnBaseClass_proto.getWindowWidth = function(){var compat = this.getService( 'browserCompatibility' );return compat.getWindowWidth( this );}
JinnBaseClass_proto.getWindowHeight = function(){var compat = this.getService( 'browserCompatibility' );return compat.getWindowHeight( this );}
JinnBaseClass_proto.getWindowScrollX = function(){var compat = this.getService( 'browserCompatibility' );return compat.getWindowScrollX( this );}
JinnBaseClass_proto.getWindowScrollY = function(){var compat = this.getService( 'browserCompatibility' );return compat.getWindowScrollY( this );}
JinnBaseClass_proto.getWindowViewMinX = function(){return this.getWindowScrollX();}
JinnBaseClass_proto.getWindowViewMaxX = function(){return this.getWindowWidth() + this.getWindowScrollX() - 1;}
JinnBaseClass_proto.getWindowViewMinY = function(){return this.getWindowScrollY();}
JinnBaseClass_proto.getWindowViewMaxY = function(){return this.getWindowHeight() + this.getWindowScrollY() - 1;}
JinnBaseClass_proto.getPrintData = function( data, colour, htmlMode ){colour   = this.defaultValue( colour, null );htmlMode = this.defaultValue( htmlMode, true );var history = new Object();history.lookup = new Object();var content =
this.getPrintDataPrimitive(
data, 0, history, colour, htmlMode );if( htmlMode ){content = content.replace( /&/g, '&amp;' );content = content.replace( /</g, '&lt;' );content = content.replace( />/g, '&gt;' );content =
"<pre>\n"
+ content + "\n"
+ "</pre>\n";}
return content;}
JinnBaseClass_proto.getPrintDataPrimitive =
function( data, depth, history, colour, htmlMode ){var content = '';var tab     = '    ';var indent  = '';var temp    = '';var i       = 0;for( i = 0; i < depth; i++ ){indent += tab;}
switch( typeof( data ) ){case 'object':{if( data instanceof Array ){content += "Array\n" + indent + "(\n";for( var key = 0; key < data.length; key++ ){try{temp = data[key];}
catch( e ){temp = null;}
content +=
indent + tab + '[' + key + '] => ';content +=
this.getPrintDataPrimitive(temp, depth + 1, history, colour, htmlMode
);}
content += indent + ")\n";}
else
if( data instanceof Object ){if( history.lookup[this.getUid( data )] ){content += "*** RECURSION ***\n";}
else{history.lookup[this.getUid( data )] = true;var className = this.getClassName( data );content +=
"{Object " + className + "}\n" + indent + "(\n";for( var key in data ){if( key == 'ijinn_objectUid' ){continue;}
try{temp = data[key];}
catch( e ){temp = '*** UNABLE TO ACCESS ***';}
if( typeof( temp ) != 'function' ){content +=
indent + tab + '[' + key + '] => ';if( depth > 5 ){temp = '{Object ' + className + ' ...}';}
content +=
this.getPrintDataPrimitive(temp, depth + 1, history, colour, htmlMode
);}}
content += indent + ")\n";}}
else{content += data + "\n";}
break;}
case 'string':{content += data + "\n";break;}
case 'number':{content += data + "\n";break;}
case 'boolean':{content += data + "\n";break;}
case 'function':{content += "*** FUNCTION ***\n";break;}
default:{content += data + "\n";}}
return content;}
JinnBaseClass_proto.printData = function( data, colour ){this.debug( this.getPrintData( data, colour ) );}
JinnBaseClass_proto.debug = function( content ){ijinn_debug( content );}
JinnBaseClass_proto.getTime = function(){var now = new Date();return now.getTime() / 1000
}
JinnBaseClass_proto.normalizePath = function( path ){return ijinn_normalizePath( path );}
JinnBaseClass_proto.localizePath = function( path, root, doUnmarked ){return ijinn_localizePath( path, root, doUnmarked );}
JinnBaseClass_proto.localizeImage = function( imagePath ){imagePath = this.trim( imagePath );if( imagePath.charAt( 0 ) == '/'
&&
imagePath.charAt( 1 ) == '/' ){imagePath = '/' + this.getImageBase() + '/' + imagePath;}
return this.normalizePath( imagePath );}
JinnBaseClass_proto.localizePage = function( pagePath ){pagePath = this.trim( pagePath );if( pagePath.charAt( 0 ) == '/'
&&
pagePath.charAt( 1 ) == '/' ){pagePath = '/' + this.getPageBase() + '/' + pagePath;}
var pos = pagePath.indexOf( '://' );if( pos >= 0 ){pagePath =
pagePath.substr( 0, pos + 3 )
+ this.normalizePath( pagePath.substr( pos + 3 ) );}
else{pagePath = this.normalizePath( pagePath );}
return pagePath;}
JinnBaseClass_proto.rand = function( min, max ){if( !this.isset( min ) ){min = 0;}
if( !this.isset( max ) ){max = 1000000000;}
if( min > max ){var temp = min;min = max;max = temp;}
return min + Math.floor( Math.random() * (max - min + 1) )
}
JinnBaseClass_proto.getUniqueId = function( length ){var charRange =
'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';length = this.defaultValue( length, 32 );newId = '' + this.getTime();newId = newId.replace( /\./, '' );var tLength = length + 5;while( newId.length < tLength ){newId += charRange.charAt( this.rand( 0, charRange.length - 1 ) );}
newId = newId.substr( newId.length - length, length );return newId;}
var gJinnGlobalNextObjectUid = 1000001;JinnBaseClass_proto.getUid = function( anObject ){anObject = this.defaultValue( anObject, this );if( typeof( anObject ) == 'object' ){if( !this.isset( anObject.ijinn_objectUid ) ){anObject.ijinn_objectUid = '@@@Obj:' + gJinnGlobalNextObjectUid;gJinnGlobalNextObjectUid++;}
return anObject.ijinn_objectUid;}
return anObject;}
JinnBaseClass_proto.destroy = function( obj ){var tObj = this.defaultValue( obj, this );if( !this.isDestroyed( tObj ) ){if( tObj.destructor ){tObj.destructor();}
tObj.ijinn_isDestroyed = true;}
return null;}
JinnBaseClass_proto.isDestroyed = function( obj ){var tObj = this.defaultValue( obj, this );return this.defaultValue( tObj.ijinn_isDestroyed, false );}
JinnBaseClass_proto.getArgsPunter = function( args, offset, preceded ){return ijinn_getArgsPunter( args, offset, preceded );}
JinnBaseClass_proto.getClassName = function( anObject ){var compat = this.getService( 'browserCompatibility' );return compat.getClassName( this, anObject );}
JinnBaseClass_proto.augmentEvent = function( anEvent ){var compat = this.getService( 'browserCompatibility' );return compat.augmentEvent( this, anEvent );}
JinnBaseClass_proto.getDataType = function( data ){var type = typeof( data );if( type == 'undefined' ){return 'undefined';}
if( data === null ){return 'null';}
if( type == 'object' ){if( data instanceof Array ){return 'array';}}
return type;}
JinnBaseClass_proto.getSize = function( data ){var type = this.getDataType( data );if( type == 'array' ){if( this.isset( data.length ) ){return data.length;}
return 0;}
if( type == 'object' ){var size = 0;for( var key in data ){size++;}
return size;}
if( type == 'string' ){return data.length;}
if( type == 'undefined' ){return 0;}
return 1;}
JinnBaseClass_proto.objectHandler = function( obj, func, extra ){return ijinn_objectHandler( obj, func, extra );}
JinnBaseClass_proto.signalHandler = function( event ){return false;}
JinnBaseClass_proto.jinnfo = function( obj ){var ijinn = null;if( obj.ijinn ){ijinn = obj.ijinn;}
else{ijinn = new Object();obj.ijinn = ijinn;}
return ijinn;}
JinnBaseClass_proto.maxValue = function(){var max  = null;var temp = null;var i = arguments.length;while( --i >= 0 ){temp = this.defaultForNaN( arguments[i] );if( max === null ){max = temp;}
else
if( temp > max ){max = temp;}}
return max;}
JinnBaseClass_proto.minValue = function(){var min  = null;var temp = null;var i = arguments.length;while( --i >= 0 ){temp = this.defaultForNaN( arguments[i] );if( min === null ){min = temp;}
else
if( temp < min ){min = temp;}}
return min;}
JinnBaseClass_proto.rgbToHex = function( r, g, b ){var hex = new Array('0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
);var hexColour =
'#'
+ hex[this.asInt( this.minValue( r / 16, 16 ) )]
+ hex[this.asInt( r % 16 )]
+ hex[this.asInt( this.minValue( g / 16, 16 ) )]
+ hex[this.asInt( g % 16 )]
+ hex[this.asInt( this.minValue( b / 16, 16 ) )]
+ hex[this.asInt( b % 16 )];return hexColour;}
JinnBaseClass_proto.asInt = function( value ){return value | 0;}
JinnBaseClass_proto.asFloat = function( value ){return parseFloat( value );}
JinnBaseClass_proto.urlencode = function( value ){if( encodeURI ){return encodeURIComponent( value );}
return escape( value );}
function JinnDynamicLoader(){this.jinnit();}
JinnDynamicLoader.prototype = new JinnBaseClass();JinnDynamicLoader_proto = JinnDynamicLoader.prototype;JinnDynamicLoader_proto.constructor = JinnDynamicLoader;JinnDynamicLoader.superjinn = JinnBaseClass.prototype;JinnDynamicLoader_proto.jinnit = function(){JinnDynamicLoader.superjinn.jinnit.call( this );this.sources            = new Array();this.aliases            = new Array();this.libraries          = new Array();this.objectLookup       = new Array();this.___jinnGlobals     = gJinnGlobals;this.___jinnJdl         = this;}
JinnDynamicLoader_proto.getServiceUsingWindow =
function( window, name, p1, p2, p3, p4, p5, p6 ){var fullName = name;var paramCount = 0;fullName = name.toLowerCase();if( fullName == 'jdl' ){return this;}
if( this.aliases[fullName] ){fullName = this.aliases[fullName];}
if( !this.libraries[fullName] ){return null;}
var service = null;if( !(service = this.objectLookup[fullName]) ){service = eval( 'new ' + this.libraries[fullName] );service.___jinnJdl = this;service.___jinnWindow = window;if( service && !service.allowMultipleInstances ){this.objectLookup[fullName] = service;}
if( service.postLoadExecute ){eval('service.postLoadExecute'
+ '( '
+     this.getArgsPunter( arguments, 2 )
+ ' );'
);}}
return service;}
JinnDynamicLoader_proto.getService = function(){eval('var service = '
+ 'this.getServiceUsingWindow( '
+ 'this.___jinnWindow'
+ this.getArgsPunter( arguments, 0, true ) + ' );'
);return service;}
JinnDynamicLoader_proto.serviceExists = function( name ){var fullName = name;var paramCount = 0;fullName = name.toLowerCase();if( fullName == 'jdl' ){return true;}
if( this.aliases[fullName] ){fullName = this.aliases[fullName];}
if( this.libraries[fullName] ){return true;}
return false;}
gJinnGlobals['interJinn']['jdl'] = new JinnDynamicLoader();function JinnBrowserCompatibility(){this.jinnit();}
JinnBrowserCompatibility.prototype = new JinnBaseClass();JinnBrowserCompatibility_proto = JinnBrowserCompatibility.prototype;JinnBrowserCompatibility_proto.constructor = JinnBrowserCompatibility;JinnBrowserCompatibility.superjinn = JinnBaseClass.prototype;JinnBrowserCompatibility_proto.jinnit = function(){JinnBrowserCompatibility.superjinn.jinnit.call( this );}
JinnBrowserCompatibility_proto.postLoadExecute = function(){this.sniffBrowser();this.sniffBoxModel();}
JinnBrowserCompatibility_proto.sniffBrowser = function(){var win = this.getWindow();var doc = this.getDocument();var agent = win.navigator.userAgent.toLowerCase();this.isOpera
= (window.opera
&&
doc.getElementById)
? true
: false;this.isExplorer
= (agent.indexOf("msie") >= 0
&&
doc.all
&&
!this.isOpera)
? true
: false;this.isExplorerMacintosh
= (this.isExplorer
&&
agent.indexOf( 'mac' ) >= 0)
? true
: false;this.isExplorer4
= (this.isExplorer
&&
!doc.getElementById)
? true
: false;this.isNetscape4
= (doc.layers
&&
this.isset( doc.classes ))
? true
: false;this.isNetscape6
= (this.isset( window.getComputedStyle )
&&
this.isset( doc.createRange ))
? true
: false;this.isW3cCompliant
= (!this.isOpera
&&
!this.isExplorer
&&
!this.isNetscape6
&&
doc.getElementById)
? true
: false;}
JinnBrowserCompatibility_proto.sniffBoxModel = function(){var doc   = this.getDocument();var body  = this.getDocumentBody();if( !body ){this.w3cBoxModel = true;return;}
var div   = doc.createElement( 'div' );var style = this.getElementStyle( this, div );style.position      = 'absolute';style.overflow      = 'visible';style.visibility    = 'hidden';style.borderStyle   = 'solid';style.borderWidth   = '10px';style.width         = '5px';style.height        = '5px';body.appendChild( div );if( div.clientWidth == 5 ){this.w3cBoxModel = true;}
else{this.w3cBoxModel = false;}
body.removeChild( div );}
JinnBrowserCompatibility_proto.getWindowWidth = function( root ){var win = root.getWindow();if( win ){if( win.innerWidth ){return win.innerWidth;}
else
if( win.document.documentElement
&&
win.document.documentElement.clientWidth ){return win.document.documentElement.clientWidth;}
else
if( win.document.body ){return win.document.body.clientWidth;}}
return 1;}
JinnBrowserCompatibility_proto.getWindowHeight = function( root ){var win = root.getWindow();if( win ){if( win.innerHeight ){return win.innerHeight;}
else
if( win.document.documentElement
&&
win.document.documentElement.clientHeight ){return win.document.documentElement.clientHeight;}
else
if( win.document.body ){return win.document.body.clientHeight;}}
return 1;}
JinnBrowserCompatibility_proto.getWindowScrollX = function( root ){var win = root.getWindow();if( win ){if( this.isset( win.pageXOffset ) ){return win.pageXOffset;}
else
if( win.document.documentElement
&&
win.document.documentElement.scrollLeft ){return win.document.documentElement.scrollLeft;}
else
if( win.document.body ){return win.document.body.scrollLeft;}}
return 0;}
JinnBrowserCompatibility_proto.getWindowScrollY = function( root ){var win = root.getWindow();if( win ){if( this.isset( win.pageYOffset ) ){return win.pageYOffset;}
else
if( win.document.documentElement
&&
win.document.documentElement.scrollTop ){return win.document.documentElement.scrollTop;}
else
if( win.document.body ){return win.document.body.scrollTop;}}
return 0;}
JinnBrowserCompatibility_proto.getElement = function( root, id ){var doc = root.getDocument();if( doc.getElementById ){element = doc.getElementById( id );}
else
if( doc.all ){element = eval( 'doc.all.' + id );}
else
if( doc.layers ){element = eval( 'doc.' + id );}
else{element = eval( 'doc.' + id );}
return element;}
JinnBrowserCompatibility_proto.getElementStyle = function( root, id ){var doc = root.getDocument();var element = null;if( typeof( id ) == 'object' ){element = id;}
else{element = root.getElement( id );}
if( doc.layers ){return element;}
if( !element ){return null;}
return element.style;}
JinnBrowserCompatibility_proto.getElementsByClassName = function( root, className, rootElement ){var doc = root.getDocument();if( this.getDataType( rootElement ) == 'string' ){rootElement = this.getElement( root, rootElement );}
if( this.getDataType( rootElement ) != 'object' ){rootElement = doc.body;}
var children = rootElement.getElementsByTagName( '*' );var regex = new RegExp( '\\b' + className + '\\b' );var element = null;var elements = [];var i = 0;while( (element = children[i++]) ){if( element.className
&&
regex.test( element.className ) ){elements.push( element );}}
return elements;}
JinnBrowserCompatibility_proto.getClassName = function( root, anObject ){anObject = this.defaultValue( anObject, this );if( typeof( anObject ) != 'object' ){return '*NonObject*';}
if( anObject
&&
anObject.constructor
&&
anObject.constructor.toString ){var name = anObject.constructor.toString();var bits = name.match( /function\s*(\w+)/ );if( bits && bits.length > 1 ){return bits[1];}}
name = '' + anObject;if( name.match( /^.object / ) ){name = name.replace( /^.object |.$/g, '' );}
return name;}
JinnBrowserCompatibility_proto.deselectText = function( root, extra ){var win = root.getWindow();if( this.isOpera ){if( win.ijinn_deselectTextFudgeSpan == null ){var body = root.getDocumentBody();if( body ){var span = root.getDocument().createElement( 'span' );var spanStyle = this.getElementStyle( root, span );spanStyle.position      = 'absolute';spanStyle.overflow      = 'hidden';spanStyle.visibility    = 'hidden';spanStyle.background    = '#000000';spanStyle.zIndex        = 2000000000;spanStyle.margin        = '0px';spanStyle.padding       = '5px';spanStyle.width         = '1px';spanStyle.height        = '1px';var inputId = 'id' + root.getUniqueId();var formId  = 'id' + root.getUniqueId();span.innerHTML =
'<form'
+ ' id="' + formId + '">'
+ '<input'
+ ' id="' + inputId + '"'
+ ' type="text"'
+ ' value="InterJinn" />'
+ '</form>';body.appendChild( span );var input = root.getElement( inputId );var inputStyle = this.getElementStyle( root, input );inputStyle.margin       = '0px';inputStyle.padding      = '0px';inputStyle.width        = '5px';inputStyle.height       = '5px';win.ijinn_deselectTextFudgeSpan  = span;win.ijinn_deselectTextFudgeInput = input;}}}
if( this.isOpera ){if( win.ijinn_deselectTextFudgeSpan != null ){if( this.isset( extra )
&&
this.isset( extra.operaFudgeTarget ) ){var fudge =
this.getService(
'element', win.ijinn_deselectTextFudgeSpan );var target =
this.getService(
'element', extra.operaFudgeTarget );if( fudge ){if( extra.event ){fudge.moveTo(extra.event.ijinn_mouseDocumentX,
extra.event.ijinn_mouseDocumentY
);}
else{fudge.moveTo(target.getX(),
target.getY()
);}}
win.ijinn_deselectTextFudgeInput.focus();win.ijinn_deselectTextFudgeInput.blur();}
else{win.ijinn_deselectTextFudgeInput.focus();win.ijinn_deselectTextFudgeInput.blur();}}}
else{var doc = root.getDocument();if( doc
&&
doc.selection
&&
doc.selection.empty
&&
typeof( doc.selection.empty ) == 'function' ){doc.selection.empty();}}}
JinnBrowserCompatibility_proto.augmentEvent = function( root, event ){var mouseDocumentX = 0;var mouseDocymentY = 0;body = root.getDocumentBody();if( event.pageX || event.pageY ){mouseDocumentX = event.pageX;mouseDocumentY = event.pageY;}
else
if( event.clientX || event.clientY ){mouseDocumentX = event.clientX + body.scrollLeft;mouseDocumentY = event.clientY + body.scrollTop;}
event.ijinn_mouseDocumentX = mouseDocumentX;event.ijinn_mouseDocumentY = mouseDocumentY;event.ijinn_mouseScreenX = event.screenX;event.ijinn_mouseScreenY = event.screenY;}
JinnBrowserCompatibility_proto.augmentElement = function( root, e ){var s = this.getElementStyle( root, e );var ijinn = this.jinnfo( e );ijinn.borderWidthTop    = this.defaultForNaN( s.borderTopWidth );ijinn.borderWidthLeft   = this.defaultForNaN( s.borderLeftWidth );ijinn.borderWidthBottom = this.defaultForNaN( s.borderBottomWidth );ijinn.borderWidthRight  = this.defaultForNaN( s.borderRightWidth );ijinn.width             = this.defaultForNaN( e.clientWidth );ijinn.height            = this.defaultForNaN( e.clientHeight );ijinn.innerWidth        = ijinn.width;ijinn.innerHeight       = ijinn.height;ijinn.width            += ijinn.borderWidthLeft + ijinn.borderWidthRight;ijinn.height           += ijinn.borderWidthTop + ijinn.borderWidthBottom;ijinn.realTop  = 0;ijinn.realLeft = 0;ijinn.relativeTop  = 0;ijinn.relativeLeft = 0;var relativeFound = false;var temp = e;var tempStyle = null;while( temp ){if( temp.tagName == 'BODY' ){break;}
ijinn.realTop  += temp.offsetTop;ijinn.realLeft += temp.offsetLeft;if( !relativeFound ){ijinn.relativeTop  += temp.offsetTop;ijinn.relativeLeft += temp.offsetLeft;tempStyle = this.getElementStyle( root, temp );if( tempStyle.position == 'relative' ){relativeFound = true;}}
temp = temp.offsetParent;}
ijinn.realBottom        = ijinn.realTop  + ijinn.height - 1;ijinn.realRight         = ijinn.realLeft + ijinn.width  - 1;ijinn.realX             = ijinn.realLeft;ijinn.realY             = ijinn.realTop;ijinn.relativeBottom    = ijinn.relativeTop  + ijinn.height - 1;ijinn.relativeRight     = ijinn.relativeLeft + ijinn.width  - 1;ijinn.relativeX         = ijinn.relativeLeft;ijinn.relativeY         = ijinn.relativeTop;ijinn.viewTop           = ijinn.realTop  - this.getWindowScrollY( root );ijinn.viewLeft          = ijinn.realLeft - this.getWindowScrollX( root );ijinn.viewBottom        = ijinn.viewTop  + ijinn.height - 1;ijinn.viewRight         = ijinn.viewLeft + ijinn.width  - 1;ijinn.viewX             = ijinn.viewLeft;ijinn.viewY             = ijinn.viewTop;ijinn.realInnerTop      = ijinn.realTop  + ijinn.borderWidthTop;ijinn.realInnerLeft     = ijinn.realLeft + ijinn.borderWidthLeft;ijinn.realInnerBottom   = ijinn.realInnerTop  + ijinn.innerHeight - 1;ijinn.realInnerRight    = ijinn.realInnerLeft + ijinn.innerWidth  - 1;ijinn.realInnerX        = ijinn.realInnerLeft;ijinn.realInnerY        = ijinn.realInnerTop;ijinn.viewInnerTop      = ijinn.viewTop  + ijinn.borderWidthTop;ijinn.viewInnerLeft     = ijinn.viewLeft + ijinn.borderWidthLeft;ijinn.viewInnerBottom   = ijinn.viewInnerTop  + ijinn.innerHeight - 1;ijinn.viewInnerRight    = ijinn.viewInnerLeft + ijinn.innerWidth  - 1;ijinn.viewInnerX        = ijinn.viewInnerLeft;ijinn.viewInnerY        = ijinn.viewInnerTop;e.ijinn = ijinn;}
JinnBrowserCompatibility_proto.setElementWidth =
function( root, e, width ){this.augmentElement( root, e );var s = this.getElementStyle( root, e );if( this.w3cBoxModel ){width -= (e.ijinn.borderWidthLeft + e.ijinn.borderWidthRight);if( width < 0 ){width = 0;}}
else{if( width < (e.ijinn.borderWidthLeft + e.ijinn.borderWidthRight) ){width = (e.ijinn.borderWidthLeft + e.ijinn.borderWidthRight);}}
s.width = width + 'px';}
JinnBrowserCompatibility_proto.setElementHeight =
function( root, e, height ){this.augmentElement( root, e );var s = this.getElementStyle( root, e );if( this.w3cBoxModel ){height -= (e.ijinn.borderWidthTop + e.ijinn.borderWidthBottom);if( height < 0 ){height = 0;}}
else{if( height < (e.ijinn.borderWidthTop + e.ijinn.borderWidthBottom) ){height = (e.ijinn.borderWidthTop + e.ijinn.borderWidthBottom);}}
s.height = height + 'px';}
JinnBrowserCompatibility_proto.setElementBorderWidths =
function( root, e, top, right, bottom, left ){this.augmentElement( root, e );var s = this.getElementStyle( root, e );var oldWidth  = e.ijinn.width;var oldHeight = e.ijinn.height;if( s.borderStyle == '' ){s.borderStyle = 'solid';}
if( top !== null ){s.borderTopWidth = this.defaultForNaN( top )    + 'px';}
if( right !== null ){s.borderRightWidth = this.defaultForNaN( right )  + 'px';}
if( bottom !== null ){s.borderBottomWidth = this.defaultForNaN( bottom ) + 'px';}
if( left !== null ){s.borderLeftWidth = this.defaultForNaN( left )   + 'px';}
this.setElementWidth( root, e, oldWidth );this.setElementHeight( root, e, oldHeight );}
JinnBrowserCompatibility_proto.setElementOpacity =
function( root, element, opacity ){var style = this.getElementStyle( root, element );if( style ){if( this.isset( style.opacity ) ){style.opacity = opacity;this.jinnfo( element ).opacity = opacity;}
else
if( this.isExplorer ){style.filter =
'Alpha(opacity=' + parseInt( opacity * 100 ) + ')';this.jinnfo( element ).opacity = opacity;}}}
JinnBrowserCompatibility_proto.getElementOpacity = function( root, element ){var ijinn = null;if( (ijinn = this.jinnfo( element )).opacity ){return ijinn.opacity;}
return 1.0;}
function JinnOutputDebugger(){this.jinnit();}
JinnOutputDebugger.prototype = new JinnBaseClass();JinnOutputDebugger_proto = JinnOutputDebugger.prototype;JinnOutputDebugger_proto.constructor = JinnOutputDebugger;JinnOutputDebugger.superjinn = JinnBaseClass.prototype;JinnOutputDebugger_proto.jinnit = function(){JinnOutputDebugger.superjinn.jinnit.call( this );this.windowExists = false;this.content      = new Array();this.opening      = false;this.windowUid    = 'JinnOutputDebugger_' + this.getUniqueId();this.htmlTemplate =
'<html>'
+ '<head>'
+ '<scr' + 'ipt type="text/javascript">' + "\n"
+ '<' + '!--//--' + '><' + '![' + 'CDATA[//><' + '!--' + "\n"
+ 'window ? (window.interJinnSkipUserJavaScript = true) : false;' + "\n"
+ '//--' + '><' + '!]' + ']>' + "\n"
+ '</' + 'script>'
+ '<style type="text/css">'
+ '<!--'
+ '' // ----------------------------------------------------------------
+ 'body, h1, h2, h3, p, font, table, td, th, ul, ol, textarea, input, form, blockquote, select'
+ '{'
+ '    font-family: arial, helvetica, sans-serif;'
+ '    font-size: 12px;'
+ '}'
+ ''
+ 'body'
+ '{'
+ '    background: #fffff4;'
+ '    margin-bottom: 2px;'
+ '}'
+ ''
+ 'h1.details'
+ '{'
+ '    color: #000000;'
+ '    font-size: 14px;'
+ '    margin-left: 0px;'
+ '    margin-bottom: 2px;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'table.layout'
+ '{'
+ '    width: 100%;'
+ '    padding: 5px;'
+ '    background: transparent;'
+ '}'
+ ''
+ 'table.details'
+ '{'
+ '    width: 100%;'
+ '    padding: 0px;'
+ '    background: transparent;'
+ '}'
+ ''
+ 'table.border'
+ '{'
+ '    width: 100%;'
+ '    padding: 0px;'
+ '    background: #554400;'
+ '}'
+ ''
+ 'table.data'
+ '{'
+ '    width: 100%;'
+ '    padding: 0px;'
+ '    background: #dddddd;'
+ '}'
+ '' // ----------------------------------------------------------------
+ '.content'
+ '{'
+ '    background: #ffffff;'
+ '    color: #000000;'
+ '    padding: 8px;'
+ '    font-size: 12px;'
+ '    text-align: left;'
+ '    white-space: nowrap;'
+ '}'
+ ''
+ '.denote'
+ '{'
+ '    color: #ffffff;'
+ '    font-size: 10px;'
+ '    font-weight: bold;'
+ '    padding-left: 10px;'
+ '}'
+ ''
+ '.small'
+ '{'
+ '    font-size: 8px;'
+ '}'
+ ''
+ '.big'
+ '{'
+ '    font-size: 12px;'
+ '}'
+ ''
+ '.success'
+ '{'
+ '    color: #009900;'
+ '}'
+ ''
+ '.error'
+ '{'
+ '    color: #990000;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'a:active'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:focus'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:hover'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:link'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:visited'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'span.action'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'span.action:active'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'span.action:focus'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'span.action:hover'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: underline;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'span.action:link'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'span.action:visited'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ '' // ----------------------------------------------------------------
+ '-->'
+ '</style>'
+ '</head>'
+ '<body>'
+ '<div id="interJinnSkipUserJavaScript"></div>'
+ '<div align="left">'
+ '<table class="layout" cellspacing="0">'
+ '<tr>'
+ '<td align="left">'
+ '<table class="details" cellspacing="0">'
+ '<tr>'
+ '<td align="left">'
+ '<h1 class="details">'
+ 'Output Debugger'
+ '</h1>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '<table class="controls" cellspacing="0">'
+ '<tr>'
+ '<td align="left">'
+ '<span id="topControls">'
+ '<table border="0" cellspacing="0" cellpadding="0">'
+ '<tr>'
+ '<td>'
+ '<span class="action" id="topMenuScrollToBottom">'
+ 'Bottom'
+ '</span>'
+ '&nbsp;&nbsp;|&nbsp;&nbsp;'
+ '<span class="action" id="topMenuClear">'
+ 'Clear'
+ '</span>'
+ '&nbsp;&nbsp;|&nbsp;&nbsp;'
+ '<span class="action" id="topMenuWindowClose">'
+ 'Close'
+ '</span>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</span>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '<table class="border" cellspacing="0">'
+ '<tr>'
+ '<td>'
+ '<table id="details" class="data" cellspacing="0">'
+ '<tr>'
+ '<td>'
+ '<pre class="content">'
+ '<span id="content">'
+ '</span>'
+ '</pre>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '<table class="details" cellspacing="0">'
+ '<tr>'
+ '<td align="left">'
+ '<span id="bottomControls">'
+ '<table border="0" cellspacing="0" cellpadding="0">'
+ '<tr>'
+ '<td>'
+ '<span class="action" id="bottomMenuScrollToTop">'
+ 'Top'
+ '</span>'
+ '&nbsp;&nbsp;|&nbsp;&nbsp;'
+ '<span class="action" id="bottomMenuClear">'
+ 'Clear'
+ '</span>'
+ '&nbsp;&nbsp;|&nbsp;&nbsp;'
+ '<span class="action" id="bottomMenuWindowClose">'
+ 'Close'
+ '</span>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</span>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</div>'
+ '</body>'
+ '</html>';}
JinnOutputDebugger_proto.assignHandlers = function(){var element = null;if( (element = this.getElement( 'topMenuScrollToBottom' )) ){element.onclick =
this.objectHandler( this, this.scrollToBottom );}
if( (element = this.getElement( 'topMenuClear' )) ){element.onclick =
this.objectHandler( this, this.clear );}
if( (element = this.getElement( 'topMenuWindowClose' )) ){element.onclick =
this.objectHandler( this, this.close );}
if( (element = this.getElement( 'bottomMenuScrollToTop' )) ){element.onclick =
this.objectHandler( this, this.scrollToTop );}
if( (element = this.getElement( 'bottomMenuClear' )) ){element.onclick =
this.objectHandler( this, this.clear );}
if( (element = this.getElement( 'bottomMenuWindowClose' )) ){element.onclick =
this.objectHandler( this, this.close );}}
JinnOutputDebugger_proto.getWindowSpecs = function(){var specs = new Array();specs['width']          = 0.6 * this.getScreenWidth();specs['height']         = 0.6 * this.getScreenHeight();specs['directories']    = 'no';specs['location']       = 'no';specs['menubar']        = 'no';specs['status']         = 'no';specs['titlebar']       = 'yes';specs['toolbar']        = 'no';specs['scrollbars']     = 'yes';return specs;}
JinnOutputDebugger_proto.clear = function(){pad = this.getElement( 'content' );pad.innerHTML = '';this.content = new Array();this.debug( '' );this.scrollToTop();return false;}
JinnOutputDebugger_proto.close = function(){this.getWindow().close();return false;}
JinnOutputDebugger_proto.write = function( content ){var opened = false;var rotate = false;var window = this.getWindow();if( !this.opening
&&
(!this.windowExists
||
window.closed) ){this.opening = true;this.windowExists = true;opened = true;var specs = this.getWindowSpecs();var newSpecs = new Array();for( var key in specs ){newSpecs[newSpecs.length] = key + '=' + specs[key];}
window =
window.open(
'', this.windowUid, newSpecs.join( ',' ) );if( window ){window.document.write( this.htmlTemplate );window.document.close();window.jinnOutputDebugger = this;this.setWindow( window );this.assignHandlers();}
this.opening = false;}
buffer = this.content;buffer.push( content );while( buffer.length > 500 ){buffer.shift();rotate = true;}
window = this.getWindow();if( window ){try{pad = this.getElement( 'content' );if( opened ){pad.innerHTML =
'<span>'
+ buffer.join( '</span><span>' )
+ '</span>';}
else{var tEntry = window.document.createElement( 'span' );tEntry.innerHTML = content;pad.appendChild( tEntry );if( rotate ){pad.removeChild( pad.childNodes[0] );}}
if( !opened ){this.scrollToBottom();}}
catch( e ){}}}
JinnOutputDebugger_proto.debug = function( content ){this.write( content + '<br />' );}
JinnOutputDebugger_proto.scrollToTop = function(){this.getWindow().scrollBy( 0, -1000000000 );return false;}
JinnOutputDebugger_proto.scrollToBottom = function(){this.getWindow().scrollBy( 0, 1000000000 );return false;}
function ijinn_debug( content ){var jdl = ijinn_getJdl();var dbugger = jdl.getService( 'outputDebugger' );dbugger.debug( content );}
function JinnListenerManager(){this.jinnit();}
JinnListenerManager.prototype = new JinnBaseClass();JinnListenerManager_proto = JinnListenerManager.prototype;JinnListenerManager_proto.constructor = JinnListenerManager;JinnListenerManager.superjinn = JinnBaseClass.prototype;JinnListenerManager_proto.jinnit = function(){JinnListenerManager.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.listeners = new Array();}
JinnListenerManager_proto.add = function( type, obj, handler ){if( !handler ){if( obj && obj.signalHandler ){handler = obj.signalHandler;}
else{return;}}
type = type.toLowerCase();if( !this.listeners[type] ){this.listeners[type] = new Array();}
var listener = new Object();listener['object'] = obj;listener['handler'] = handler;this.listeners[type][this.listeners[type].length] = listener;}
JinnListenerManager_proto.remove = function( type, obj, handler ){type = type.toLowerCase();if( this.listeners[type] ){var tListeners = new Array();for( var index in this.listeners[type] ){var tListener = this.listeners[type][index];if( obj === tListener['object']
&&
handler === tListener['handler'] ){continue;}
if( tListener['object'] !== null
&&
this.isDestroyed( tListener['object'] ) ){continue;}
tListeners[index] = tListener;}
this.listeners[type] = tListeners;}}
JinnListenerManager_proto.signal = function( type, signaler ){type = type.toLowerCase();if( this.listeners[type] ){var tListeners = this.listeners[type];for( var index in tListeners ){tObject  = tListeners[index]['object'];tHandler = tListeners[index]['handler'];if( tObject !== null
&&
this.isDestroyed( tObject ) ){continue;}
var event = new Object();event.ijinn = new Object();event.ijinn.signal = new Object();event.ijinn.signal.type     = type;event.ijinn.signal.signaler = signaler;event.ijinn.signal.listener = tObject;event.ijinn.signal.handler  = tHandler;if( tObject !== null ){eval('tHandler.call( '
+ 'tObject, event'
+ this.getArgsPunter( arguments, 2, true ) + ' );'
);}
else{eval('tHandler( '
+ 'event'
+ this.getArgsPunter( arguments, 2, true ) + ' );'
);}}}}
JinnListenerManager_proto.signalWithEvent = function( type, signaler, event ){type = type.toLowerCase();if( this.listeners[type] ){var tListeners = this.listeners[type];if( !event ){event = new Object();}
for( var index in tListeners ){tObject  = tListeners[index]['object'];tHandler = tListeners[index]['handler'];if( tObject !== null
&&
this.isDestroyed( tObject ) ){continue;}
event.ijinn = new Object();event.ijinn.signal = new Object();event.ijinn.signal.type     = type;event.ijinn.signal.signaler = signaler;event.ijinn.signal.listener = tObject;event.ijinn.signal.handler  = tHandler;if( tObject !== null ){eval('tHandler.call( '
+ 'tObject, event'
+ this.getArgsPunter( arguments, 3, true ) + ' );'
);}
else{eval('tHandler( '
+ 'event'
+ this.getArgsPunter( arguments, 3, true ) + ' );'
);}}}}
JinnListenerManager_proto.destructor = function(){this.listeners = new Array();}
function JinnWindow(){this.jinnit();}
JinnWindow.prototype = new JinnBaseClass();JinnWindow_proto = JinnWindow.prototype;JinnWindow_proto.constructor = JinnWindow;JinnWindow.superjinn = JinnBaseClass.prototype;JinnWindow_proto.jinnit = function(){JinnWindow.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.windowExists = false;}
JinnWindow_proto.postLoadExecute = function( winSpecs ){specs = this.defaultValue( winSpecs, new Array() );this.url         = this.defaultValue( specs['url'],     '' );this.name        = this.defaultValue( specs['name'],    '_blank' );this.replace     = this.defaultValue( specs['replace'], false );this.left        = this.defaultValue( specs['left'],          null );this.top         = this.defaultValue( specs['top'],           null );this.width       = this.defaultValue( specs['width'],         300 );this.height      = this.defaultValue( specs['height'],        200 );this.channelMode = this.defaultValue( specs['channelMode'],   0 );this.directories = this.defaultValue( specs['directories'],   1 );this.fullScreen  = this.defaultValue( specs['fullScreen'],    0 );this.location    = this.defaultValue( specs['location'],      1 );this.menubar     = this.defaultValue( specs['menubar'],       1 );this.resizable   = this.defaultValue( specs['resizable'],     1 );this.scrollbars  = this.defaultValue( specs['scrollbars'],    1 );this.status      = this.defaultValue( specs['status'],        1 );this.titlebar    = this.defaultValue( specs['titlebar'],      1 );this.toolbar     = this.defaultValue( specs['toolbar'],       1 );}
JinnWindow_proto.open = function( content ){var contentString = '' + this.defaultValue( content, '' );var window = this.getWindow();this.url = this.localizePage( this.url );var specs = new Array();specs[specs.length] = 'left='        + this.left;specs[specs.length] = 'top='         + this.top;specs[specs.length] = 'width='       + this.width;specs[specs.length] = 'height='      + this.height;specs[specs.length] = 'channelMode=' + this.channelMode;specs[specs.length] = 'directories=' + this.directories;specs[specs.length] = 'fullScreen='  + this.fullScreen;specs[specs.length] = 'location='    + this.location;specs[specs.length] = 'menubar='     + this.menubar;specs[specs.length] = 'resizable='   + this.resizable;specs[specs.length] = 'scrollbars='  + this.scrollbars;specs[specs.length] = 'status='      + this.status;specs[specs.length] = 'titlebar='    + this.titlebar;specs[specs.length] = 'toolbar='     + this.toolbar;var specsString = specs.join( ',' );if( !this.windowExists
||
window.closed ){window =
window.open(
this.url, this.name, specsString, this.replace );if( window ){this.windowExists = true;if( contentString != '' ){window.document.write( contentString );}
window.document.close();window.jinnWindow = this;this.setWindow( window );var myself = this;}
this.setWindow = this.unableToReAssignWindow;}}
JinnWindow_proto.unableToReAssignWindow = function( window ){this.debug( 'Refusing to re-assign window to JinnWindow object.' );}
JinnWindow_proto.isClosed = function( id, content ){if( this.windowExists == null
||
this.getWindow().closed ){return true;}
return false;}
JinnWindow_proto.isOpen = function( id, content ){return !this.isClosed();}
JinnWindow_proto.getSelf = function(){if( this.isOpen() ){return this.getWindow();}
return null;}
JinnWindow_proto.getParent = function(){if( this.isOpen() ){return this.getWindow().parent;}
return null;}
JinnWindow_proto.getTop = function(){if( this.isOpen() ){return this.getWindow().top;}
return null;}
JinnWindow_proto.getOpener = function(){if( this.isOpen() ){return this.getWindow().opener;}
return null;}
JinnWindow_proto.setOpener = function( aWindow ){if( this.isOpen() ){this.getWindow().opener = aWindow;}}
JinnWindow_proto.getFrames = function(){if( this.isOpen() ){return this.getWindow().frames;}
return new Array();}
JinnWindow_proto.getStatus = function(){if( this.isOpen() ){return this.getWindow().status;}
return null;}
JinnWindow_proto.setStatus = function( text ){if( this.isOpen() ){this.getWindow().status = text;}}
JinnWindow_proto.getName = function(){if( this.isOpen() ){return this.getWindow().name;}
return null;}
JinnWindow_proto.setName = function( text ){if( this.isOpen() ){this.getWindow().name = text;}}
JinnWindow_proto.alert = function( message ){if( this.isOpen() ){return this.getWindow().alert( message );}
return null;}
JinnWindow_proto.confirm = function( message ){if( this.isOpen() ){return this.getWindow().confirm( message );}
return null;}
JinnWindow_proto.prompt = function( message, defaultInput ){if( this.isOpen() ){return this.getWindow().prompt( message, defaultInput );}
return null;}
JinnWindow_proto.blur = function(){if( this.isOpen() ){this.getWindow().blur();}}
JinnWindow_proto.clearInterval = function( id ){if( this.isOpen() ){this.getWindow().clearInterval( id );}}
JinnWindow_proto.clearTimeout = function( id ){if( this.isOpen() ){this.getWindow().clearTimeout( id );}}
JinnWindow_proto.close = function(){if( this.isOpen() ){this.getWindow().close();}}
JinnWindow_proto.focus = function(){if( this.isOpen() ){this.getWindow().focus();}}
JinnWindow_proto.moveBy = function( x, y ){if( this.isOpen() ){this.getWindow().moveBy( x, y );}}
JinnWindow_proto.moveTo = function( x, y ){if( this.isOpen() ){this.getWindow().moveTo( x, y );}}
JinnWindow_proto.print = function(){if( this.isOpen() ){this.getWindow().print();}}
JinnWindow_proto.scrollBy = function( x, y ){if( this.isOpen() ){this.getWindow().scrollBy( x, y );}}
JinnWindow_proto.scrollTo = function( x, y ){if( this.isOpen() ){try{this.getWindow().scrollTo( x, y );}
catch( e ){}}}
JinnWindow_proto.setInterval = function( code, msecs, lang ){if( this.isOpen() ){return this.getWindow().setInterval( code, msecs, lang );}
return null;}
JinnWindow_proto.setTimeout = function( code, msecs, lang ){if( this.isOpen() ){return this.getWindow().setTimeout( code, msecs, lang );}
return null;}
JinnWindow_proto.setElementInnerHtml = function( id, content ){if( this.isOpen() ){try{var element = this.getElement( id );element.innerHTML = '' + this.defaultValue( content, '' );}
catch( e ){}}}
function JinnHtmlTableRow(){this.jinnit();}
JinnHtmlTableRow.prototype = new JinnBaseClass();JinnHtmlTableRow_proto = JinnHtmlTableRow.prototype;JinnHtmlTableRow_proto.constructor = JinnHtmlTableRow;JinnHtmlTableRow.superjinn = JinnBaseClass.prototype;JinnHtmlTableRow_proto.jinnit = function(){JinnHtmlTableRow.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.row = null;}
JinnHtmlTableRow_proto.postLoadExecute = function( row ){row = this.defaultValue( row, null );if( typeof( row ) == 'object' ){this.row = row;}
else{this.row = this.getElement( row );}}
JinnHtmlTableRow_proto.getCells = function(){var cells = new Array();if( typeof( this.row.getElementsByTagName ) != 'undefined' ){var cellsTh = this.row.getElementsByTagName( 'th' );var cellsTd = this.row.getElementsByTagName( 'td' );var i = 0;var j = 0;var k = 0;j = cellsTh.length;for( i = 0; i < j; i++ ){cells[k] = cellsTh[i];k++;}
j = cellsTd.length;for( i = 0; i < j; i++ ){cells[k] = cellsTd[i];k++;}}
else
if( typeof( this.row.cells ) != 'undefined' ){cells = this.row.cells;}
return cells;}
JinnHtmlTableRow_proto.setCellStyles = function( newStyle ){var cells = this.getCells( this.row );var cellCount = cells.length;for( i = 0; i < cellCount; i++ ){cells[i].jinnOldStyle = new Array();var newStyleArray = newStyle.split( ';' );for( var key in newStyleArray ){var aStyle = newStyleArray[key].split( ':' );var styleKey = aStyle[0];var styleVal = aStyle[1];if( typeof( styleVal ) != 'string' ){styleVal = '';}
styleKey = styleKey.replace( /^\s+|\s+$/g, '' );styleVal = styleVal.replace( /^\s+|\s+$/g, '' );if( styleKey == '' ){continue;}
cells[i].jinnOldStyle[styleKey] = cells[i].style[styleKey];cells[i].style[styleKey] = styleVal;}}}
JinnHtmlTableRow_proto.revertCellStyles = function(){var cells = this.getCells( this.row );var cellCount = cells.length;for( i = 0; i < cellCount; i++ ){if( typeof( cells[i].jinnOldStyle ) == 'object' ){for( var key in cells[i].jinnOldStyle ){cells[i].style[key] = cells[i].jinnOldStyle[key];}}}}
JinnHtmlTableRow_proto.setCellClasses = function( newClass ){var cells = this.getCells( this.row );var cellCount = cells.length;for( i = 0; i < cellCount; i++ ){cells[i].jinnOldClassName = cells[i].className;cells[i].className = newClass;}}
JinnHtmlTableRow_proto.revertCellClasses = function(){var cells = this.getCells( this.row );var cellCount = cells.length;for( i = 0; i < cellCount; i++ ){cells[i].className = cells[i].jinnOldClassName;}}
function ijinn_htmlRowSetCellStyles( row, style ){if( ijinn_getJdl() ){if( (row = ijinn_getService( 'htmlTableRow', row )) ){row.setCellStyles( style );}}}
function ijinn_htmlRowRevertCellStyles( row ){if( ijinn_getJdl() ){if( (row = ijinn_getService( 'htmlTableRow', row )) ){row.revertCellStyles();}}}
function ijinn_htmlRowSetCellClasses( row, className ){if( ijinn_getJdl() ){if( (row = ijinn_getService( 'htmlTableRow', row )) ){row.setCellClasses( className );}}}
function ijinn_htmlRowRevertCellClasses( row ){if( ijinn_getJdl() ){if( (row = ijinn_getService( 'htmlTableRow', row )) ){row.revertCellClasses();}}}
function JinnDataBrowser(){this.jinnit();}
JinnDataBrowser.prototype = new JinnBaseClass();JinnDataBrowser_proto = JinnDataBrowser.prototype;JinnDataBrowser_proto.constructor = JinnDataBrowser;JinnDataBrowser.superjinn = JinnBaseClass.prototype;JinnDataBrowser_proto.jinnit = function(){JinnDataBrowser.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.key                = null;this.data               = null;this.keyStack           = new Array();this.stack              = new Array();this.window             = null;this.timeoutId          = null;this.autoUpdate         = false;this.brief              = true;this.showFunctions      = false;this.sortBy             = 'key';this.sortAscending      = true;this.denoteDescending   = '(descending)';this.denoteAscending    = '(ascending)';this.htmlTemplate =
'<html>'
+ '<head>'
+ '<scr' + 'ipt type="text/javascript">' + "\n"
+ '<' + '!--//--' + '><' + '![' + 'CDATA[//><' + '!--' + "\n"
+ 'window ? (window.interJinnSkipUserJavaScript = true) : false;' + "\n"
+ '//--' + '><' + '!]' + ']>' + "\n"
+ '</' + 'script>'
+ '<style type="text/css">'
+ '<!--'
+ '' // ----------------------------------------------------------------
+ 'body, h1, h2, h3, p, font, table, td, th, ul, ol, textarea, input, form, blockquote, select'
+ '{'
+ '    font-family: arial, helvetica, sans-serif;'
+ '    font-size:10px;'
+ '}'
+ ''
+ 'body'
+ '{'
+ '    background: #fffff4;'
+ '    margin-bottom: 2px;'
+ '}'
+ ''
+ 'h1.details'
+ '{'
+ '    color: #000000;'
+ '    font-size: 14px;'
+ '    margin-bottom: 2px;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'table.layout'
+ '{'
+ '    width: 100%;'
+ '    padding: 5px;'
+ '    background: transparent;'
+ '}'
+ ''
+ 'table.details'
+ '{'
+ '    width: 100%;'
+ '    padding: 2px;'
+ '    background: transparent;'
+ '}'
+ ''
+ 'table.border'
+ '{'
+ '    width: 100%;'
+ '    padding: 0px;'
+ '    background: #554400;'
+ '}'
+ ''
+ 'table.data'
+ '{'
+ '    width: 100%;'
+ '    padding: 0px;'
+ '    background: #dddddd;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'th.dataColumn'
+ '{'
+ '    width: 33%;'
+ '    background: #776622;'
+ '    color: #ffff00; '
+ '    font-size:12px;'
+ '    padding: 4px;'
+ '    text-align: left;'
+ '}'
+ ''
+ 'td.dataColumn'
+ '{'
+ '    background: #ffffff;'
+ '    color: #000000;'
+ '    padding: 2px;'
+ '    text-align: left;'
+ '    white-space: nowrap;'
+ '}'
+ ''
+ 'td.dataColumnHighlighted'
+ '{'
+ '    background: #f0e8d6;'
+ '    color: #000000;'
+ '    padding: 2px;'
+ '    text-align: left;'
+ '    white-space: nowrap;'
+ '}'
+ ''
+ '.denote'
+ '{'
+ '    color: #ffffff;'
+ '    font-size: 10px;'
+ '    font-weight: bold;'
+ '    padding-left: 10px;'
+ '}'
+ ''
+ '.small'
+ '{'
+ '    font-size: 8px;'
+ '}'
+ ''
+ '.big'
+ '{'
+ '    font-size: 12px;'
+ '}'
+ ''
+ '.success'
+ '{'
+ '    color: #009900;'
+ '}'
+ ''
+ '.error'
+ '{'
+ '    color: #990000;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'a:active'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:focus'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:hover'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:link'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ 'a:visited'
+ '{'
+ '    color: #554400;'
+ '    font-size: 10px;'
+ '    text-decoration: none;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'a.action:active'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'a.action:focus'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'a.action:hover'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'a.action:link'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ 'a.action:visited'
+ '{'
+ '    color: #554400;'
+ '    font-size: 12px;'
+ '    text-decoration: none;'
+ '    margin-bottom: 2px;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'a.heading:active'
+ '{'
+ '    color: #ffff00; '
+ '    font-size:12px;'
+ '    text-decoration: none;'
+ '}'
+ 'a.heading:focus'
+ '{'
+ '    color: #ffff00; '
+ '    font-size:12px;'
+ '    text-decoration: none;'
+ '}'
+ 'a.heading:hover'
+ '{'
+ '    color: #ffff00; '
+ '    font-size:12px;'
+ '    text-decoration: none;'
+ '}'
+ 'a.heading:link'
+ '{'
+ '    color: #ffff00; '
+ '    font-size:12px;'
+ '    text-decoration: none;'
+ '}'
+ 'a.heading:visited'
+ '{'
+ '    color: #ffff00; '
+ '    font-size:12px;'
+ '    text-decoration: none;'
+ '}'
+ '' // ----------------------------------------------------------------
+ 'a.details:active'
+ '{'
+ '    color: #007700;'
+ '    font-weight: bold;'
+ '    text-decoration: none;'
+ '}'
+ 'a.details:focus'
+ '{'
+ '    color: #007700;'
+ '    font-weight: bold;'
+ '    text-decoration: none;'
+ '}'
+ 'a.details:hover'
+ '{'
+ '    color: #770000;'
+ '    font-weight: bold;'
+ '    text-decoration: none;'
+ '}'
+ 'a.details:link'
+ '{'
+ '    color: #007700;'
+ '    font-weight: bold;'
+ '    text-decoration: none;'
+ '}'
+ 'a.details:visited'
+ '{'
+ '    color: #007700;'
+ '    font-weight: bold;'
+ '    text-decoration: none;'
+ '}'
+ '' // ----------------------------------------------------------------
+ '-->'
+ '</style>'
+ '</head>'
+ '<body>'
+ '<div id="interJinnSkipUserJavaScript"></div>'
+ '<div align="center">'
+ '<span id="content">'
+ '</span>'
+ '</div>'
+ '</body>'
+ '</html>';}
JinnDataBrowser_proto.getWindowSpecs = function(){var specs = new Array();specs['width']          = 0.6 * this.getScreenWidth();specs['height']         = 0.6 * this.getScreenHeight();specs['directories']    = 'no';specs['location']       = 'no';specs['menubar']        = 'no';specs['status']         = 'no';specs['titlebar']       = 'yes';specs['toolbar']        = 'no';specs['scrollbars']     = 'yes';return specs;}
JinnDataBrowser_proto.postLoadExecute = function( data, key ){if( this.isset( data ) ){this.setData( data, key );}}
JinnDataBrowser_proto.setData = function( data, key ){tKey = '' + this.defaultValue( key, '' );if( this.data != null ){this.keyStack.push( this.key );this.stack.push( this.data );}
this.key  = tKey;this.data = data;this.render();}
JinnDataBrowser_proto.backup = function(){if( this.stack.length ){this.key  = this.keyStack.pop();this.data = this.stack.pop();this.render();}}
JinnDataBrowser_proto.render = function(){var anchorIds = new Array();var links = new Array();if( this.autoUpdate ){if( this.window ){this.window.clearTimeout( this.timeoutId );}}
if( this.brief ){var anchorId = 'id' + this.getUniqueId();var link =
'<a'
+ ' id="' + anchorId + '"'
+ ' class="action"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.brief = false; '
+     'this.jinnViewerWindow.render(); '
+     'return false;"'
+ '>'
+ 'Full Details'
+ '</a>';links[links.length] = link;anchorIds[anchorIds.length] = anchorId;}
else{var anchorId = 'id' + this.getUniqueId();var link =
'<a'
+ ' id="' + anchorId + '"'
+ ' class="action"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.brief = true; '
+     'this.jinnViewerWindow.render(); '
+     'return false;"'
+ '>'
+ 'Brief Details'
+ '</a>';links[links.length] = link;anchorIds[anchorIds.length] = anchorId;}
if( this.showFunctions ){var anchorId = 'id' + this.getUniqueId();var link =
'<a'
+ ' id="' + anchorId + '"'
+ ' class="action"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.showFunctions = false; '
+     'this.jinnViewerWindow.render(); '
+     'return false;"'
+ '>'
+ 'Hide Functions'
+ '</a>';links[links.length] = link;anchorIds[anchorIds.length] = anchorId;}
else{var anchorId = 'id' + this.getUniqueId();var link =
'<a'
+ ' id="' + anchorId + '"'
+ ' class="action"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.showFunctions = true; '
+     'this.jinnViewerWindow.render(); '
+     'return false;"'
+ '>'
+ 'Show Functions'
+ '</a>';links[links.length] = link;anchorIds[anchorIds.length] = anchorId;}
if( 1 ){var anchorId = 'id' + this.getUniqueId();var link =
'<a'
+ ' id="' + anchorId + '"'
+ ' class="action"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.render(); '
+     'return false;"'
+ '>'
+ 'Refresh'
+ '</a>';links[links.length] = link;anchorIds[anchorIds.length] = anchorId;}
if( this.stack.length ){var anchorId = 'id' + this.getUniqueId();var link =
'<a'
+ ' id="' + anchorId + '"'
+ ' class="action"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.backup(); '
+     'return false;"'
+ '>'
+ '<< Previous <<'
+ '</a>';links[links.length] = link;anchorIds[anchorIds.length] = anchorId;}
datatype = typeof( this.data );if( this.data === null ){datatype = 'null';}
else
if( datatype == 'object' ){if( this.data instanceof Array ){datatype = 'Array';}
else{datatype = this.getClassName( this.data );}}
var title =
'<table class="details" cellspacing="0">'
+ '<tr>'
+ '<td align="left">'
+ '<h1 class="details">'
+ '<pre style="margin: 0px; padding: 0px;">'
+ 'Viewing details for '
+ (this.key != '' ? ("'" + this.key + "' => ") : '')
+ "'" + datatype + "'"
+ '</pre>'
+ '</h1>'
+ '</td>'
+ '</tr>'
+ '<tr>'
+ '<td align="left">'
+ '<pre style="margin: 0px; padding: 0px;">'
+ links.join( '&nbsp;&nbsp;|&nbsp;&nbsp;' )
+ '&nbsp;</pre>'
+ '</td>'
+ '</tr>'
+ '</table>';var table =
'<table class="layout" cellspacing="0">'
+ '<tr>'
+ '<td align="left">'
+ title
+ '<table class="border" cellspacing="0">'
+ '<tr>'
+ '<td>'
+ '<table id="details" class="data" cellspacing="1">';if( typeof( this.data ) != 'object' ){table +=
'<tr>'
+ '<th class="dataColumn">Datatype</th>'
+ '<th class="dataColumn">Value</th>'
+ '</tr>'
+ '<tr>'
+ '<td class="dataColumn">'
+ typeof( this.data )
+ '</th>'
+ '<td class="dataColumn">'
+ this.data
+ '</th>'
+ '</tr>';}
else{var keyType = 'Property';if( this.data instanceof Array ){keyType = 'Index';}
var keyTitleAppend = '';if( this.sortBy == 'key' ){if( this.sortAscending ){keyTitleAppend =
' <span class="denote">'
+ this.denoteAscending
+ '</span>';}
else{keyTitleAppend =
' <span class="denote">'
+ this.denoteDescending
+ '</span>';}}
var datatypeTitleAppend = '';if( this.sortBy == 'datatype' ){if( this.sortAscending ){datatypeTitleAppend =
' <span class="denote">'
+ this.denoteAscending
+ '</span>';}
else{datatypeTitleAppend =
' <span class="denote">'
+ this.denoteDescending
+ '</span>';}}
var idSortByKey = 'id' + this.getUniqueId();anchorIds[anchorIds.length] = idSortByKey;var linkSortByKey =
'<a id="' + idSortByKey + '" class="heading" href="#">'
+ keyType + keyTitleAppend
+ '</a>';var idSortByDatatype = 'id' + this.getUniqueId();anchorIds[anchorIds.length] = idSortByDatatype;var linkSortByDatatype =
'<a id="' + idSortByDatatype + '" class="heading" href="#">'
+ 'Datatype' + datatypeTitleAppend
+ '</a>';table +=
'<tr>'
+ '<th class="dataColumn">'
+ linkSortByKey
+ '</th>'
+ '<th class="dataColumn">'
+ linkSortByDatatype
+ '</th>'
+ '<th class="dataColumn">'
+ 'Value'
+ '</th>'
+ '</tr>';}
table +=
'</table>'
+ '</td>'
+ '</tr>'
+ '</table>'
+ '</td>'
+ '</tr>'
+ '</table>';if( this.window == null || this.window.isClosed() ){this.window = this.getService( 'window', this.getWindowSpecs() );this.window.open( this.htmlTemplate );if( this.window.isOpen() ){this.window.getWindow().jinnViewerWindow = this;}}
if( this.window.isOpen() ){this.window.setElementInnerHtml( 'content', table );}
for( var key in anchorIds ){var anchor = this.window.getElement( anchorIds[key] );if( anchor ){anchor.jinnViewerWindow = this;}}
var anchorSortByKey = this.window.getElement( idSortByKey );if( anchorSortByKey ){anchorSortByKey.onclick = function(){if( this.jinnViewerWindow.sortBy == 'key' ){this.jinnViewerWindow.sortAscending =
this.jinnViewerWindow.sortAscending ? false : true;}
else{this.jinnViewerWindow.sortBy = 'key';this.jinnViewerWindow.sortAscending = true;}
this.jinnViewerWindow.render();return false;}}
var anchorSortyByDatatype = this.window.getElement( idSortByDatatype );if( anchorSortyByDatatype ){anchorSortyByDatatype.onclick = function(){if( this.jinnViewerWindow.sortBy == 'datatype' ){this.jinnViewerWindow.sortAscending =
this.jinnViewerWindow.sortAscending ? false : true;}
else{this.jinnViewerWindow.sortBy = 'datatype';this.jinnViewerWindow.sortAscending = true;}
this.jinnViewerWindow.render();return false;}}
if( typeof( this.data ) == 'object' ){this.renderProperties();}
this.window.scrollTo( 0, 0 );this.window.focus();if( this.autoUpdate ){var timeoutFunction = function(){this.jinnViewerWindow.render();}
this.timeoutId = this.window.setTimeout( timeoutFunction, 500 );}}
JinnDataBrowser_proto.renderProperties = function(){if( typeof( this.data ) != 'object' ){return;}
var entries = new Array();for( var key in this.data ){try{value = this.data[key];}
catch( e ){value = '*** inaccessible ***';}
var datatype = typeof( value );if( !this.showFunctions && datatype == 'function' ){continue;}
var entry = new Array();entry['key']      = key;entry['datatype'] = datatype;entry['value']    = value;entry['viewer']   = this;if( value == null ){entry['datatype'] = 'null';}
else
if( datatype == 'object' ){if( value instanceof Array ){entry['datatype'] = 'array';}
else{entry['datatype'] = '' + this.getClassName( value );}}
entries[entries.length] = entry;}
var sortFunction = function( a, b ){var modifier = a['viewer'].sortAscending ? 1 : -1;if( a['viewer'].sortBy == 'datatype' ){if( a['datatype'] < b['datatype'] ){return 0 - modifier;}
if( a['datatype'] > b['datatype'] ){return 0 + modifier;}
if( a['key'] < b['key'] ){return -1;}
if( a['key'] > b['key'] ){return 1;}}
else{if( a['key'] < b['key'] ){return 0 - modifier;}
if( a['key'] > b['key'] ){return 0 + modifier;}}
return 0;}
var sorted = entries.sort( sortFunction );for( var key in sorted ){this.renderPropertyRow(
sorted[key]['key'], sorted[key]['value'] );}}
JinnDataBrowser_proto.renderPropertyRow = function( key, value ){var datatype = typeof( value );var showDatatype = datatype;var showValue = '';var id = 'id' + this.getUniqueId();if( value == null ){showDatatype = 'null';showValue = 'null';}
else
if( datatype == 'object' ){if( value instanceof Array ){showDatatype = 'array';}
else{showDatatype = this.getClassName( value );}
showValue =
'<a'
+ ' id="' + id + '"'
+ ' class="details"'
+ ' href="#"'
+ ' onclick="'
+     'this.jinnViewerWindow.setData( '
+         'this.jinnViewerObject, this.jinnViewerKey ); '
+     'return false;"'
+ '>'
+ 'View Details'
+ '</a>';}
else{showValue = this.trim( '' + value );if( showValue == '' ){showValue = '&nbsp;';}
else{if( this.brief ){showValue = showValue.replace( /\n/g, ' ' );showValue = showValue.replace( /\s+/g, ' ' );if( showValue.length > 20 ){showValue = showValue.substr( 0, 30 ) + '...';}}
showValue = showValue.replace( /&/g, '&amp;' );showValue = showValue.replace( /</g, '&lt;' );showValue = showValue.replace( />/g, '&gt;' );showValue = '<pre>' + "\n" + showValue + "\n" + '</pre>';}}
var table = this.window.getElement( 'details' );if( !table ){return;}
rowHighlighter = this.getService( 'htmlTableRow' );var row = table.insertRow( table.rows.length );row.highlighter = this.getService( 'htmlTableRow', row );row.onmouseover = function(){row.highlighter.setCellClasses( 'dataColumnHighlighted' );return true;}
row.onmouseout = function(){row.highlighter.revertCellClasses();return true;}
var cell = null;cell = row.insertCell( row.cells.length );cell.className = 'dataColumn';cell.vAlign = 'top';cell.innerHTML = key;cell = row.insertCell( row.cells.length );cell.className = 'dataColumn';cell.vAlign = 'top';cell.innerHTML = showDatatype;cell = row.insertCell( row.cells.length );cell.className = 'dataColumn';cell.vAlign = 'top';cell.innerHTML = showValue;if( datatype == 'object' ){var anchor = this.window.getElement( id );if( anchor ){anchor.jinnViewerWindow = this;anchor.jinnViewerKey    = key;anchor.jinnViewerObject = value;}}}
function ijinn_browseData( data ){var jdl = ijinn_getJdl();var browser = jdl.getService( 'dataBrowser', data );}
function JinnPhp(){this.jinnit();}
JinnPhp.prototype = new JinnBaseClass();JinnPhp_proto = JinnPhp.prototype;JinnPhp_proto.constructor = JinnPhp;JinnPhp.superjinn = JinnBaseClass.prototype;JinnPhp_proto.jinnit = function(){JinnPhp.superjinn.jinnit.call( this );}
JinnPhp_proto.serialize = function( data ){var serialized = '';var temp = '';var i = 0;switch( typeof( data ) ){case 'object':{if( data instanceof Array ){serialized = 'a:';temp = '';i = 0;for( var key = 0; key < data.length; key++ ){temp +=
this.serialize( '' + key )
+ this.serialize( data[key] );i++;}
serialized += i + ':{' + temp + '}';}
else
if( this.getClassName( data ) === 'Object' ){serialized = 'a:';temp = '';i = 0;for( var key in data ){temp +=
this.serialize( '' + key )
+ this.serialize( data[key] );i++;}
serialized += i + ':{' + temp + '}';}
else{serialized += 'N;';}
break;}
case 'string':{if( data.match( /^\d+$/ ) ){serialized += 'i:' + data + ';';}
else{serialized += 's:' + data.length + ':"' + data + '";';}
break;}
case 'number':{if( (data - Math.floor( data )) == 0 ){serialized += 'i:' + data + ';';}
else{serialized += 'd:' + data + ';';}
break;}
case 'boolean':{if( data ){serialized += 'b:1;';}
else{serialized += 'b:0;';}
break;}
default:{serialized += 'N;';}}
return serialized;}
function JinnHttpRequest(){this.jinnit();}
JinnHttpRequest.prototype = new JinnBaseClass();JinnHttpRequest_proto = JinnHttpRequest.prototype;JinnHttpRequest_proto.constructor = JinnHttpRequest;JinnHttpRequest.superjinn = JinnBaseClass.prototype;JinnHttpRequest_proto.jinnit = function(){JinnHttpRequest.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.httpRequest    = null;this.method         = 'auto';this.resource       = '/foo.php';this.asynchronous   = true;this.userName       = null;this.password       = null;this.varsGET        = new Object();this.varsPOST       = new Object();this.varsREQUEST    = new Object();this.requestHeaders = new Object();this.data           = null;this.handler        = null;this.errorHandler   = null;this.timeout        = 20;this.timeoutHandler = null;this.isActive       = false;}
JinnHttpRequest_proto.setRequestHeader = function( key, value ){this.requestHeaders['' + key] = '' + value;}
JinnHttpRequest_proto.getRequestHeader = function( key ){return this.requestHeaders['' + key];}
JinnHttpRequest_proto.deleteRequestHeader = function( key ){this.requestHeaders['' + key] = null;}
JinnHttpRequest_proto.setGetVar = function( key, value ){this.varsGET['' + key] = value;}
JinnHttpRequest_proto.getGetVar = function( key ){return this.varsGET['' + key];}
JinnHttpRequest_proto.deleteGetVar = function( key ){this.varsGET['' + key] = null;}
JinnHttpRequest_proto.setPostVar = function( key, value ){this.varsPOST['' + key] = value;}
JinnHttpRequest_proto.getPostVar = function( key ){return this.varsPOST['' + key];}
JinnHttpRequest_proto.deletePostVar = function( key ){this.varsPOST['' + key] = null;}
JinnHttpRequest_proto.setVar = function( key, value ){this.varsREQUEST[key] = value;}
JinnHttpRequest_proto.getVar = function( key ){return this.varsREQUEST[key];}
JinnHttpRequest_proto.deleteVar = function( key ){this.varsREQUEST[key] = null;}
JinnHttpRequest_proto.send = function(){var myself = this;var method = this.method.toLowerCase();var query = new Array();var queryString = '';var post = new Array();var postString = '';var httpRequest  = null;this.isActive = true;if( navigator.appName == 'Microsoft Internet Explorer' ){try{httpRequest = new ActiveXObject( 'Microsoft.XMLHTTP' );}
catch( e ){httpRequest = null;}}
if( httpRequest === null ){try{httpRequest = new XMLHttpRequest();}
catch( e ){httpRequest = null;}}
if( httpRequest === null ){myself.errorHandler.call( myself, null, null );}
this.httpRequest = httpRequest;function dispatcher(){var error           = false;var readyState      = null;var status          = null;var statusText      = null;var responseText    = null;var responseXml     = null;try{readyState = httpRequest.readyState;}
catch( e ){return;}
if( readyState != 4 ){return;}
myself.complete = true;try{status = httpRequest.status;statusText = httpRequest.statusText;}
catch( e ){if( myself.errorHandler ){myself.errorHandler.call( myself, null, null );}
return;}
if( status == 200 ){if( myself.handler ){data = eval( httpRequest.responseText );myself.handler.call( myself, data, httpRequest );}}
else{if( myself.errorHandler ){myself.errorHandler.call(
myself, httpRequest.status, httpRequest.statusText );}}
myself.isActive = false;}
if( method != 'auto' && method != 'get' && method != 'post' ){method = 'auto';}
for( var key in this.varsGET ){query[query.length] =
this.urlencode( key )
+ '='
+ this.urlencode( this.varsGET[key] );}
if( query.length ){queryString = '?' + query.join( '&' );}
if( method != 'get' ){for( var key in this.varsPOST ){post[post.length] =
this.urlencode( key )
+ '='
+ this.urlencode( this.varsPOST[key] );}
var sPhp = this.getService( 'php' );for( var key in this.varsREQUEST ){post[post.length] =
'JINN_HTTP_REQUEST_DATA='
+ this.urlencode( sPhp.serialize( this.varsREQUEST ) );break;}
if( post.length ){postString = post.join( '&' );}}
if( postString == '' ){postString = '';}
else
if( method != 'get' ){this.setRequestHeader(
'Content-Type', 'application/x-www-form-urlencoded' );method = 'post';}
if( method == 'auto' ){method = 'get';}
httpRequest.open(method,
this.localizePage( this.resource ) + queryString,
this.asynchronous,
this.userName,
this.password
);httpRequest.onreadystatechange = dispatcher;for( var key in this.requestHeaders ){httpRequest.setRequestHeader( key, this.requestHeaders[key] );}
this.complete = false;httpRequest.send( postString );var timer = function(){if( !myself.complete ){myself.abort();if( myself.timeoutHandler ){myself.timeoutHandler.call( myself );}}}
this.getWindow().setTimeout( timer, this.timeout * 1000 );}
JinnHttpRequest_proto.abort = function(){try{if( this.httpRequest ){this.httpRequest.abort();}}
catch( e ){}
this.isActive = false;}
JinnHttpRequest_proto.getAllResponseHeaders = function(){if( this.httpRequest ){return this.httpRequest.getAllResponseHeaders();}
return null;}
JinnHttpRequest_proto.getResponseHeader = function( key ){if( this.httpRequest ){return this.httpRequest.getResponseHeader( key );}
return null;}
function JinnElement(){this.jinnit();}
JinnElement.prototype = new JinnBaseClass();JinnElement_proto = JinnElement.prototype;JinnElement_proto.constructor = JinnElement;JinnElement.superjinn = JinnBaseClass.prototype;JinnElement_proto.jinnit = function(){JinnElement.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.registerCallbacks();this.master                 = null;this.listeners              = null;this.dragOpacity            = .4;this.minWidth               = 0;this.minHeight              = 0;this.maxWidth               = null;this.maxHeight              = null;this.isDraggable            = false;this.isAutoScroll           = true;this.captureDragStartEvent  = null;this.captureDragMoveEvent   = null;this.dragAction             = 'move';   // 'resize'
this.dragToTop              = true;this.element                = null;this.style                  = null;}
JinnElement_proto.postLoadExecute = function( type, id ){this.listeners = this.getService( 'listenerManager' );if( !this.isset( this.getWindow().gJinnElement_zIndexMaxKnown ) ){this.getWindow().gJinnElement_zIndexMaxKnown = 0;}
type = this.defaultValue( type, 'div' );if( typeof( type ) == 'object' ){this.element = type;}
else{if( type === 'id' && this.isset( id ) ){this.element = this.getElement( id );}
else{var body = this.getDocumentBody();if( body ){this.element = this.getDocument().createElement( type );this.style = this.getElementStyle( this.element );this.style.position     = 'absolute';this.style.overflow     = 'visible';this.style.visibility   = 'hidden';this.style.left         = '0px';this.style.top          = '0px';body.appendChild( this.element );}}}
if( this.element ){this.style = this.getElementStyle( this.element );this.setZIndex( this.getZIndex() );this.augment();}}
JinnElement_proto.registerCallbacks = function(){var myself = this;var captureDragStart = this.captureDragStart;this.captureDragStart = function( event ){captureDragStart.call( myself, event );}
var captureDragStop = this.captureDragStop;this.captureDragStop = function( event ){captureDragStop.call( myself, event );}
var captureDragMove = this.captureDragMove;this.captureDragMove = function( event ){captureDragMove.call( myself, event );}
var autoScroll = this.autoScroll;this.autoScroll = function( event, extra ){autoScroll.call( myself, event, extra );}}
JinnElement_proto.captureDragStart = function( event ){if( !event ){event = this.getWindow().event;}
event.cancelBubble = true;if( this.captureDragStartEvent ){return;}
var tEvent = this.shallowCopy( event );this.augmentEvent( tEvent );tEvent.ijinn_elementX           = this.getX();tEvent.ijinn_elementY           = this.getY();tEvent.ijinn_elementWidth       = this.getX();tEvent.ijinn_elementHeight      = this.getY();tEvent.ijinn_lastMouseDocumentX   = tEvent.ijinn_mouseDocumentX;tEvent.ijinn_lastMouseDocumentY   = tEvent.ijinn_mouseDocumentY;tEvent.ijinn_elementOverflow    = this.style.overflow;var doc  = this.getDocument();var body = this.getDocumentBody();tEvent.ijinn_oldElement_onmousemove = this.element.onmousemove;tEvent.ijinn_oldDoc_onmousedown     = doc.onmousedown;tEvent.ijinn_oldDoc_onmouseup       = doc.onmouseup;tEvent.ijinn_oldDoc_onmousemove     = doc.onmousemove;tEvent.ijinn_oldBody_onselectstart  = body.onselectstart;this.deselectText( tEvent );this.element.onmousemove = this.captureDragMove;doc.onmousedown = this.captureDragStart;doc.onmouseup   = this.captureDragStop;doc.onmousemove = this.captureDragMove;this.captureDragStartEvent = tEvent;this.handleDragStart( tEvent );this.listeners.signalWithEvent('dragstart', this, tEvent,
tEvent.ijinn_elementX,
tEvent.ijinn_elementY
);this.getWindow().setTimeout(
this.objectHandler(
this, this.autoScroll, tEvent ), 50 );return false;}
JinnElement_proto.captureDragStop = function( event ){if( !event ){event = this.getWindow().event;}
var dragStartEvent = this.captureDragStartEvent;this.captureDragStartEvent = null;this.captureDragMoveEvent  = null;if( dragStartEvent == null ){return true;}
event.cancelBubble = true;var tEvent = this.shallowCopy( event );this.augmentEvent( tEvent );tEvent.ijinn_eventDragStart = dragStartEvent;tEvent.ijinn_elementX       = this.getX();tEvent.ijinn_elementY       = this.getY();tEvent.ijinn_elementWidth   = this.getX();tEvent.ijinn_elementHeight  = this.getY();var doc  = this.getDocument();var body = this.getDocumentBody();this.element.onmousemove  = dragStartEvent.ijinn_oldElement_onmousemove;doc.onmousedown             = dragStartEvent.ijinn_oldDoc_onmousedown;doc.onmouseup               = dragStartEvent.ijinn_oldDoc_onmouseup;doc.onmousemove             = dragStartEvent.ijinn_oldDoc_onmousemove;doc.onselectstart           = dragStartEvent.ijinn_oldBody_onselectstart;var xStart = dragStartEvent.ijinn_elementX;var yStart = dragStartEvent.ijinn_elementY;var xStop  = tEvent.ijinn_elementX;var yStop  = tEvent.ijinn_elementY;var xDiff  = xStop - xStart;var yDiff  = yStop - yStart;this.listeners.signalWithEvent('dragstop', this, tEvent,
xStart, yStart, xStop, yStop, xDiff, yDiff
);this.handleDragStop( tEvent );dragStartEvent.ijinn_lastMouseDocumentX = 0;dragStartEvent.ijinn_lastMouseDocumentY = 0;this.destroy( dragStartEvent );return false;}
JinnElement_proto.captureDragMove = function( event ){if( !event ){event = this.getWindow().event;}
event.cancelBubble = true;if( this.master ){if( this.master.captureDragStart ){event.cancelBubble = true;return;}}
if( this.captureDragStartEvent == null ){return
}
event.cancelBubble = true;var tEvent = this.shallowCopy( event );this.augmentEvent( tEvent );tEvent.ijinn_eventDragStart = this.captureDragStartEvent;this.captureDragMoveEvent = tEvent;var xStart = this.captureDragStartEvent.ijinn_lastMouseDocumentX;var yStart = this.captureDragStartEvent.ijinn_lastMouseDocumentY;var xStop  = tEvent.ijinn_mouseDocumentX;var yStop  = tEvent.ijinn_mouseDocumentY;var xDiff  = xStop - xStart;var yDiff  = yStop - yStart;if( xDiff == 0 && yDiff == 0 ){return;}
var mouseX = tEvent.ijinn_mouseDocumentX;var mouseY = tEvent.ijinn_mouseDocumentY;if( this.dragAction == 'move' ){this.moveBy( xDiff, yDiff );tEvent.ijinn_elementX       = this.getX();tEvent.ijinn_elementY       = this.getY();tEvent.ijinn_elementWidth   = this.getWidth();tEvent.ijinn_elementHeight  = this.getHeight();this.deselectText( tEvent );this.listeners.signalWithEvent('dragmove', this, tEvent,
xStart, yStart, xStop, yStop, xDiff, yDiff
);}
else
if( this.dragAction == 'resize' ){this.resizeBy( xDiff, yDiff );tEvent.ijinn_elementX       = this.getX();tEvent.ijinn_elementY       = this.getY();tEvent.ijinn_elementWidth   = this.getWidth();tEvent.ijinn_elementHeight  = this.getHeight();this.deselectText( tEvent );this.listeners.signalWithEvent('dragresize', this, tEvent,
xStart, yStart, xStop, yStop, xDiff, yDiff
);}
this.captureDragStartEvent.ijinn_lastMouseDocumentX = mouseX;this.captureDragStartEvent.ijinn_lastMouseDocumentY = mouseY;return false;}
JinnElement_proto.autoScroll = function( event, extra ){if( this.captureDragStartEvent !== extra ){return;}
if( !this.autoScroll ){return;}
var type = this.dragAction;var moveEvent = this.captureDragMoveEvent;if( !moveEvent ){this.getWindow().setTimeout(
this.objectHandler(
this, this.autoScroll, extra ), 50 );return;}
var threshold = 60;var mouseX = moveEvent.ijinn_mouseDocumentX;var mouseY = moveEvent.ijinn_mouseDocumentY;var winMinX        = this.getWindowViewMinX();var winMaxX        = this.getWindowViewMaxX();var winMinY        = this.getWindowViewMinY();var winMaxY        = this.getWindowViewMaxY();var scrollX = 0;var scrollY = 0;if( type == 'move' || type == 'resize' ){if( mouseX < (winMinX + threshold) ){scrollX = mouseX - (winMinX + threshold);}
else
if( mouseX > (winMaxX - threshold) ){scrollX = mouseX - (winMaxX - threshold);}
if( mouseY < (winMinY + threshold) ){scrollY = mouseY - (winMinY + threshold);}
else
if( mouseY > (winMaxY - threshold) ){scrollY = mouseY - (winMaxY - threshold);}}
if( scrollX != 0 || scrollY != 0 ){scrollX /= 2;scrollY /= 2;var newWinScrollX = winMinX + scrollX;var newWinScrollY = winMinY + scrollY;if( newWinScrollX < 0 ){newWinScrollX = 0;}
if( newWinScrollY < 0 ){newWinScrollY = 0;}
this.getWindow().scrollTo( newWinScrollX, newWinScrollY );}
this.getWindow().setTimeout(
this.objectHandler(
this, this.autoScroll, extra ), 50 );}
JinnElement_proto.setContent = function( content ){this.element.innerHTML = content;}
JinnElement_proto.setBackground = function( background ){if( background.match( /^(url|rgb|#)\(/ ) ){this.style.background = background;}
else
if( background.match( / .* / ) ){this.style.background = background;}
else
if( background.match( /\./ ) ){this.style.background = 'url( ' + background + ')';}
else{this.style.background = background;}}
JinnElement_proto.getBackground = function(){return this.style.background;}
JinnElement_proto.setAutoScroll = function( status ){this.isAutoScroll = status ? true : false;}
JinnElement_proto.setDraggable = function( status, type ){if( this.isDraggable == status ){return;}
if( status ){this.isDraggable = true;if( this.style.position != 'absolute'
&&
this.style.position != 'relative' ){this.style.position = this.defaultValue( type, 'absolute' );}
this.preDrag_onmousedown = this.element.onmousedown;this.preDrag_onmouseup   = this.element.onmouseup;this.element.onmousedown = this.captureDragStart;this.element.onmouseup   = this.captureDragStop;}
else{this.isDraggable = false;this.element.onmousedown = this.preDrag_onmousedown;this.element.onmouseup   = this.preDrag_onmouseup;this.preDrag_onmousedown = null;this.preDrag_onmouseup   = null;}}
JinnElement_proto.setDragAction = function( action ){this.dragAction = action;}
JinnElement_proto.setDragOpacity = function( opacity ){this.dragOpacity = opacity;}
JinnElement_proto.deselectText = function( event ){var tExtra = new Object();tExtra.operaFudgeTarget = this.element;tExtra.event = event;var compat = this.getService( 'browserCompatibility' );compat.deselectText( this, tExtra );}
JinnElement_proto.hide = function(){this.style.visibility = 'hidden';this.listeners.signal( 'hide', this );this.listeners.signal( 'layout', this );}
JinnElement_proto.show = function(){if( this.isDestroyed() ){return;}
this.style.visibility = 'visible';this.listeners.signal( 'show', this );this.listeners.signal( 'layout', this );}
JinnElement_proto.toggleVisibility = function(){if( this.style.visibility == 'visible' ){this.hide();}
else{this.show();}}
JinnElement_proto.isVisible = function(){if( this.style.visibility == 'hidden' ){return false;}
return true;}
JinnElement_proto.getZIndex = function(){return this.defaultForNaN( this.style.zIndex );}
JinnElement_proto.setZIndex = function( zIndex ){if( zIndex < 10000 ){zIndex = 10000;}
var zIndexOld = this.getZIndex();var zIndexNew = this.defaultForNaN( zIndex );this.style.zIndex = zIndexNew;if( zIndexNew > gJinnElement_zIndexMaxKnown
&&
zIndexNew < 1000000000 ){gJinnElement_zIndexMaxKnown = zIndexNew;}
this.listeners.signal( 'zindexchange', this, zIndexOld, zIndexNew );}
JinnElement_proto.getZIndexMax = function(){return gJinnElement_zIndexMaxKnown;}
JinnElement_proto.getWidth = function(){this.augment();return this.element.ijinn.width;}
JinnElement_proto.getHeight = function(){this.augment();return this.element.ijinn.height;}
JinnElement_proto.setWidth = function( width ){this.resizeBy( this.defaultForNaN( width, 0 ) - this.getWidth(), 0 );}
JinnElement_proto.setHeight = function( height ){this.resizeBy( 0, this.defaultForNaN( height, 0 ) - this.getHeight() );}
JinnElement_proto.getOptimalWidth = function( width ){return this.getWidth();}
JinnElement_proto.getOptimalHeight = function(){return this.getHeight();}
JinnElement_proto.resizeWidthBy = function( width ){this.resizeBy( width, 0 );}
JinnElement_proto.resizeHeightBy = function( height ){this.resizeBy( 0, height );}
JinnElement_proto.resizeTo = function( width, height ){this.resizeBy(this.defaultForNaN( width, 0 ) - this.getWidth(),
this.defaultForNaN( height, 0 ) - this.getHeight()
);}
JinnElement_proto.resizeBy = function( width, height ){var tWidth  = this.defaultForNaN( width );var tHeight = this.defaultForNaN( height );this.augment();var oldWidth  = this.element.ijinn.width;var oldHeight = this.element.ijinn.height;var newWidth  = oldWidth  + tWidth;var newHeight = oldHeight + tHeight;if( newWidth < this.minWidth ){newWidth = this.minWidth;}
if( newHeight < this.minHeight ){newHeight = this.minHeight;}
if( this.maxWidth !== null
&&
newWidth > this.maxWidth ){newWidth = this.maxWidth;}
if( this.maxHeight !== null
&&
newHeight > this.maxHeight ){newHeight = this.maxHeight;}
var compat = this.getService( 'browserCompatibility' );compat.setElementWidth( this, this.element, newWidth );compat.setElementHeight( this, this.element, newHeight );this.augment();newWidth  = this.element.ijinn.width;newHeight = this.element.ijinn.height;this.listeners.signal(
'resizeby', this, newWidth - oldWidth, newHeight - oldHeight );}
JinnElement_proto.getX = function(){return this.element.offsetLeft;}
JinnElement_proto.getY = function(){return this.element.offsetTop;}
JinnElement_proto.setX = function( x ){this.moveBy( this.defaultForNaN( x, 0 ) - this.getX(), 0 );}
JinnElement_proto.setY = function( y ){this.moveBy( 0, this.defaultForNaN( y, 0 ) - this.getY() );}
JinnElement_proto.moveXBy = function( x ){this.moveBy( x, 0 );}
JinnElement_proto.moveYBy = function( y ){this.moveBy( 0, y );}
JinnElement_proto.moveTo = function( x, y ){this.moveBy(this.defaultForNaN( x, 0 ) - this.getX(),
this.defaultForNaN( y, 0 ) - this.getY()
);}
JinnElement_proto.moveBy = function( x, y ){var tX = this.defaultForNaN( x );var tY = this.defaultForNaN( y );this.augment();var oldX = this.element.ijinn.realX;var oldY = this.element.ijinn.realY;this.style.left = (this.element.ijinn.relativeX + tX) + 'px';this.style.top  = (this.element.ijinn.relativeY + tY) + 'px';this.augment();var newX = this.element.ijinn.realX;var newY = this.element.ijinn.realY;this.listeners.signal( 'moveby', this, newX - oldX, newY - oldY );}
JinnElement_proto.setBorderWidths = function( top, right, bottom, left ){var compat = this.getService( 'browserCompatibility' );compat.setElementBorderWidths(
this, this.element, top, right, bottom, left );}
JinnElement_proto.setBorderWidth = function( width ){var compat = this.getService( 'browserCompatibility' );compat.setElementBorderWidths(
this, this.element, width, width, width, width );}
JinnElement_proto.setBorderWidthTop = function( width ){var compat = this.getService( 'browserCompatibility' );compat.setElementBorderWidths(
this, this.element, width, null, null, null );}
JinnElement_proto.setBorderWidthRight = function( width ){var compat = this.getService( 'browserCompatibility' );compat.setElementBorderWidths(
this, this.element, null, width, null, null );}
JinnElement_proto.setBorderWidthBottom = function( width ){var compat = this.getService( 'browserCompatibility' );compat.setElementBorderWidths(
this, this.element, null, null, width, null );}
JinnElement_proto.setBorderWidthLeft = function( width ){var compat = this.getService( 'browserCompatibility' );compat.setElementBorderWidths(
this, this.element, null, null, null, width );}
JinnElement_proto.setOpacity = function( opacity ){var compat = this.getService( 'browserCompatibility' );compat.setElementOpacity( this, this.element, opacity );}
JinnElement_proto.getOpacity = function(){var compat = this.getService( 'browserCompatibility' );compat.getElementOpacity( this, this.element );}
JinnElement_proto.raiseToTop = function(){this.setZIndex( this.getZIndexMax() + 1 );}
JinnElement_proto.close = function(){if( this.captureDragStartEvent != null ){return false;}
var tEvent = new Object();tEvent['returnValue'] = true;this.listeners.signalWithEvent( 'close', this, tEvent );if( tEvent['returnValue'] ){this.destroy();return true;}
return false;}
JinnElement_proto.handleDragStart = function( event ){event.ijinn_elementZIndex = this.getZIndex();this.style.zIndex = 1000000000;event.ijinn_opacity = this.defaultValue( this.element.ijinn_opacity, 1.0 );this.setOpacity( this.dragOpacity );}
JinnElement_proto.handleDragStop = function( event ){if( this.dragToTop ){this.raiseToTop();}
else{this.setZIndex( event.ijinn_eventDragStart.ijinn_elementZIndex );}
this.setOpacity( event.ijinn_eventDragStart.ijinn_opacity );}
JinnElement_proto.handleDragMove = function( event ){this.moveBy( event.ijinn_mouseMovedX, event.ijinn_mouseMovedY );}
JinnElement_proto.handleDragResize = function( event ){this.resizeBy( event.ijinn_mouseMovedX, event.ijinn_mouseMovedY );}
JinnElement_proto.handleMoveBy = function( event, x, y ){this.moveBy( x, y );}
JinnElement_proto.handleResizeBy = function( event, x, y ){this.resizeBy( x, y );}
JinnElement_proto.handleZIndexChange = function( event, oldZ, newZ ){this.setZIndex( newZ + 1 );}
JinnElement_proto.handleClose = function( event ){this.close();}
JinnElement_proto.augment = function(){var compat = this.getService( 'browserCompatibility' );compat.augmentElement( this, this.element );}
JinnElement_proto.destructor = function(){this.hide();this.listeners.signal( 'destroy', this );this.listeners.signal( 'layout', this );this.listeners.destroy();}
function JinnLayout(){this.jinnit();}
JinnLayout.prototype = new JinnElement();JinnLayout_proto = JinnLayout.prototype;JinnLayout_proto.constructor = JinnLayout;JinnLayout.superjinn = JinnElement.prototype;JinnLayout_proto.jinnit = function(){JinnLayout.superjinn.jinnit.call( this );this.finalized  = false;this.itemCount  = 0;this.minWidth   = 0;this.minHeight  = 0;this.maxWidth   = 10000000;     // seems reasonable :)
this.maxHeight  = 10000000;this.fillWidth  = false;this.fillHeight = false;this.resizesUp    = false;this.resizesDown  = true;this.resizesLeft  = false;this.resizesRight = true;this.contents = new Array();this.neededContentWidth   = 0;this.neededContentHeight  = 0;this.adjustHandler = null;}
JinnLayout_proto.postLoadExecute = function( type, id ){JinnLayout.superjinn.postLoadExecute.call( this, type, id );if( this.style ){this.style.overflow = 'hidden';this.resizeTo( 1, 1 );}
var div = this.getService( 'element', 'div' );div.style.position = 'absolute';div.moveTo( 0, 0 );this.element.appendChild( div.element );div.style.position = 'relative';div.style.overflow = 'hidden';div.style.width = '100%';div.style.height = '100%';div.show();this.children = div;}
JinnLayout_proto.open = function( x, y, width, height ){if( this.finalized ){this.show();return;}
this.finalize();x       = this.defaultValue( x, 100 );y       = this.defaultValue( y, 100 );width   = this.defaultValue( width, 200 );height  = this.defaultValue( height, 200 );this.moveTo( x, y );this.resizeTo( width, height );this.calibrate();this.show();}
JinnLayout_proto.finalize = function( x, y, width, height ){if( this.finalized ){return;}
this.finalized = true;for( var key in this.contents ){if( this.contents[key].finalize ){this.contents[key].finalize();}}}
JinnLayout_proto.prepend = function( obj, show ){obj.style.position = 'absolute';obj.moveTo( 0, 0 );obj.listeners.add( 'raisetotop', this, this.handleRaiseToTop );this.contents.shift( obj );this.children.element.appendChild( obj.element );if( this.defaultValue( show, false ) ){obj.show();}
this.calibrate();return obj;}
JinnLayout_proto.append = function( obj, show ){obj.style.position = 'absolute';obj.moveTo( 0, 0 );obj.listeners.add( 'raisetotop', this, this.handleRaiseToTop );this.contents.push( obj );this.children.element.appendChild( obj.element );if( this.defaultValue( show, false ) ){obj.show();}
this.calibrate();return obj;}
JinnLayout_proto.add = function( obj, show ){return this.append( obj, show );}
JinnLayout_proto.calibrate = function(){if( !this.finalized ){return;}
if( this.calibrationHandler ){return;}
var extra = new Object();var handler =
this.objectHandler( this, this.calibrateDelayed, extra );extra.handler = handler;this.calibrationHandler = handler;this.getWindow().setTimeout( handler, 100 );}
JinnLayout_proto.calibrateDelayed = function(){this.calibrationHandler = null;this.performCalibration();}
JinnLayout_proto.performCalibration = function(){if( !this.finalized ){return;}
var itemCount = 0;var nextX = 0;var nextY = 0;var maxWidth  = 0;var maxHeight = 0;var lastWidth  = 0;var lastHeight = 0;var availableWidth  = this.getWidth();var availableHeight = this.getHeight();var content = null;var newContents = new Array();for( var key in this.contents ){content = this.contents[key];if( content.isDestroyed() ){this.debug( 'Hmmmmmmmmmmmmmmmmmmmmmmmm 1' );continue;}
newContents[newContents.length] = content;if( !content.isVisible() ){this.debug( 'Hmmmmmmmmmmmmmmmmmmmmmmmm 2' );continue;}
content.augment();content.resizeTo( availableWidth, availableHeight );lastWidth  = content.getWidth();lastHeight = content.getHeight();content.moveTo( nextX, nextY );nextY += lastHeight;availableHeight = this.maxValue( 0, availableHeight - lastHeight );maxWidth  = this.maxValue( maxWidth,  lastWidth );maxHeight = this.maxValue( maxHeight, lastHeight );}
this.contents = newContents;this.itemCount = newContents.length;this.neededContentWidth  = maxWidth;this.neededContentHeight = maxHeight;}
JinnLayout_proto.handleRaiseToTop = function( event ){if( this.jinnRaiseRecursion ){return;}
this.jinnRaiseRecursion = 1;this.listeners.signalWithEvent( 'raisetotop', this, event );this.jinnRaiseRecursion = null;}
JinnLayout_proto.getOptimalWidth = function(){var max = 0;for( var key in this.contents ){max = this.maxValue( max, this.contents[key].getOptimalWidth() );}
return max;}
JinnLayout_proto.getOptimalHeight = function(){var max = 0;for( var key in this.contents ){max += this.contents[key].getOptimalHeight();}
return max;}
JinnLayout_proto.resizeBy_crud = function( width, height ){this.augment();var widthNeeded  = this.neededContentWidth;var widthCurrent = this.element.ijinn.width;var widthTarget  = widthCurrent + width;var heightNeeded  = this.neededContentHeight;var heightCurrent = this.element.ijinn.height;var heightTarget  = heightCurrent + height;var actualResizeWidth = 0;var actualResizeHeight = 0;if( this.resizesRight || this.resizesLeft ){if( width <= 0 ){if( widthCurrent > this.minWidth ){actualResizeWidth = width;if( (widthCurrent + actualResizeWidth) < this.minWidth ){actualResizeWidth = this.minWidth - this.widthCurrent;}}}
else{if( widthCurrent < this.maxWidth ){if( this.fillWidth ){actualResizeWidth = width;}
else
if( widthTarget <= widthNeeded ){actualResizeWidth = width;}
else{actualResizeWidth = widthNeeded - widthCurrent;}
if( (widthCurrent + actualResizeWidth) > this.maxWidth ){actualResizeWidth = this.maxWidth - widthCurrent;}}}}
if( this.resizesRight || this.resizesLeft ){if( height <= 0 ){if( heightCurrent > this.minHeight ){actualResizeHeight = height;if( (heightCurrent + actualResizeHeight) < this.minHeight ){actualResizeHeight = this.minHeight - this.heightCurrent;}}}
else{if( heightCurrent < this.maxHeight ){if( this.fillHeight ){actualResizeHeight = height;}
else
if( heightTarget <= heightNeeded ){actualResizeHeight = height;}
else{actualResizeHeight = heightNeeded - heightCurrent;}
if( (heightCurrent + actualResizeHeight) > this.maxHeight ){actualResizeHeight = this.maxHeight - heightCurrent;}}}}
if( actualResizeWidth != 0 || actualResizeHeight != 0 ){xDisplace = 0;yDisplace = 0;if( this.resizesLeft && this.resizesRight ){xDisplace = (0 - this.asInt( actualResizeWidth / 2 ));}
else
if( this.resizesLeft ){xDisplace = (0 - actualResizeWidth);}
if( this.resizesUp && this.resizesDown ){yDisplace = (0 - this.asInt( actualResizeHeight / 2 ));}
else
if( this.resizesLeft ){yDisplace = (0 - actualResizeHeight);}
if( xDisplace != 0 || yDisplace != 0 ){this.moveBy( xDisplace, yDisplace );}
JinnLayout.superjinn.resizeBy.call(
this, actualResizeWidth, actualResizeHeight );this.calibrate();}}
JinnLayout_proto.resizeBy = function( width, height ){if( !this.finalized ){return;}
if( width != 0 || height != 0 ){JinnLayout.superjinn.resizeBy.call( this, width, height );this.calibrate();}}
JinnLayout_proto.moveBy = function( x, y ){if( !this.finalized ){return;}
if( x != 0 || y != 0 ){JinnLayout.superjinn.moveBy.call( this, x, y );}
this.moveBy = JinnLayout.superjinn.moveBy;}
function JinnLayoutColumnFlowDown(){this.jinnit();}
JinnLayoutColumnFlowDown.prototype = new JinnLayout();JinnLayoutColumnFlowDown_proto = JinnLayoutColumnFlowDown.prototype;JinnLayoutColumnFlowDown_proto.constructor = JinnLayoutColumnFlowDown;JinnLayoutColumnFlowDown.superjinn = JinnLayout.prototype;JinnLayoutColumnFlowDown_proto.jinnit = function(){JinnLayoutColumnFlowDown.superjinn.jinnit.call( this );}
function JinnLayoutColumnFlowUp(){this.jinnit();}
JinnLayoutColumnFlowUp.prototype = new JinnLayout();JinnLayoutColumnFlowUp_proto = JinnLayoutColumnFlowUp.prototype;JinnLayoutColumnFlowUp_proto.constructor = JinnLayoutColumnFlowUp;JinnLayoutColumnFlowUp.superjinn = JinnLayout.prototype;JinnLayoutColumnFlowUp_proto.jinnit = function(){JinnLayoutColumnFlowUp.superjinn.jinnit.call( this );}
JinnLayoutColumnFlowUp_proto.performCalibration = function(){if( !this.finalized ){return;}
var itemCount = 0;var maxWidth  = 0;var maxHeight = 0;var lastWidth  = 0;var lastHeight = 0;var availableWidth  = this.getWidth();var availableHeight = this.getHeight();var nextX = 0;var nextY = availableHeight;var content = null;var newContents = new Array();for( var key in this.contents ){content = this.contents[key];if( content.isDestroyed() ){continue;}
newContents[newContents.length] = content;if( !content.isVisible() ){continue;}
content.augment();content.resizeTo( availableWidth, availableHeight );lastWidth  = content.getWidth();lastHeight = content.getHeight();content.moveTo( nextX, nextY - lastHeight );nextY -= lastHeight;availableHeight = this.maxValue( 0, availableHeight - lastHeight );maxWidth  = this.maxValue( maxWidth,  lastWidth );maxHeight = this.maxValue( maxHeight, lastHeight );}
this.contents = newContents;this.itemCount = newContents.length;this.neededContentWidth  = maxWidth;this.neededContentHeight = maxHeight;}
function JinnLayoutRowFlowRight(){this.jinnit();}
JinnLayoutRowFlowRight.prototype = new JinnLayout();JinnLayoutRowFlowRight_proto = JinnLayoutRowFlowRight.prototype;JinnLayoutRowFlowRight_proto.constructor = JinnLayoutRowFlowRight;JinnLayoutRowFlowRight.superjinn = JinnLayout.prototype;JinnLayoutRowFlowRight_proto.jinnit = function( type, id ){JinnLayoutRowFlowRight.superjinn.jinnit.call( this, type, id );}
JinnLayoutRowFlowRight_proto.performCalibration = function(){if( !this.finalized ){return;}
var itemCount = 0;var nextX = 0;var nextY = 0;var maxWidth  = 0;var maxHeight = 0;var lastWidth  = 0;var lastHeight = 0;var availableWidth  = this.getWidth();var availableHeight = this.getHeight();var content = null;var newContents = new Array();for( var key in this.contents ){content = this.contents[key];if( content.isDestroyed() ){continue;}
newContents[newContents.length] = content;if( !content.isVisible() ){continue;}
content.augment();content.resizeTo( availableWidth, availableHeight );lastWidth  = content.getWidth();lastHeight = content.getHeight();content.moveTo( nextX, nextY );nextX += lastWidth;availableWidth = this.maxValue( 0, availableWidth - lastWidth );maxWidth  = this.maxValue( maxWidth,  lastWidth );maxHeight = this.maxValue( maxHeight, lastHeight );}
this.contents = newContents;this.itemCount = newContents.length;this.neededContentWidth  = maxWidth;this.neededContentHeight = maxHeight;}
JinnLayoutRowFlowRight_proto.getOptimalWidth = function(){var max = 0;for( var key in this.contents ){max += this.contents[key].getOptimalWidth();}
return max;}
JinnLayoutRowFlowRight_proto.getOptimalHeight = function(){var max = 0;for( var key in this.contents ){max = this.maxValue( max, this.contents[key].getOptimalHeight() );}
return max;}
function JinnLayoutRowFlowLeft(){this.jinnit();}
JinnLayoutRowFlowLeft.prototype = new JinnLayout();JinnLayoutRowFlowLeft_proto = JinnLayoutRowFlowLeft.prototype;JinnLayoutRowFlowLeft_proto.constructor = JinnLayoutRowFlowLeft;JinnLayoutRowFlowLeft.superjinn = JinnLayout.prototype;JinnLayoutRowFlowLeft_proto.jinnit = function(){JinnLayoutRowFlowLeft.superjinn.jinnit.call( this );}
JinnLayoutRowFlowLeft_proto.performCalibration = function(){if( !this.finalized ){return;}
var itemCount = 0;var maxWidth  = 0;var maxHeight = 0;var lastWidth  = 0;var lastHeight = 0;var availableWidth  = this.getWidth();var availableHeight = this.getHeight();var nextX = availableWidth;var nextY = 0;var content = null;var newContents = new Array();for( var key in this.contents ){content = this.contents[key];if( content.isDestroyed() ){continue;}
newContents[newContents.length] = content;if( !content.isVisible() ){continue;}
content.augment();content.resizeTo( availableWidth, availableHeight );lastWidth  = content.getWidth();lastHeight = content.getHeight();content.moveTo( nextX - lastWidth, nextY );nextX -= lastWidth;availableWidth = this.maxValue( 0, availableWidth - lastWidth );maxWidth  = this.maxValue( maxWidth,  lastWidth );maxHeight = this.maxValue( maxHeight, lastHeight );}
this.contents = newContents;this.itemCount = newContents.length;this.neededContentWidth  = maxWidth;this.neededContentHeight = maxHeight;}
JinnLayoutRowFlowLeft_proto.getOptimalWidth = function(){var max = 0;for( var key in this.contents ){max += this.contents[key].getOptimalWidth();}
return max;}
JinnLayoutRowFlowLeft_proto.getOptimalHeight = function(){var max = 0;for( var key in this.contents ){max = this.maxValue( max, this.contents[key].getOptimalHeight() );}
return max;}
function JinnLayoutWindow(){this.jinnit();}
JinnLayoutWindow.prototype = new JinnLayout();JinnLayoutWindow_proto = JinnLayoutWindow.prototype;JinnLayoutWindow_proto.constructor = JinnLayoutWindow;JinnLayoutWindow.superjinn = JinnLayout.prototype;JinnLayoutWindow_proto.jinnit = function(){JinnLayoutWindow.superjinn.jinnit.call( this );this.ltt = null;this.mtl = null;this.mtm = null;this.mtr = null;this.rtt = null;this.lmt = null;this.rmt = null;this.lmm = null;this.mmm = null;this.rmm = null;this.lmb = null;this.rmb = null;this.lbb = null;this.mbl = null;this.mbm = null;this.mbr = null;this.rbb = null;}
JinnLayoutWindow_proto.postLoadExecute = function( type, id ){JinnLayoutWindow.superjinn.postLoadExecute.call( this, type, id );this.ltt = this.getService( 'layoutRowFlowRight' );this.mtl = this.getService( 'layoutRowFlowRight' );this.mtm = this.getService( 'layoutRowFlowRight' );this.mtr = this.getService( 'layoutRowFlowLeft' );this.rtt = this.getService( 'layoutRowFlowLeft' );this.lmt = this.getService( 'layoutColumnFlowDown' );this.rmt = this.getService( 'layoutColumnFlowDown' );this.lmm = this.getService( 'layoutColumnFlowDown' );this.mmm = this.getService( 'layoutColumnFlowDown' );this.rmm = this.getService( 'layoutColumnFlowDown' );this.lmb = this.getService( 'layoutColumnFlowUp' );this.rmb = this.getService( 'layoutColumnFlowUp' );this.lbb = this.getService( 'layoutRowFlowRight' );this.mbl = this.getService( 'layoutRowFlowRight' );this.mbm = this.getService( 'layoutRowFlowRight' );this.mbr = this.getService( 'layoutRowFlowLeft' );this.rbb = this.getService( 'layoutRowFlowLeft' );this.add( this.ltt );this.add( this.mtl );this.add( this.mtm );this.add( this.mtr );this.add( this.rtt );this.add( this.lmt );this.add( this.rmt );this.add( this.lmm );this.add( this.mmm );this.add( this.rmm );this.add( this.lmb );this.add( this.rmb );this.add( this.lbb );this.add( this.mbl );this.add( this.mbm );this.add( this.mbr );this.add( this.rbb );this.canvas = this.mmm;if( 1 ){var loader = this.getService( 'controlLoader' );var b = '/images/windowSkins/purpleDemo/';var ctlMove1 = this.ltt.add( loader.load(
'control', 7, 25, false, false,
b + 'frameTopLeft.gif' ), true );var ctlInfo = this.mtl.add( loader.load(
'control', 25, 25, false, false,
b + 'buttonInfo.off.gif',
b + 'buttonInfo.on.gif' ), true );var ctlMove2 = this.mtl.add( loader.load(
'control', 20, 25, false, false,
b + 'troughLeft.gif' ), true );var ctlMove3 = this.mtm.add( loader.load(
'control', 1, 25, true, false,
b + 'troughMiddle.gif' ), true );var ctlClose = this.mtr.add( loader.load(
'control', 25, 25, false, false,
b + 'buttonClose.off.gif',
b + 'buttonClose.on.gif' ), true );var ctlMaximize = this.mtr.add( loader.load(
'control', 25, 25, false, false,
b + 'buttonMaximize.off.gif',
b + 'buttonMaximize.on.gif' ), true );var ctlMinimize = this.mtr.add( loader.load(
'control', 25, 25, false, false,
b + 'buttonMinimize.off.gif',
b + 'buttonMinimize.on.gif' ), true );var ctlMove4 = this.mtr.add( loader.load(
'control', 17, 25, false, false,
b + 'troughRight.gif' ), true );var ctlMove5 = this.rtt.add( loader.load(
'control', 7, 25, false, false,
b + 'frameTopRight.gif' ), true );this.lmt.add( loader.load(
'control', 7, 1, false, false,
b + 'frameLeft.gif' ), true );this.rmt.add( loader.load(
'control', 7, 1, false, false,
b + 'frameRight.gif' ), true );this.lmm.add( loader.load(
'control', 7, 1, false, true,
b + 'frameLeft.gif' ), true );var ctlCanvas = this.mmm.add( loader.load(
'control', 1, 1, true, true,
'#ffffff' ), true );this.rmm.add( loader.load(
'control', 7, 1, false, true,
b + 'frameRight.gif' ), true );this.lmb.add( loader.load(
'control', 7, 1, false, false,
b + 'frameLeft.gif' ), true );this.rmb.add( loader.load(
'control', 7, 1, false, false,
b + 'frameRight.gif' ), true );this.lbb.add( loader.load(
'control', 7, 7, false, false,
b + 'frameBottomLeft.gif' ), true );this.mbl.add( loader.load(
'control', 1, 7, false, false,
b + 'frameBottomMiddle.gif' ), true );this.mbm.add( loader.load(
'control', 1, 7, true, false,
b + 'frameBottomMiddle.gif' ), true );this.mbr.add( loader.load(
'control', 1, 7, false, false,
b + 'frameBottomMiddle.gif' ), true );var ctlResize = this.rbb.add( loader.load(
'control', 7, 7, false, false,
b + 'frameBottomRight.off.gif',
b + 'frameBottomRight.on.gif' ), true );ctlMove1.style.cursor = 'move';ctlMove1.enableEventCapture( 'drag' );ctlMove1.listeners.add( 'dragstart', this, this.handleDragStart );ctlMove1.listeners.add( 'dragstop',  this, this.handleDragStop );ctlMove1.listeners.add( 'dragmove',  this, this.handleDragMove );ctlMove2.style.cursor = 'move';ctlMove2.enableEventCapture( 'drag' );ctlMove2.listeners.add( 'dragstart', this, this.handleDragStart );ctlMove2.listeners.add( 'dragstop',  this, this.handleDragStop );ctlMove2.listeners.add( 'dragmove',  this, this.handleDragMove );ctlMove3.style.cursor = 'move';ctlMove3.enableEventCapture( 'drag' );ctlMove3.listeners.add( 'dragstart', this, this.handleDragStart );ctlMove3.listeners.add( 'dragstop',  this, this.handleDragStop );ctlMove3.listeners.add( 'dragmove',  this, this.handleDragMove );ctlMove4.style.cursor = 'move';ctlMove4.enableEventCapture( 'drag' );ctlMove4.listeners.add( 'dragstart', this, this.handleDragStart );ctlMove4.listeners.add( 'dragstop',  this, this.handleDragStop );ctlMove4.listeners.add( 'dragmove',  this, this.handleDragMove );ctlMove5.style.cursor = 'move';ctlMove5.enableEventCapture( 'drag' );ctlMove5.listeners.add( 'dragstart', this, this.handleDragStart );ctlMove5.listeners.add( 'dragstop',  this, this.handleDragStop );ctlMove5.listeners.add( 'dragmove',  this, this.handleDragMove );ctlResize.style.cursor = 'se-resize';ctlResize.enableEventCapture( 'drag' );ctlResize.listeners.add( 'dragstart', this, this.handleDragStart );ctlResize.listeners.add( 'dragstop',  this, this.handleDragStop );ctlResize.listeners.add( 'dragmove',  this, this.handleDragResize );ctlInfo.style.cursor = 'help';ctlMinimize.style.cursor = 'pointer';ctlMaximize.style.cursor = 'pointer';ctlClose.style.cursor = 'pointer';ctlClose.enableEventCapture( 'click' );ctlClose.listeners.add( 'click', this, this.handleClose );this.canvas = ctlCanvas;}
for( var key in this.contents ){this.contents[key].listeners.add( 'layout', this, this.calibrate );this.contents[key].show();}
this.calibrate();}
JinnLayoutWindow_proto.performCalibration = function(){if( !this.finalized ){return;}
var w_ltt = this.ltt.getOptimalWidth();var w_mtl = this.mtl.getOptimalWidth();var w_mtm = 0;var w_mtr = this.mtr.getOptimalWidth();var w_rtt = this.rtt.getOptimalWidth();var w_lmt = this.lmt.getOptimalWidth();var w_rmt = this.rmt.getOptimalWidth();var w_lmm = this.lmm.getOptimalWidth();var w_mmm = 0;var w_rmm = this.rmm.getOptimalWidth();var w_lmb = this.lmb.getOptimalWidth();var w_rmb = this.rmb.getOptimalWidth();var w_lbb = this.lbb.getOptimalWidth();var w_mbl = this.mbl.getOptimalWidth();var w_mbm = 0;var w_mbr = this.mbr.getOptimalWidth();var w_rbb = this.rbb.getOptimalWidth();var h_ltt = this.ltt.getOptimalHeight();var h_mtl = this.mtl.getOptimalHeight();var h_mtm = this.mtm.getOptimalHeight();var h_mtr = this.mtr.getOptimalHeight();var h_rtt = this.rtt.getOptimalHeight();var h_lmt = this.lmt.getOptimalHeight();var h_rmt = this.rmt.getOptimalHeight();var h_lmm = 0;var h_mmm = 0;var h_rmm = 0;var h_lmb = this.lmb.getOptimalHeight();var h_rmb = this.rmb.getOptimalHeight();var h_lbb = this.lbb.getOptimalHeight();var h_mbl = this.mbl.getOptimalHeight();var h_mbm = this.mbm.getOptimalHeight();var h_mbr = this.mbr.getOptimalHeight();var h_rbb = this.rbb.getOptimalHeight();this.augment();var myWidth  = this.element.ijinn.innerWidth;var myHeight = this.element.ijinn.innerHeight;var myBorderWidthLeft   = this.element.ijinn.borderWidthLeft;var myBorderWidthRight  = this.element.ijinn.borderWidthLeft;var myBorderWidthTop    = this.element.ijinn.borderWidthTop;var myBorderWidthBottom = this.element.ijinn.borderWidthTop;var w_l = this.maxValue( w_ltt, w_lmt, w_lmm, w_lmb, w_lbb );var w_r = this.maxValue( w_rtt, w_rmt, w_rmm, w_rmb, w_rbb );var h_t = this.maxValue( h_ltt, h_mtl, h_mtm, h_mtr, h_rtt );var h_b = this.maxValue( h_lbb, h_mbl, h_mbm, h_mbr, h_rbb );this.minWidth  = w_l + w_r;this.minHeight = h_t + h_b;var remWidth  = myWidth;var remHeight = myHeight;if( w_l > remWidth ){w_l = remWidth;remWidth = 0;}
else{remWidth -= w_l;}
if( w_r > remWidth ){w_r = remWidth;remWidth = 0;}
else{remWidth -= w_r;}
w_mmm = remWidth;if( w_mtl > remWidth ){w_mtl = remWidth;remWidth = 0;}
else{remWidth -= w_mtl;}
if( w_mtr > remWidth ){w_mtr = remWidth;remWidth = 0;}
else{remWidth -= w_mtr;}
w_mtm = remWidth;remWidth = w_mmm;if( w_mbl > remWidth ){w_mbl = remWidth;remWidth = 0;}
else{remWidth -= w_mbl;}
if( w_mbr > remWidth ){w_mbr = remWidth;remWidth = 0;}
else{remWidth -= w_mbr;}
w_mbm = remWidth;if( h_t > remHeight ){h_t = remHeight;remHeight = 0;}
else{remHeight -= h_t;}
if( h_b > remHeight ){h_b = remHeight;remHeight = 0;}
else{remHeight -= h_b;}
h_mmm = remHeight;if( h_lmt > remHeight ){h_lmt = remHeight;remHeight = 0;}
else{remHeight -= h_lmt;}
if( h_lmb > remHeight ){h_lmb = remHeight;remHeight = 0;}
else{remHeight -= h_lmb;}
h_lmm = remHeight;remHeight = h_mmm;if( h_rmt > remHeight ){h_rmt = remHeight;remHeight = 0;}
else{remHeight -= h_rmt;}
if( h_rmb > remHeight ){h_rmb = remHeight;remHeight = 0;}
else{remHeight -= h_rmb;}
h_rmm = remHeight;this.ltt.resizeTo( w_l,   h_t );this.mtl.resizeTo( w_mtl, h_mtl );this.mtm.resizeTo( w_mtm, h_mtm );this.mtr.resizeTo( w_mtr, h_mtr );this.rtt.resizeTo( w_r,   h_t );this.lmt.resizeTo( w_l,   h_lmt );this.rmt.resizeTo( w_r,   h_rmt );this.lmm.resizeTo( w_l,   h_lmm );this.mmm.resizeTo( w_mmm, h_mmm );this.rmm.resizeTo( w_r,   h_rmm );this.lmb.resizeTo( w_l,   h_lmb );this.rmb.resizeTo( w_r,   h_rmb );this.lbb.resizeTo( w_l,   h_b );this.mbl.resizeTo( w_mbl, h_mbl );this.mbm.resizeTo( w_mbm, h_mbm );this.mbr.resizeTo( w_mbr, h_mbr );this.rbb.resizeTo( w_r,   h_b );var xOffset = 0;var yOffset = 0;var compat = this.getService( 'browserCompatibility' );if( compat.w3cBoxModel ){xOffset = myBorderWidthLeft;yOffset = myBorderWidthTop;this.minWidth  += myBorderWidthLeft + myBorderWidthRight;this.minHeight += myBorderWidthTop + myBorderWidthBottom;w_l += xOffset;h_t += yOffset;}
this.ltt.moveTo( xOffset, yOffset);this.mtl.moveTo( w_l, yOffset);this.mtm.moveTo( w_l + w_mtl, yOffset);this.mtr.moveTo( w_l + w_mtl + w_mtm, yOffset);this.rtt.moveTo( w_l + w_mmm, yOffset);this.lmt.moveTo( xOffset, h_t );this.rmt.moveTo( w_l + w_mmm, h_t );this.lmm.moveTo( xOffset, h_t + h_lmt );this.mmm.moveTo( w_l, h_t );this.rmm.moveTo( w_l + w_mmm, h_t + h_rmt );this.lmb.moveTo( xOffset, h_t + h_lmt + h_lmm );this.rmb.moveTo( w_l + w_mmm, h_t + h_rmt + h_rmm );this.lbb.moveTo( xOffset, h_t + h_mmm );this.mbl.moveTo( w_l, h_t + h_mmm );this.mbm.moveTo( w_l + w_mbl, h_t + h_mmm );this.mbr.moveTo( w_l + w_mbl + w_mbm, h_t + h_mmm );this.rbb.moveTo( w_l + w_mmm, h_t + h_mmm );}
JinnLayoutWindow_proto.getOptimalWidth = function(){var ltt = this.ltt.getOptimalWidth();var mtl = this.mtl.getOptimalWidth();var mtm = 0;var mtr = this.mtr.getOptimalWidth();var rtt = this.rtt.getOptimalWidth();var lmt = this.lmt.getOptimalWidth();var rmt = this.rmt.getOptimalWidth();var lmm = this.lmm.getOptimalWidth();var mmm = 0;var rmm = this.rmm.getOptimalWidth();var lmb = this.lmb.getOptimalWidth();var rmb = this.rmb.getOptimalWidth();var lbb = this.lbb.getOptimalWidth();var mbl = this.mbl.getOptimalWidth();var mbm = 0;var mbr = this.mbr.getOptimalWidth();var rbb = this.rbb.getOptimalWidth();this.augment();var borderWidth =
this.element.ijinn.width - this.element.ijinn.innerWidth;return
this.maxValue( ltt, lmt, lmm, lmb, lbb )
+ this.maxValue( mtl + mtm + mtr, mmm, mbl + mbm + mbr )
+ this.maxValue( rtt, rmt, rmm, rmb, rbb )
+ borderWidth;}
JinnLayoutWindow_proto.getOptimalHeight = function(){var ltt = this.ltt.getOptimalHeight();var mtl = this.mtl.getOptimalHeight();var mtm = this.mtm.getOptimalHeight();var mtr = this.mtr.getOptimalHeight();var rtt = this.rtt.getOptimalHeight();var lmt = this.lmt.getOptimalHeight();var rmt = this.rmt.getOptimalHeight();var lmm = 0;var mmm = 0;var rmm = 0;var lmb = this.lmb.getOptimalHeight();var rmb = this.rmb.getOptimalHeight();var lbb = this.lbb.getOptimalHeight();var mbl = this.mbl.getOptimalHeight();var mbm = this.mbm.getOptimalHeight();var mbr = this.mbr.getOptimalHeight();var rbb = this.rbb.getOptimalHeight();this.augment();var borderHeight =
this.element.ijinn.height - this.element.ijinn.innerHeight;return
this.maxValue( ltt, mtl, mtm, mtr, rtt )
+ this.maxValue( lmt + lmm + lmb, mmm, rmt + rmm + rmb )
+ this.maxValue( lbb, mbl, mbm, mbr, rbb )
+ borderHeight;}
JinnLayoutWindow_proto.handleRaiseToTop = function(){this.setZIndex( this.getZIndexMax() + 1 );}
JinnLayoutWindow_proto.destructor = function(){this.element.parentNode.removeChild( this.element );this.ltt.listeners.remove( 'layout', this, this.calibrate );this.mtl.listeners.remove( 'layout', this, this.calibrate );this.mtm.listeners.remove( 'layout', this, this.calibrate );this.mtr.listeners.remove( 'layout', this, this.calibrate );this.rtt.listeners.remove( 'layout', this, this.calibrate );this.lmt.listeners.remove( 'layout', this, this.calibrate );this.rmt.listeners.remove( 'layout', this, this.calibrate );this.lmm.listeners.remove( 'layout', this, this.calibrate );this.mmm.listeners.remove( 'layout', this, this.calibrate );this.rmm.listeners.remove( 'layout', this, this.calibrate );this.lmb.listeners.remove( 'layout', this, this.calibrate );this.rmb.listeners.remove( 'layout', this, this.calibrate );this.lbb.listeners.remove( 'layout', this, this.calibrate );this.mbl.listeners.remove( 'layout', this, this.calibrate );this.mbm.listeners.remove( 'layout', this, this.calibrate );this.mbr.listeners.remove( 'layout', this, this.calibrate );this.rbb.listeners.remove( 'layout', this, this.calibrate );this.ltt.destroy();this.mtl.destroy();this.mtm.destroy();this.mtr.destroy();this.rtt.destroy();this.lmt.destroy();this.rmt.destroy();this.lmm.destroy();this.mmm.destroy();this.rmm.destroy();this.lmb.destroy();this.rmb.destroy();this.lbb.destroy();this.mbl.destroy();this.mbm.destroy();this.mbr.destroy();this.rbb.destroy();}
JinnLayoutWindow_proto.resizeBy = function( width, height ){if( !this.finalized ){return;}
if( width != 0 || height != 0 ){JinnLayoutWindow.superjinn.resizeBy.call( this, width, height );this.calibrate();}
this.resizeBy = JinnLayoutWindow.superjinn.resizeBy;}
JinnLayoutWindow_proto.moveBy = function( x, y ){if( !this.finalized ){return;}
if( x != 0 || y != 0 ){JinnLayoutWindow.superjinn.moveBy.call( this, x, y );}
this.moveBy = JinnLayoutWindow.superjinn.moveBy;}
JinnLayoutWindow_proto.write = function( content ){this.canvas.element.innerHTML += content;}
JinnLayoutWindow_proto.writeln = function( content ){this.write( content + '<br />' );}
JinnLayoutWindow_proto.clear = function(){this.canvas.element.innerHTML = '';}
JinnLayoutWindow_proto.openUrl = function( url ){this.clear();this.write('<iframe'
+ ' src="' + url + '"'
+ ' width="100%"'
+ ' height="100%"'
+ ' frameborder="0"'
+ ' />'
);}
function JinnControl(){this.jinnit();}
JinnControl.prototype = new JinnElement();JinnControl_proto = JinnControl.prototype;JinnControl_proto.constructor = JinnControl;JinnControl.superjinn = JinnElement.prototype;JinnControl_proto.jinnit = function(){JinnControl.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.finalized = false;this.bgNormal = null;this.bgHover  = null;this.dragSignal = 'dragmove';this.registerCallbacks();}
JinnControl_proto.postLoadExecute = function(){eval('JinnControl.superjinn.postLoadExecute.call( '
+ 'this' + this.getArgsPunter( arguments, 0, true ) + ' );'
);this.style.overflow  = 'hidden';this.setBorderWidth( '0' );this.setWidth( 15 );this.setHeight( 15 );this.setWidth( 15 );this.setHeight( 15 );this.isDraggable = true;this.element.onmousedown    = null;this.element.onmouseup      = null;this.element.onmousemove    = null;this.element.onmouseover    = null;this.element.onmouseout     = null;this.element.onclick        = this.signalRaiseToTop;this.element.ondblclick     = null;}
JinnControl_proto.registerCallbacks = function(){var myself = this;var signalRaiseToTop = this.signalRaiseToTop;this.signalRaiseToTop = function( event ){signalRaiseToTop.call( myself, event );}
var captureMouseDown = this.captureMouseDown;this.captureMouseDown = function( event ){captureMouseDown.call( myself, event );}
var captureMouseUp = this.captureMouseUp;this.captureMouseUp = function( event ){captureMouseUp.call( myself, event );}
var captureMouseMove = this.captureMouseMove;this.captureMouseMove = function( event ){captureMouseMove.call( myself, event );}
var captureMouseOver = this.captureMouseOver;this.captureMouseOver = function( event ){captureMouseOver.call( myself, event );}
var captureMouseOut = this.captureMouseOut;this.captureMouseOut = function( event ){captureMouseOut.call( myself, event );}
var captureClick = this.captureClick;this.captureClick = function( event ){captureClick.call( myself, event );}
var captureDoubleClick = this.captureDoubleClick;this.captureDoubleClick = function( event ){captureDoubleClick.call( myself, event );}
var captureDragStart = this.captureDragStart;this.captureDragStart = function( event ){captureDragStart.call( myself, event );}
var captureDragStop = this.captureDragStop;this.captureDragStop = function( event ){captureDragStop.call( myself, event );}
var captureDragMove = this.captureDragMove;this.captureDragMove = function( event ){captureDragMove.call( myself, event );}
var highlight = this.highlight;this.highlight = function( event, extra ){highlight.call( myself, event, extra );}
var autoScroll = this.autoScroll;this.autoScroll = function( event, extra ){autoScroll.call( myself, event, extra );}}
JinnControl_proto.highlight = function( event ){if( this.bgHover !== null ){this.setBackground( this.bgHover );}}
JinnControl_proto.unhighlight = function( event ){if( this.bgNormal !== null ){this.setBackground( this.bgNormal );}
else{this.setBackground( 'transparent' );}}
JinnControl_proto.signalRaiseToTop = function( event ){this.listeners.signalWithEvent( 'raisetotop', this, event );}
JinnControl_proto.captureMouseDown = function( event ){this.listeners.signalWithEvent( 'mousedown', this, event );}
JinnControl_proto.captureMouseUp = function( event ){this.listeners.signalWithEvent( 'mouseup', this, event );}
JinnControl_proto.captureMouseMove = function( event ){this.listeners.signalWithEvent( 'mousemove', this, event );}
JinnControl_proto.captureMouseOver = function( event ){this.listeners.signalWithEvent( 'mouseover', this, event );}
JinnControl_proto.captureMouseOut = function( event ){this.listeners.signalWithEvent( 'mouseout', this, event );}
JinnControl_proto.captureClick = function( event ){this.listeners.signalWithEvent( 'raisetotop', this, event );this.listeners.signalWithEvent( 'click', this, event );}
JinnControl_proto.captureDoubleClick = function( event ){this.listeners.signalWithEvent( 'dblclick', this, event );}
JinnControl_proto.captureDragStart = function( event ){if( !event ){event = this.getWindow().event;}
event.cancelBubble = true;if( this.captureDragStartEvent ){return false;}
var tEvent = this.shallowCopy( event );this.augmentEvent( tEvent );tEvent.ijinn_lastMouseDocumentX   = tEvent.ijinn_mouseDocumentX;tEvent.ijinn_lastMouseDocumentY   = tEvent.ijinn_mouseDocumentY;var doc  = this.getDocument();var body = this.getDocumentBody();tEvent.ijinn_oldElement_onmousemove = this.element.onmousemove;tEvent.ijinn_oldDoc_onmousedown     = doc.onmousedown;tEvent.ijinn_oldDoc_onmouseup       = doc.onmouseup;tEvent.ijinn_oldDoc_onmousemove     = doc.onmousemove;tEvent.ijinn_oldBody_onselectstart  = body.onselectstart;this.element.onmousemove = this.captureDragMove;doc.onmousedown = this.captureDragStart;doc.onmouseup   = this.captureDragStop;doc.onmousemove = this.captureDragMove;this.captureDragStartEvent = tEvent;this.listeners.signalWithEvent('dragstart', this, tEvent
);return false;}
JinnControl_proto.captureDragStop = function( event ){if( !event ){event = this.getWindow().event;}
event.cancelBubble = true;var dragStartEvent = this.captureDragStartEvent;this.captureDragStartEvent = null;this.captureDragMoveEvent  = null;if( dragStartEvent == null ){return false;}
var tEvent = this.shallowCopy( event );this.augmentEvent( tEvent );tEvent.ijinn_eventDragStart = dragStartEvent;var doc  = this.getDocument();var body = this.getDocumentBody();this.element.onmousemove    = dragStartEvent.ijinn_oldElement_onmousemove;doc.onmousedown             = dragStartEvent.ijinn_oldDoc_onmousedown;doc.onmouseup               = dragStartEvent.ijinn_oldDoc_onmouseup;doc.onmousemove             = dragStartEvent.ijinn_oldDoc_onmousemove;this.listeners.signalWithEvent('dragstop', this, tEvent
);dragStartEvent.ijinn_lastMouseDocumentX = 0;dragStartEvent.ijinn_lastMouseDocumentY = 0;this.destroy( dragStartEvent );return false;}
JinnControl_proto.captureDragMove = function( event ){if( !event ){event = this.getWindow().event;}
event.cancelBubble = true;if( this.captureDragStartEvent == null ){return false;}
var tEvent = this.shallowCopy( event );this.augmentEvent( tEvent );tEvent.ijinn_eventDragStart = this.captureDragStartEvent;this.captureDragMoveEvent = tEvent;tEvent.ijinn_mouseMovedX =
tEvent.ijinn_mouseDocumentX
- this.captureDragStartEvent.ijinn_lastMouseDocumentX;tEvent.ijinn_mouseMovedY =
tEvent.ijinn_mouseDocumentY
- this.captureDragStartEvent.ijinn_lastMouseDocumentY;var mouseX = tEvent.ijinn_mouseDocumentX;var mouseY = tEvent.ijinn_mouseDocumentY;this.deselectText( tEvent );this.listeners.signalWithEvent(this.dragSignal, this, tEvent
);this.captureDragStartEvent.ijinn_lastMouseDocumentX = mouseX;this.captureDragStartEvent.ijinn_lastMouseDocumentY = mouseY;return false;}
JinnControl_proto.setEventCaptureStatus = function( type, status ){var e = this.trim( type.toLowerCase() );if( e == 'all' || e == 'mousedown' ){if( status ){this.element.onmousedown = this.captureMouseDown;}
else
if( this.element.onmousedown == this.captureMouseDown ){this.element.onmousedown = null;}}
if( e == 'all' || e == 'mouseup' ){if( status ){this.element.onmouseup = this.captureMouseUp;}
else{this.element.onmouseup = null;}}
if( e == 'all' || e == 'mousemove' ){if( status ){this.element.onmousemove = this.captureMouseMove;}
else{this.element.onmousemove = null;}}
if( e == 'all' || e == 'mouseover' ){if( status ){this.element.onmouseover = this.captureMouseOver;}
else{this.element.onmouseover = null;}}
if( e == 'all' || e == 'mouseout' ){if( status ){this.element.onmouseout = this.captureMouseOut;}
else{this.element.onmouseout = null;}}
if( e == 'all' || e == 'click' ){if( status ){this.element.onclick = this.captureClick;}
else{this.element.onclick = null;}}
if( e == 'all' || e == 'dblclick' ){if( status ){this.element.ondblclick = this.captureDoubleClick;}
else{this.element.ondblclick = null;}}
if( e == 'all' || e == 'drag' ){if( status ){this.element.onmousedown = this.captureDragStart;}
else
if( this.element.onmousedown == this.captureDragStart ){this.element.onmousedown = null;}}}
JinnControl_proto.enableEventCapture = function( eventTypes ){var eventTypes = eventTypes.toLowerCase();var events = eventTypes.split( ',' );for( var index in events ){this.setEventCaptureStatus( events[index], true );}}
JinnControl_proto.disableEventCapture = function( eventTypes ){var eventTypes = eventTypes.toLowerCase();var events = eventTypes.split( ',' );for( var index in events ){this.setEventCaptureStatus( events[index], false );}}
JinnControl_proto.setDragSignalType = function( type ){this.dragSignal = type.toLowerCase();}
JinnControl_proto.resizeBy = function( width, height ){if( !this.finalized ){}
if( width != 0 || height != 0 ){JinnControl.superjinn.resizeBy.call( this, width, height );}
this.resizeBy = JinnControl.superjinn.resizeBy;}
JinnControl_proto.moveBy = function( x, y ){if( !this.finalized ){}
if( x != 0 || y != 0 ){JinnControl.superjinn.moveBy.call( this, x, y );}
this.moveBy = JinnControl.superjinn.moveBy;}
JinnControl_proto.finalize = function( x, y, width, height ){this.finalized = true;}
function JinnControlLoader(){this.jinnit();}
JinnControlLoader.prototype = new JinnBaseClass();JinnControlLoader_proto = JinnControlLoader.prototype;JinnControlLoader_proto.constructor = JinnControlLoader;JinnControlLoader.superjinn = JinnBaseClass.prototype;JinnControlLoader_proto.jinnit = function(){JinnControlLoader.superjinn.jinnit.call( this );this.allowMultipleInstances = false;}
JinnControlLoader_proto.load = function
( type, width, height, stretchWidth, stretchHeight, bg, bgHover ){var control = this.getService( type );control.minWidth  = this.defaultValue( width, 0 );control.minHeight = this.defaultValue( height, 0 );stretchWidth = this.defaultValue( stretchWidth, false );if( !stretchWidth ){control.maxWidth = width;}
stretchHeight = this.defaultValue( stretchHeight, false );if( !stretchHeight ){control.maxHeight = height;}
control.resizeTo( control.minWidth, control.minHeight );bg = this.defaultValue( bg, null );if( bg !== null ){control.setBackground( bg );control.bgNormal = control.getBackground();}
bgHover = this.defaultValue( bgHover, null );if( bgHover !== null ){var bgOriginal = control.getBackground();control.setBackground( bgHover );control.bgHover = control.getBackground();control.setBackground( bgOriginal );control.element.onmouseover =
this.objectHandler( control, control.highlight );control.element.onmouseout =
this.objectHandler( control, control.unhighlight );}
return control;}
var gJinnSubPaneList = new Array();function JinnSubPane(){this.jinnit();}
JinnSubPane.prototype = new JinnBaseClass();JinnSubPane_proto = JinnSubPane.prototype;JinnSubPane_proto.constructor = JinnSubPane;JinnSubPane.superjinn = JinnBaseClass.prototype;JinnSubPane_proto.jinnit = function(){JinnSubPane.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.registerCallbacks();this.master = null;this.listeners = this.getService( 'listenerManager' );this.dragOpacity            = .4;this.isDraggable            = false;this.captureDragStartEvent  = null;this.template               = null;this.clipId                 = 'id' + this.getUniqueId();this.clip                   = null;this.paneFrameId            = 'id' + this.getUniqueId();this.paneFrame              = null;this.paneId                 = 'id' + this.getUniqueId();this.pane                   = null;this.canvasFrameId          = 'id' + this.getUniqueId();this.canvasFrame            = null;this.canvasId               = 'id' + this.getUniqueId();this.canvas                 = null;this.frame                  = null;     // this.clip
this.style                  = null;     // this.canvas.style
}
JinnSubPane_proto.postLoadExecute = function( template ){var tStyle =
'overflow: visible; '
+ '-moz-box-sizing: border-box; '
+ 'box-sizing: border-box; '
+ 'margin: 0px; '
+ 'padding: 0px; '
+ 'border-style: solid; '
+ 'border-width: 0px; ';if( this.isset( template ) ){this.template = template;}
else
if( this.template == null ){this.template =
'<div id="[[PANE_FRAME_ID]]" style="' + tStyle + '">'
+ '<div id="[[PANE_ID]]" style="' + tStyle + '">'
+ '<div id="[[CANVAS_FRAME_ID]]" style="' + tStyle + '">'
+ '<div id="[[CANVAS_ID]]" style="' + tStyle + '">'
+ '</div>'
+ '</div>'
+ '</div>'
+ '</div>';}
var body = this.getDocumentBody();if( body ){var tSpan  = this.getDocument().createElement( 'span' );var tTemplate = this.template;tTemplate =
tTemplate.replace( /\[\[PANE_FRAME_ID\]\]/, this.paneFrameId );tTemplate =
tTemplate.replace( /\[\[PANE_ID\]\]/, this.paneId );tTemplate =
tTemplate.replace( /\[\[CANVAS_FRAME_ID\]\]/, this.canvasFrameId );tTemplate =
tTemplate.replace( /\[\[CANVAS_ID\]\]/, this.canvasId );tSpan.innerHTML =
'<div id="' + this.clipId   + '" style="' + tStyle + '">'
+ tTemplate
+ '</div>';this.clip = this.getService( 'element', tSpan.childNodes[0] );this.clip.style.zIndex       = 1;this.clip.style.position     = 'absolute';this.clip.style.overflow     = 'visible';this.clip.style.visibility   = 'hidden';this.clip.style.left         = '0px';this.clip.style.top          = '0px';this.clip.style.width        = '0px';this.clip.style.height       = '0px';body.appendChild( this.clip.element );var tElement = null;if( (tElement = this.getElement( this.paneFrameId )) ){this.paneFrame = this.getService( 'element', tElement );}
else{this.paneFrame = this.clip;}
if( (tElement = this.getElement( this.paneId )) ){this.pane = this.getService( 'element', tElement );}
else{this.pane = this.paneFrame;}
if( (tElement = this.getElement( this.canvasFrameId )) ){this.canvasFrame = this.getService( 'element', tElement );}
else{this.canvasFrame = this.pane;}
if( (tElement = this.getElement( this.canvasId )) ){this.canvas = this.getService( 'element', tElement );}
else{this.canvas = this.canvasFrame;}
this.frame = this.clip;this.style = this.canvas.style;this.clip.listeners = this.listeners;this.clip.listeners.add( 'dragstart', this, this.handleDragStart );this.clip.listeners.add( 'dragstop', this, this.handleDragStop );}}
JinnSubPane_proto.registerCallbacks = function(){}
JinnSubPane_proto.handleDragStart = function( event ){}
JinnSubPane_proto.handleDragStop = function( event ){}
JinnSubPane_proto.handleDragMove = function( event ){this.moveBy( event.ijinn_mouseMovedX, event.ijinn_mouseMovedY );}
JinnSubPane_proto.handleDragResize = function( event ){this.resizeBy( event.ijinn_mouseMovedX, event.ijinn_mouseMovedY );}
JinnSubPane_proto.fill = function(){this.clip.style.overflow = 'hidden';this.paneFrame.style.width    = '100%';this.paneFrame.style.height   = '100%';this.pane.style.width  = '100%';this.pane.style.height = '100%';this.canvasFrame.style.width  = '100%';this.canvasFrame.style.height = '100%';this.canvas.style.width    = '100%';this.canvas.style.height   = '100%';}
JinnSubPane_proto.setContent = function( content ){this.canvas.setContent( content );}
JinnSubPane_proto.setDraggable = function( status ){return this.clip.setDraggable( status );}
JinnSubPane_proto.setDragOpacity = function( opacity ){this.dragOpacity = opacity;}
JinnSubPane_proto.hide = function(){this.clip.hide();}
JinnSubPane_proto.show = function(){if( this.isDestroyed() ){return;}
this.clip.show();}
JinnSubPane_proto.toggleVisibility = function(){this.clip.toggleVisibility();}
JinnSubPane_proto.getWidth = function(){return this.clip.getWidth();}
JinnSubPane_proto.getHeight = function(){return this.clip.getHeight();}
JinnSubPane_proto.setWidth = function( width ){return this.clip.setWidth( width );}
JinnSubPane_proto.setHeight = function( height ){return this.clip.setHeight( height );}
JinnSubPane_proto.resizeWidthBy = function( width ){return this.clip.resizeWidthBy( width );}
JinnSubPane_proto.resizeHeightBy = function( height ){this.clip.resizeHeightBy( height );}
JinnSubPane_proto.resizeTo = function( width, height ){this.clip.resizeTo( width, height );}
JinnSubPane_proto.resizeBy = function( width, height ){this.clip.resizeBy( width, height );}
JinnSubPane_proto.getX = function(){return this.clip.getX();}
JinnSubPane_proto.getY = function(){return this.clip.getY();}
JinnSubPane_proto.setX = function( x ){this.clip.setX( x );}
JinnSubPane_proto.setY = function( y ){this.clip.setY( y );}
JinnSubPane_proto.moveXBy = function( x ){this.clip.moveXBy( x );}
JinnSubPane_proto.moveYBy = function( y ){this.clip.moveYBy( y );}
JinnSubPane_proto.moveTo = function( x, y ){this.clip.moveTo( x, y );}
JinnSubPane_proto.moveBy = function( x, y ){this.clip.moveBy( x, y );}
JinnSubPane_proto.setOpacity = function( element, opacity ){var tElement = null;var tOpacity = 1.0;if( !this.isset( opacity ) ){tElement = this.canvasFrame.element;tOpacity = element;}
else{tElement = element;tOpacity = opacity;}
tElement.ijinn_opacity = tOpacity;var compat = this.getService( 'browserCompatibility' );compat.setElementOpacity( this, tElement, tOpacity );}
JinnSubPane_proto.close = function(){if( this.captureDragStartEvent != null ){return false;}
var tEvent = new Object();tEvent['returnValue'] = true;this.listeners.signalWithEvent( 'close', this, tEvent );if( tEvent['returnValue'] ){this.destroy();return true;}
return false;}
JinnSubPane_proto.destructor = function(){this.hide();this.listeners.signal( 'destroy', this );this.listeners.destroy();}
var gJinnSubWindowList = new Array();function JinnSubWindow(){this.jinnit();}
JinnSubWindow.prototype = new JinnElement();JinnSubWindow_proto = JinnSubWindow.prototype;JinnSubWindow_proto.constructor = JinnSubWindow;JinnSubWindow.superjinn = JinnElement.prototype;JinnSubWindow_proto.jinnit = function(){JinnSubWindow.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.registerCallbacks();this.listeners          = null;this.clipperId          = 'id' + this.getUniqueId();this.clipper            = null;this.canvasId           = 'id' + this.getUniqueId();this.canvas             = null;this.element            = null;this.style              = null;this.skin = new Array();this.skin['location'] = null;this.skin['frameTopLeft']           = ',,,,,';this.skin['frameTopMiddle']         = ',,,,,';this.skin['frameTopRight']          = ',,,,,';this.skin['frameLeft']              = ',,,,,';this.skin['frameRight']             = ',,,,,';this.skin['frameBottomLeft']        = ',,,,,';this.skin['frameBottomMiddle']      = ',,,,,';this.skin['frameBottomRight']       = ',,,,,';this.skin['troughLeft']             = ',,,,,';this.skin['troughMiddle']           = ',,,,,';this.skin['troughRight']            = ',,,,,';this.skin['buttonInfo']             = ',,,,,';this.skin['buttonMinimize']         = ',,,,,';this.skin['buttonMaximize']         = ',,,,,';this.skin['buttonClose']            = ',,,,,';this.skin['frameTopLeft']           = '7,25,0,0,frameTopLeft.gif,';this.skin['frameTopMiddle']         = '1,25,7,0,frameTopMiddle.gif,';this.skin['frameTopRight']          = ',,,,frameTopRight.gif,';this.skin['frameLeft']              = ',,,,frameLeft.gif,';this.skin['frameRight']             = ',,,,frameRight.gif,';this.skin['frameBottomLeft']        = ',,,,frameBottomLeft.gif,';this.skin['frameBottomMiddle']      = ',,,,frameBottomMiddle.gif,';this.skin['frameBottomRight']       = ',,,,frameBottomRight.off.gif,frameBottomRight.on.gif';this.skin['troughLeft']             = ',,,,troughLeft.gif,';this.skin['troughMiddle']           = ',,,,troughMiddle.gif,';this.skin['troughRight']            = ',,,,troughRight.gif,';this.skin['buttonInfo']             = ',,,,buttonInfo.off.gif,buttonInfo.on.gif,';this.skin['buttonMinimize']         = ',,,,buttonMinimize.off.gif,buttonMinimize.on.gif';this.skin['buttonMaximize']         = ',,,,buttonMaximize.off.gif,buttonMaximize.on.gif';this.skin['buttonClose']            = ',,,,buttonClose.off.gif,buttonClose.on.gif';}
JinnSubWindow_proto.applySkin = function(){var _width  = 0;var _height = 1;var _x      = 2;var _y      = 3;var _image1 = 4;var _image2 = 5;var baseDir = this.skin['location'];var skin = new Array();for( var key in this.skin ){if( key == 'location' ){continue;}
var bits = this.skin[key].split( ',' );var config = new Array();config[_width]  = this.defaultValue( bits[0], 0 );config[_height] = this.defaultValue( bits[1], 0 );config[_x]      = this.defaultValue( bits[2], 0 );config[_y]      = this.defaultValue( bits[3], 0 );config[_image1] = this.defaultValue( bits[4], null );config[_image2] = this.defaultValue( bits[5], null );if( config[_image1] !== null ){config[_image1] = baseDir + config[_image1];}
if( config[_image2] !== null ){config[_image2] = baseDir + config[_image2];}
skin[key] = config;}
var topThickness = this.maxValue(skin['frameTopLeft'][_height],
skin['frameTopMiddle'][_height],
skin['frameTopRight'][_height],
skin['troughLeft'][_height],
skin['troughMiddle'][_height],
skin['troughRight'][_height],
skin['buttonInfo'][_height],
skin['buttonMinimize'][_height],
skin['buttonMaximize'][_height],
skin['buttonClose'][_height]
);var leftThickness = this.maxValue(skin['frameTopLeft'][_height],
skin['frameLeft'][_height]
);var rightThickness = this.maxValue(skin['frameTopRight'][_height],
skin['frameRight'][_height]
);var bottomThickness = this.maxValue(skin['frameBottomLeft'][_height],
skin['frameBottomMiddle'][_height],
skin['frameBottomRight'][_height]
);var hThicknessOld = this.clipper.getWidth() - this.canvas.getWidth();var hThicknessNew = leftThickness + rightThickness;var vThicknessOld = this.clipper.getHeight() - this.canvas.getHeight();var vThicknessNew = topThickness + bottomThickness;this.resizeBy(hThicknessNew - hThicknessOld,
vThicknessNew - vThicknessOld
);this.canvas.resizeBy(hThicknessOld - hThicknessNew,
vThicknessOld - vThicknessNew
);this.canvas.moveTo( leftThickness, topThickness );var doc = this.getDocument();for( var key in skin ){var item = skin[key];var div = doc.createElement( 'div' );this.clipper.appendChild( element );var control = this.getService( 'control', div );control.style.position = 'relative';control.resizeTo( item[_width], item[_height] );control.moveTo( item[_x], item[_y] );if( item[_image1] !== null ){control.style.background = 'url( ' + item[_image1] + ')';}
if( item[_image2] !== null ){control.highlightImage = 'url( ' + item[_image1] + ')';control.onmouseover = control.highlight;control.onmouseout  = control.unhighlight;}}}
JinnSubWindow_proto.postProcess = function(){}
JinnSubWindow_proto.postLoadExecute = function( skin ){this.listeners = this.getService( 'listenerManager' );var body = this.getDocumentBody();if( body ){var tClipper = this.getDocument().createElement( 'div' );tClipper.id  = this.clipperId;var tCanvas  = this.getDocument().createElement( 'div' );tCanvas.id   = this.canvasId;this.clipper = this.getService( 'element', tClipper );this.clipper.setZIndex( this.clipper.getZIndexMax() + 1 );this.clipper.style.position     = 'absolute';this.clipper.style.overflow     = 'hidden';this.clipper.style.visibility   = 'hidden';this.clipper.style.margin       = '0px';this.clipper.style.padding      = '0px';this.canvas = this.getService( 'element', tCanvas );this.canvas.style.position     = 'relative';this.canvas.style.overflow     = 'auto';this.canvas.style.margin       = '0px';this.canvas.style.padding      = '0px';body.appendChild( tClipper );tClipper.appendChild( tCanvas );this.element = this.clipper;this.style   = this.clipper.style;this.setBorderWidth( 0 );this.resizeTo( 200, 200 );this.moveTo( 5, 5 );this.moveTo( 5, 5 );this.clipper.listeners = this.listeners;this.clipper.listeners.add(
'resizeby', this.canvas, this.canvas.handleResizeBy );this.skin = this.defaultValue( skin, this.skin );this.applySkin();this.postProcess();}}
JinnSubWindow_proto.registerCallbacks = function(){var JinnSubWindow_proto = this;var myself = this;var captureDragStart = JinnElement.prototype.captureDragStart;this.captureDragStart = function( event ){captureDragStart.call( myself, event );}
var captureDragStop = JinnElement.prototype.captureDragStop;this.captureDragStop = function( event ){captureDragStop.call( myself, event );}
var captureDragMove = JinnElement.prototype.captureDragMove;this.captureDragMove = function( event ){captureDragMove.call( myself, event );}
var autoScroll = JinnElement.prototype.autoScroll;this.autoScroll = function( event, extra ){autoScroll.call( myself, event, extra );}}
JinnSubWindow_proto.handleDragStart = function( event ){this.setZIndex( 1000000000 );var opacityElement = this.canvas;event.ijinn_opacityElement = opacityElement;event.ijinn_opacity = this.getOpacity( opacityElement );this.setOpacity( opacityElement, this.dragOpacity );}
JinnSubWindow_proto.handleDragStop = function( event ){this.setOpacity(event.ijinn_eventDragStart.ijinn_opacityElement,
event.ijinn_eventDragStart.ijinn_opacity
);this.setZIndex( this.getZIndexMax() + 1 );}
JinnSubWindow_proto.handleDragMove = function( event ){this.moveBy( event.ijinn_mouseMovedX, event.ijinn_mouseMovedY );}
JinnSubWindow_proto.handleDragResize = function( event ){this.resizeBy( event.ijinn_mouseMovedX, event.ijinn_mouseMovedY );}
JinnSubWindow_proto.setContent = function( content ){this.canvas.setContent( content );}
JinnSubWindow_proto.setResizable = function( status ){this.clipper.setDragAction( 'resize' );this.clipper.setDraggable( status );}
JinnSubWindow_proto.setOpacity = function( element, opacity ){var tElement = null;var tOpacity = 1.0;if( !this.isset( opacity ) ){tElement = this.canvas.element;tOpacity = element;}
else{tElement = element;tOpacity = opacity;}
tElement.ijinn_opacity = tOpacity;var compat = this.getService( 'browserCompatibility' );compat.setElementOpacity( this, tElement, tOpacity );}
JinnSubWindow_proto.getOpacity = function( element ){var tElement = null;if( !this.isset( element ) ){tElement = this.canvas.element;}
else{tElement = element;}
var compat = this.getService( 'browserCompatibility' );return compat.getElementOpacity( this, tElement );}
JinnSubWindow_proto.close = function(){if( this.clipper.captureDragStartEvent != null ){return false;}
var tEvent = new Object();tEvent['returnValue'] = true;this.listeners.signalWithEvent( 'close', this, tEvent );if( tEvent['returnValue'] ){this.destroy();return true;}
return false;}
JinnSubWindow_proto.destructor = function(){this.hide();this.listeners.signal( 'destroy', this );this.listeners.destroy();}
function JinnConsole(){this.jinnit();}
JinnConsole.prototype = new JinnBaseClass();JinnConsole_proto = JinnConsole.prototype;JinnConsole_proto.constructor = JinnConsole;JinnConsole.superjinn = JinnBaseClass.prototype;gJinnConsole_lookupHash = new Array();JinnConsole_proto.jinnit = function(){JinnConsole.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.name = null;this.listeners = this.getService( 'listenerManager' );this.inputElement = null;this.outputElement = null;this.maxEntries = 1000;this.content = new Array();}
JinnConsole_proto.postLoadExecute = function( name, input, output ){this.name = name;this.setInputElement( input );this.setOutputElement( output );if( name && !gJinnConsole_lookupHash[name] ){gJinnConsole_lookupHash[name] = this;}}
JinnConsole_proto.setInputElement = function( input ){this.inputElement = null;var input = this.defaultValue( input );if( input !== null ){if( this.getDataType( input ) == 'object' ){input = ijinn_getService( 'element', input );}
else{input = ijinn_getService( 'element', 'id', input );}
if( input && input.element ){var obj = this;var onSubmit = function( event ){obj.handleInput( event );return false;}
input.element.onsubmit = onSubmit;this.inputElement = input;return true;}}
return false;}
JinnConsole_proto.setOutputElement = function( output ){this.outputElement = null;var output = this.defaultValue( output );if( output !== null ){if( this.getDataType( output ) == 'object' ){output = ijinn_getService( 'element', output );}
else{output = ijinn_getService( 'element', 'id', output );}
if( output && output.element ){this.outputElement = output;this.outputElement.element.innerHTML = '';return true;}}
return false;}
JinnConsole_proto.write = function( content ){var target = null;var rotate = false;var scroll = true;var window = null;buffer = this.content;buffer.push( content );while( buffer.length > this.maxEntries ){buffer.shift();rotate = true;}
if( !(target = this.outputElement) ){return false;}
if( !(window = this.getWindow()) ){return false;}
target.augment();if( target.element.scrollTop
<
(target.element.scrollHeight - target.element.ijinn.innerHeight - 20) ){scroll = false;}
var entry = window.document.createElement( 'span' );entry.innerHTML = content;target.element.appendChild( entry );if( rotate ){var remElement =
this.getService( 'element', target.element.childNodes[0] );var scrollAdjust = 0;if( !scroll ){remElement.style.visibility = 'hidden';remElement.style.position = 'absolute';remElement.augment();scrollAdjust = remElement.element.ijinn.height;}
target.element.removeChild( remElement.element );if( !scroll ){this.scrollBy( 0 - scrollAdjust );}}
this.listeners.signal( 'write', this );if( scroll ){this.scrollToBottom();}
return true;}
JinnConsole_proto.clear = function(){var status = false;if( this.outputElement && this.outputElement.element ){this.outputElement.element.innerHTML = '';status = true;this.listeners.signal( 'clear', this );}
this.content = new Array();this.scrollToTop();return status;}
JinnConsole_proto.refresh = function(){var content = this.content;this.clear();for( var key in content ){this.write( content );}
this.listeners.signal( 'refresh', this );this.scrollToBottom();}
JinnConsole_proto.scrollToTop = function(){if( this.outputElement && this.outputElement.element ){this.outputElement.element.scrollTop = 0;this.listeners.signal( 'scrolltotop', this );return true;}
return false;}
JinnConsole_proto.scrollToBottom = function(){if( this.outputElement && this.outputElement.element ){this.outputElement.element.scrollTop =
this.outputElement.element.scrollHeight;this.listeners.signal( 'scrolltobottom', this );return true;}
return false;}
JinnConsole_proto.scrollBy = function( amount ){if( this.outputElement && this.outputElement.element ){if( (this.outputElement.element.scrollTop + amount) < 0 ){amount = (0 - this.outputElement.element.scrollTop);}
this.outputElement.element.scrollTop =
this.outputElement.element.scrollTop + amount;this.listeners.signal( 'scroll', this );return true;}
return false;}
JinnConsole_proto.handleInput = function( event ){if( !event ){event = this.getWindow().event;}
if( !event ){event = new Object();}
event.cancelBubble = true;this.listeners.signalWithEvent('input', this, event, this.inputElement
);}
function ijinn_consoleWrite( name, content ){var console = null;if( (console = gJinnConsole_lookupHash[name]) ){return console.write( content );}
return false;}
function JinnFormFieldBaseField(){this.jinnit();this.fieldType = 'generic';this.tagName = 'JINN_GENERIC_TAG_NAME';}
JinnFormFieldBaseField.prototype = new JinnBaseClass();JinnFormFieldBaseField_proto = JinnFormFieldBaseField.prototype;JinnFormFieldBaseField_proto.constructor = JinnFormFieldBaseField;JinnFormFieldBaseField.superjinn = JinnBaseClass.prototype;JinnFormFieldBaseField_proto.jinnit = function(){JinnFormFieldBaseField.superjinn.jinnit.call( this );this.allowMultipleInstances = true;this.element = null;this.elements = new Array();}
JinnFormFieldBaseField_proto.postLoadExecute = function( type, field, form ){var element = null;type  = this.defaultValue( type,  null );field = this.defaultValue( field, null );form  = this.defaultValue( form, null );if( typeof( type ) == 'object' ){this.element = type;if( this.element ){this.elements[this.element.name] = this.element;}}
else
if( type == 'id' && field ){element = this.getService( 'element', 'id', field );if( element.element ){this.element = element.element;this.elements[this.element.name] = this.element;}}
else
if( type == 'name' && field && form ){var fieldName = field;var fieldNameBraced = fieldName + '[]';var formName = form;if( this.getDataType( form ) == 'object' ){formName = form.name;}
else{form = this.getElement( formName );}
if( !form || !form.getElementsByTagName ){return;}
var source = form;if( !source ){if( !(source = form.document) ){return;}}
var elements  = form.getElementsByTagName( this.tagName );var tElement  = null;for( var i in elements ){tElement = elements[i];if( tElement.name == fieldName
||
tElement.name == fieldNameBraced ){this.element = tElement;this.elements[tElement.value] = tElement;}}}}
JinnFormFieldBaseField_proto.getValue = function(){if( this.element ){return this.element.value;}
return null;}
function JinnFormFieldButton(){this.jinnit();this.fieldType = 'button';this.tagName = 'INPUT';}
JinnFormFieldButton.prototype = new JinnFormFieldBaseField();JinnFormFieldButton_proto = JinnFormFieldButton.prototype;JinnFormFieldButton_proto.constructor = JinnFormFieldButton;JinnFormFieldButton.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldButton_proto.jinnit = function(){JinnFormFieldButton.superjinn.jinnit.call( this );}
function JinnFormFieldCheckbox(){this.jinnit();this.fieldType = 'checkbox';this.tagName = 'INPUT';}
JinnFormFieldCheckbox.prototype = new JinnFormFieldBaseField();JinnFormFieldCheckbox_proto = JinnFormFieldCheckbox.prototype;JinnFormFieldCheckbox_proto.constructor = JinnFormFieldCheckbox;JinnFormFieldCheckbox.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldCheckbox_proto.jinnit = function(){JinnFormFieldCheckbox.superjinn.jinnit.call( this );}
JinnFormFieldCheckbox_proto.isChecked = function( name ){var field = null;if( (field = this.elements[name]) ){if( field.checked ){return true;}}
return false;}
JinnFormFieldCheckbox_proto.check = function( name ){var field = null;if( (field = this.elements[name]) ){field.checked = true;}}
JinnFormFieldCheckbox_proto.uncheck = function( name ){var field = null;if( (field = this.elements[name]) ){field.checked = false;}}
JinnFormFieldCheckbox_proto.toggle = function( name ){var field = null;if( (field = this.elements[name]) ){if( field.checked ){field.checked = false;}
else{field.checked = true;}}}
JinnFormFieldCheckbox_proto.checkAll = function(){for( var fieldName in this.elements ){this.elements[fieldName].checked = true;}}
JinnFormFieldCheckbox_proto.uncheckAll = function(){for( var fieldName in this.elements ){this.elements[fieldName].checked = false;}}
JinnFormFieldCheckbox_proto.toggleAll = function(){for( var fieldName in this.elements ){if( this.elements[fieldName].checked ){this.elements[fieldName].checked = false;}
else{this.elements[fieldName].checked = true;}}}
function JinnFormFieldHidden(){this.jinnit();this.fieldType = 'hidden';this.tagName = 'INPUT';}
JinnFormFieldHidden.prototype = new JinnFormFieldBaseField();JinnFormFieldHidden_proto = JinnFormFieldHidden.prototype;JinnFormFieldHidden_proto.constructor = JinnFormFieldHidden;JinnFormFieldHidden.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldHidden_proto.jinnit = function(){JinnFormFieldHidden.superjinn.jinnit.call( this );}
function JinnFormFieldSelect(){this.jinnit();this.fieldType = 'select';this.tagName = 'SELECT';}
JinnFormFieldSelect.prototype = new JinnFormFieldBaseField();JinnFormFieldSelect_proto = JinnFormFieldSelect.prototype;JinnFormFieldSelect_proto.constructor = JinnFormFieldSelect;JinnFormFieldSelect.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldSelect_proto.jinnit = function(){JinnFormFieldSelect.superjinn.jinnit.call( this );}
JinnFormFieldSelect_proto.clearEntries = function(){this.element.length = 0;}
JinnFormFieldSelect_proto.setEntries = function( entries ){var field = this.element;this.clearEntries();if( this.isset( entries.options ) ){for( i = 0; i < entries.length; i++ ){field.options[i] =
new Option(entries.options[i].text, entries.options[i].value
);}}
else{var i = 0;for( key in entries ){field.options[i] =
new Option(entries[key], key
);i++;}}}
function JinnFormFieldMultipleSelect(){this.jinnit();this.fieldType = 'multipleSelect';this.tagName = 'SELECT';}
JinnFormFieldMultipleSelect.prototype = new JinnFormFieldSelect();JinnFormFieldMultipleSelect_proto = JinnFormFieldMultipleSelect.prototype;JinnFormFieldMultipleSelect_proto.constructor = JinnFormFieldMultipleSelect;JinnFormFieldMultipleSelect.superjinn = JinnFormFieldSelect.prototype;JinnFormFieldMultipleSelect_proto.jinnit = function(){JinnFormFieldMultipleSelect.superjinn.jinnit.call( this );}
JinnFormFieldMultipleSelect_proto.getFirstSelected = function(){var field = this.element;var length = field.length;for( i = 0; i < length; i++ ){if( field.options[i].selected ){return field.options[i].value;}}
return null;}
JinnFormFieldMultipleSelect_proto.getFirstSelectedText = function(){var field = this.element;var length = field.length;for( i = 0; i < length; i++ ){if( field.options[i].selected ){return field.options[i].text;}}
return null;}
function JinnFormFieldPassword(){this.jinnit();this.fieldType = 'password';this.tagName = 'INPUT';}
JinnFormFieldPassword.prototype = new JinnFormFieldBaseField();JinnFormFieldPassword_proto = JinnFormFieldPassword.prototype;JinnFormFieldPassword_proto.constructor = JinnFormFieldPassword;JinnFormFieldPassword.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldPassword_proto.jinnit = function(){JinnFormFieldPassword.superjinn.jinnit.call( this );}
function JinnFormFieldRadio(){this.jinnit();this.fieldType = 'radio';this.tagName = 'INPUT';}
JinnFormFieldRadio.prototype = new JinnFormFieldBaseField();JinnFormFieldRadio_proto = JinnFormFieldRadio.prototype;JinnFormFieldRadio_proto.constructor = JinnFormFieldRadio;JinnFormFieldRadio.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldRadio_proto.jinnit = function(){JinnFormFieldRadio.superjinn.jinnit.call( this );}
JinnFormFieldRadio_proto.isChecked = function( name ){var field = null;if( (field = this.elements[name]) ){if( field.checked ){return true;}}
return false;}
JinnFormFieldRadio_proto.check = function( name ){var field = null;if( (field = this.elements[name]) ){field.checked = true;}}
JinnFormFieldRadio_proto.uncheck = function( name ){var field = null;if( (field = this.elements[name]) ){field.checked = false;}}
JinnFormFieldRadio_proto.getChecked = function(){for( var fieldName in this.elements ){if( this.elements[fieldName].checked ){return this.elements[fieldName];}}}
JinnFormFieldRadio_proto.getSelectedValue = function(){var checked = this.getChecked();if( checked ){return checked.value;}
return null;}
function JinnFormFieldReset(){this.jinnit();this.fieldType = 'reset';this.tagName = 'INPUT';}
JinnFormFieldReset.prototype = new JinnFormFieldBaseField();JinnFormFieldReset_proto = JinnFormFieldReset.prototype;JinnFormFieldReset_proto.constructor = JinnFormFieldReset;JinnFormFieldReset.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldReset_proto.jinnit = function(){JinnFormFieldReset.superjinn.jinnit.call( this );}
function JinnFormFieldSubmit(){this.jinnit();this.fieldType = 'submit';this.tagName = 'INPUT';}
JinnFormFieldSubmit.prototype = new JinnFormFieldBaseField();JinnFormFieldSubmit_proto = JinnFormFieldSubmit.prototype;JinnFormFieldSubmit_proto.constructor = JinnFormFieldSubmit;JinnFormFieldSubmit.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldSubmit_proto.jinnit = function(){JinnFormFieldSubmit.superjinn.jinnit.call( this );}
function JinnFormFieldTextarea(){this.jinnit();this.fieldType = 'textarea';this.tagName = 'TEXTAREA';}
JinnFormFieldTextarea.prototype = new JinnFormFieldBaseField();JinnFormFieldTextarea_proto = JinnFormFieldTextarea.prototype;JinnFormFieldTextarea_proto.constructor = JinnFormFieldTextarea;JinnFormFieldTextarea.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldTextarea_proto.jinnit = function(){JinnFormFieldTextarea.superjinn.jinnit.call( this );}
function JinnFormFieldText(){this.jinnit();this.fieldType = 'text';this.tagName = 'INPUT';}
JinnFormFieldText.prototype = new JinnFormFieldBaseField();JinnFormFieldText_proto = JinnFormFieldText.prototype;JinnFormFieldText_proto.constructor = JinnFormFieldText;JinnFormFieldText.superjinn = JinnFormFieldBaseField.prototype;JinnFormFieldText_proto.jinnit = function(){JinnFormFieldText.superjinn.jinnit.call( this );}
gJinnGlobals['interJinn']['coreRoot'] = '/javaScript/interJinn/';gJinnGlobals['interJinn']['codeRoot'] = '/javaScript/interJinnProjects/';gJinnGlobals['interJinn']['pageRoot'] = '/';gJinnGlobals['interJinn']['pageBase'] = '/';gJinnGlobals['interJinn']['jdl'] = new JinnDynamicLoader();gJinnGlobals['interJinn']['jdl'].libraries = new Array();gJinnGlobals['interJinn']['jdl'].libraries["JinnCoreRequirements"] = "JinnCoreRequirements";gJinnGlobals['interJinn']['jdl'].libraries["JinnCore"] = "JinnCore";gJinnGlobals['interJinn']['jdl'].libraries["JinnBrowserCompatibility"] = "JinnBrowserCompatibility";gJinnGlobals['interJinn']['jdl'].libraries["JinnOutputDebugger"] = "JinnOutputDebugger";gJinnGlobals['interJinn']['jdl'].libraries["JinnListenerManager"] = "JinnListenerManager";gJinnGlobals['interJinn']['jdl'].libraries["JinnHttpRequest"] = "JinnHttpRequest";gJinnGlobals['interJinn']['jdl'].libraries["JinnPhp"] = "JinnPhp";gJinnGlobals['interJinn']['jdl'].libraries["JinnWindow"] = "JinnWindow";gJinnGlobals['interJinn']['jdl'].libraries["JinnElement"] = "JinnElement";gJinnGlobals['interJinn']['jdl'].libraries["JinnLayout"] = "JinnLayout";gJinnGlobals['interJinn']['jdl'].libraries["JinnLayoutColumnFlowDown"] = "JinnLayoutColumnFlowDown";gJinnGlobals['interJinn']['jdl'].libraries["JinnLayoutColumnFlowUp"] = "JinnLayoutColumnFlowUp";gJinnGlobals['interJinn']['jdl'].libraries["JinnLayoutRowFlowRight"] = "JinnLayoutRowFlowRight";gJinnGlobals['interJinn']['jdl'].libraries["JinnLayoutRowFlowLeft"] = "JinnLayoutRowFlowLeft";gJinnGlobals['interJinn']['jdl'].libraries["JinnLayoutWindow"] = "JinnLayoutWindow";gJinnGlobals['interJinn']['jdl'].libraries["JinnControl"] = "JinnControl";gJinnGlobals['interJinn']['jdl'].libraries["JinnControlLoader"] = "JinnControlLoader";gJinnGlobals['interJinn']['jdl'].libraries["JinnSubPane"] = "JinnSubPane";gJinnGlobals['interJinn']['jdl'].libraries["JinnSubWindow"] = "JinnSubWindow";gJinnGlobals['interJinn']['jdl'].libraries["JinnDataBrowser"] = "JinnDataBrowser";gJinnGlobals['interJinn']['jdl'].libraries["JinnConsole"] = "JinnConsole";gJinnGlobals['interJinn']['jdl'].libraries["JinnHtmlTableRow"] = "JinnHtmlTableRow";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldBaseField"] = "JinnFormFieldBaseField";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldCheckbox"] = "JinnFormFieldCheckbox";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldRadio"] = "JinnFormFieldRadio";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldSelect"] = "JinnFormFieldSelect";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldMultipleSelect"] = "JinnFormFieldMultipleSelect";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldText"] = "JinnFormFieldText";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldTextarea"] = "JinnFormFieldTextarea";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldPassword"] = "JinnFormFieldPassword";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldHidden"] = "JinnFormFieldHidden";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldButton"] = "JinnFormFieldButton";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldSubmit"] = "JinnFormFieldSubmit";gJinnGlobals['interJinn']['jdl'].libraries["JinnFormFieldReset"] = "JinnFormFieldReset";gJinnGlobals['interJinn']['jdl'].libraries;gJinnGlobals['interJinn']['jdl'].aliases = new Array();gJinnGlobals['interJinn']['jdl'].aliases["core"] = "JinnCoreRequirements";gJinnGlobals['interJinn']['jdl'].aliases["interjinn"] = "JinnCore";gJinnGlobals['interJinn']['jdl'].aliases["browsercompatibility"] = "JinnBrowserCompatibility";gJinnGlobals['interJinn']['jdl'].aliases["outputdebugger"] = "JinnOutputDebugger";gJinnGlobals['interJinn']['jdl'].aliases["listenermanager"] = "JinnListenerManager";gJinnGlobals['interJinn']['jdl'].aliases["httprequest"] = "JinnHttpRequest";gJinnGlobals['interJinn']['jdl'].aliases["php"] = "JinnPhp";gJinnGlobals['interJinn']['jdl'].aliases["window"] = "JinnWindow";gJinnGlobals['interJinn']['jdl'].aliases["databrowser"] = "JinnDataBrowser";gJinnGlobals['interJinn']['jdl'].aliases["htmltablerow"] = "JinnHtmlTableRow";gJinnGlobals['interJinn']['jdl'].aliases["element"] = "JinnElement";gJinnGlobals['interJinn']['jdl'].aliases["layout"] = "JinnLayout";gJinnGlobals['interJinn']['jdl'].aliases["layoutcolumnflowdown"] = "JinnLayoutColumnFlowDown";gJinnGlobals['interJinn']['jdl'].aliases["layoutcolumnflowup"] = "JinnLayoutColumnFlowUp";gJinnGlobals['interJinn']['jdl'].aliases["layoutrowflowright"] = "JinnLayoutRowFlowRight";gJinnGlobals['interJinn']['jdl'].aliases["layoutrowflowleft"] = "JinnLayoutRowFlowLeft";gJinnGlobals['interJinn']['jdl'].aliases["layoutwindow"] = "JinnLayoutWindow";gJinnGlobals['interJinn']['jdl'].aliases["control"] = "JinnControl";gJinnGlobals['interJinn']['jdl'].aliases["controlloader"] = "JinnControlLoader";gJinnGlobals['interJinn']['jdl'].aliases["subpane"] = "JinnSubPane";gJinnGlobals['interJinn']['jdl'].aliases["subwindow"] = "JinnSubWindow";gJinnGlobals['interJinn']['jdl'].aliases["console"] = "JinnConsole";gJinnGlobals['interJinn']['jdl'].aliases["formfieldbutton"] = "JinnFormFieldButton";gJinnGlobals['interJinn']['jdl'].aliases["formfieldcheckbox"] = "JinnFormFieldCheckbox";gJinnGlobals['interJinn']['jdl'].aliases["formfieldhidden"] = "JinnFormFieldHidden";gJinnGlobals['interJinn']['jdl'].aliases["formfieldmultipleselect"] = "JinnFormFieldMultipleSelect";gJinnGlobals['interJinn']['jdl'].aliases["formfieldpassword"] = "JinnFormFieldPassword";gJinnGlobals['interJinn']['jdl'].aliases["formfieldradio"] = "JinnFormFieldRadio";gJinnGlobals['interJinn']['jdl'].aliases["formfieldreset"] = "JinnFormFieldReset";gJinnGlobals['interJinn']['jdl'].aliases["formfieldselect"] = "JinnFormFieldSelect";gJinnGlobals['interJinn']['jdl'].aliases["formfieldsubmit"] = "JinnFormFieldSubmit";gJinnGlobals['interJinn']['jdl'].aliases["formfieldtextarea"] = "JinnFormFieldTextarea";gJinnGlobals['interJinn']['jdl'].aliases["formfieldtext"] = "JinnFormFieldText";gJinnGlobals['interJinn']['jdl'].aliases;

