( function( ) { var _connector = new XConnector; var _loaded = [ ]; var _new = [ ]; function _inline( ) { _new[ _new.length ] = { "type" : "inline", "content" : arguments[ 0 ] }; } function _external( ) { _new[ _new.length ] = { "type" : "external", "content" : arguments[ 0 ] }; } function _load( ) { var _count = 0; function _handler( ) { var _scripts = [ ]; _script : while ( _count < _new.length && _new[ _count ].type != 'inline' ) { for ( var i = 0; i < _loaded.length; i++ ) if ( _loaded[ i ] == _new[ _count ].content ) { _count++; continue _script; } _scripts[ _scripts.length ] = _loaded[ _loaded.length ] = _new[ _count ].content; _count++; } _scripts = _scripts.join( ';' ); if ( _scripts.length ) _connector.go( { "access" : URL_SERVER + 'controller.php?action=phpgwapi.javascript.get_source&source=' + _scripts, "handler" : function( data ) { window.eval( data ); if ( _count < _new.length && _new[ _count ].type == 'inline' ) { window.eval( _new[ _count ].content ); _count++; _handler( ); } else { _count++; _handler( ); } } } ); else if ( _count < _new.length && _new[ _count ].type == 'inline' ) { window.eval( _new[ _count ].content ); _count++; _handler( ); } if ( _count == _new.length ) _new = [ ]; } _handler( ); } function Script( ) { if ( arguments.length && typeof arguments[ 0 ] == 'object' && arguments[ 0 ].constructor == Array ) for ( var i = 0; i < arguments[ 0 ].length; i++ ) _loaded[ _loaded.length ] = arguments[ 0 ][ i ]; } Script.prototype.external = _external; Script.prototype.inline = _inline; Script.prototype.load = _load; window.XScript = Script; } )( );