function Script(code, mode)
{
	Group.call(this);

	this.type = "Script";
	this.name = "script";

	/**
	 * Source code attached to the script, by default it is a Javacript source but other languages can be implemented.
	 *
	 * It can access and change every object in the program and supports some events
	 * - initialize
	 *    - Called on app initialization, its called after all children elements are initialized, its safe to apply operations on other objects inside this method.
	 *  - update(delta)
	 *    - Called on every frame after rendering
	 *  - dispose
	 *    - Called when disposing the program
	 *  - onMouseOver(intersections)
	 *    - Called on every frame if mouse is on top of one of the script children
	 *    - Receives an intersections array as argument.
	 *  - onResize(x, y)
	 *    - Called every time the window is resized
	 *    - Receives width and height as parameters
	 *  - onAppData(data)
	 *    - Called when receiving data sent by the host website
	 *
	 * Code written inside scripts have access to the following attributes:
	 *  - scene
	 *  - program
	 *  - self
	 *    - Same as this reference but global in the script scope
	 *  - Keyboard
	 *  - Mouse
	 *
	 * There is also access to the following functions
	 *  - include
	 *    - Include a javascript file from resources, when including files the user needs to be carefull and clear manually global declarations. The access to this method may be restricted depeding on the include mode
	 *
	 * @property code
	 * @type {string}
	 */
	this.code = code !== undefined ? code : Script.DEFAULT;

	/**
	 * Mode indicates how to include external javascripts files into the script.
	 *
	 * Can be APPEND, EVALUATE or INCLUDE.
	 *
	 * APPEND mode with append the library code to the script code, when running in this mode the include method cannot be used during runtime
	 *
	 * EVALUATE node with evaluate the library code during runtime, include method may still be used.
	 *
	 * INCLUDE mode will include the file as a global script, these libraries are not unloaded after the script or application is terminated.
	 *
	 * @property mode
	 * @type {number}
	 */
	this.mode = mode !== undefined ? mode : Script.APPEND;

	/**
	 * Compiled function used during runtime.
	 *
	 * This varible gets created using the compileCode() function called automatically on initalization.
	 *
	 * @attribute script
	 * @type {Function}
	 */
	this.script = {};

	/**
	 * Reference to the program object.
	 *
	 * Can be used to access other scenes, get resources and objects.
	 *
	 * @property program
	 * @type {Program}
	 */
	this.program = null;

	/**
	 * Reference to the scene where the script is placed.
	 *
	 * Can be used to interact with other objects.
	 *
	 * @property scene
	 * @type {Scene}
	 */
	this.scene = null;
}
Script objects are used to control other objects present in the scene.

These scripts can access everything inside of the program where they are running they should be used to control logic aspect of the application.

Its possible to extend these scripts by using libraries that can be imported using the include() function provided. Libraries can be stored locally on the project or loaded from remote sources.

@class Script
@extends {Object}
@param {string} code Javascript code to be used by this script
@param {number} mode Mode used to import external code into the script.
@module Script