/**
 * SyntaxHighlighter
 * http://alexgorbatchev.com/
 *
 * SyntaxHighlighter is donationware. If you are using it, please donate.
 * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
 *
 * @version
 * 2.1.364 (October 15 2009)
 * 
 * @copyright
 * Copyright (C) 2004-2009 Alex Gorbatchev.
 *
 * @license
 * This file is part of SyntaxHighlighter.
 * 
 * SyntaxHighlighter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SyntaxHighlighter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with SyntaxHighlighter.  If not, see <http://www.gnu.org/copyleft/lesser.html>.
 */
SyntaxHighlighter.brushes.AS3 = function()
{
	// Created by Peter Atoria @ http://iAtoria.com
	// Native AS3 Classes add by Adam Scott @ http://ascott.ca/
	
	var inits 	 =  'class interface function package';
	
	var keywords =	'-Infinity ...rest Array as AS3 Boolean break case catch const continue Date decodeURI ' + 
					'decodeURIComponent default delete do dynamic each else encodeURI encodeURIComponent escape ' + 
					'extends false final finally flash_proxy for get if implements import in include Infinity ' + 
					'instanceof int internal is isFinite isNaN isXMLName label namespace NaN native new null ' + 
					'Null Number Object object_proxy override parseFloat parseInt private protected public ' + 
					'return set static String super switch this throw true try typeof uint undefined unescape ' + 
					'use void while with'
					;
					
	var as3Class =	'Accelerometer AccelerometerEvent Accessibility AccessibilityImplementation AccessibilityProperties ' + 
					'ActionScriptVersion ActivityEvent AntiAliasType ApplicationDomain ApplyElementIDOperation ' + 
					'ApplyElementStyleNameOperation ApplyElementUserStyleOperation ApplyFormatOperation ' + 
					'ApplyFormatToElementOperation ApplyLinkOperation ApplyTCYOperation ArgumentError arguments Array ' + 
					'AsyncErrorEvent AuthenticationMethod AVM1Movie BackgroundColor BaselineOffset BaselineShift ' + 
					'BevelFilter Bitmap BitmapData BitmapDataChannel BitmapFilter BitmapFilterQuality BitmapFilterType ' + 
					'BlendMode BlockProgression BlurFilter Boolean BreakElement BreakOpportunity ByteArray Camera ' + 
					'Capabilities CapsStyle CaptionChangeEvent CaptionTargetEvent CFFHinting CharacterUtil Class ' + 
					'ClearFormatOnElementOperation ClearFormatOperation Clipboard ClipboardFormats ClipboardTransferMode ' + 
					'Collator CollatorMode ColorCorrection ColorCorrectionSupport ColorDodgeShader ColorMatrixFilter ' + 
					'ColorTransform ColumnState CompositeOperation CompositionAttributeRange CompositionCompleteEvent ' + 
					'Configuration ContainerController ContainerFormattedElement ContentElement ContextMenu ' + 
					'ContextMenuBuiltInItems ContextMenuClipboardItems ContextMenuEvent ContextMenuItem ConversionType ' + 
					'ConvolutionFilter CopyOperation CSMSettings CurrencyFormatter CurrencyParseResult CutOperation ' + 
					'DamageEvent DataEvent Date DateTimeFormatter DateTimeNameContext DateTimeNameStyle DateTimeStyle ' + 
					'DefinitionError DeleteObjectSample DeleteTextOperation Dictionary DigitCase DigitWidth Direction ' + 
					'DisplacementMapFilter DisplacementMapFilterMode DisplayObject DisplayObjectContainer DivElement ' + 
					'DRMAuthenticationCompleteEvent DRMAuthenticationErrorEvent DRMContentData DRMErrorEvent DRMManager ' + 
					'DRMPlaybackTimeWindow DRMStatusEvent DRMVoucher DropShadowFilter EastAsianJustifier EditingMode ' + 
					'EditManager ElementFormat ElementRange Endian EOFError Error ErrorEvent EvalError Event ' + 
					'EventDispatcher EventPhase ExternalInterface FileFilter FileReference FileReferenceList ' + 
					'FlowComposerBase FlowDamageType FlowElement FlowElementMouseEvent FlowElementOperation ' + 
					'FlowGroupElement FlowLeafElement FlowOperation FlowOperationEvent FlowTextOperation ' + 
					'FLVPlaybackCaptioning FocusEvent Font FontDescription FontLookup FontMetrics FontPosture FontStyle ' + 
					'FontType FontWeight FormatValue FrameLabel FTETextField FullScreenEvent Function GestureEvent ' + 
					'GesturePhase GlobalSettings GlowFilter GradientBevelFilter GradientGlowFilter GradientType ' + 
					'GraphicElement Graphics GraphicsBitmapFill GraphicsEndFill GraphicsGradientFill GraphicsPath ' + 
					'GraphicsPathCommand GraphicsPathWinding GraphicsShaderFill GraphicsSolidFill GraphicsStroke ' + 
					'GraphicsTrianglePath GridFitType GroupElement GroupSpecifier HTTPStatusEvent IBitmapDrawable ' + 
					'IConfiguration ID3Info IDataInput IDataOutput IDynamicPropertyOutput IDynamicPropertyWriter ' + 
					'IEditManager IEventDispatcher IExternalizable IFlowComposer IFormatResolver IGraphicsData ' + 
					'IGraphicsFill IGraphicsPath IGraphicsStroke IIMEClient IInteractionEventHandler ' + 
					'IllegalOperationError IME IMEConversionMode IMEEvent InlineGraphicElement ' + 
					'InlineGraphicElementStatus InsertInlineGraphicOperation InsertTextOperation int InteractiveObject ' + 
					'InterpolationMethod InvalidSWFError IOError IOErrorEvent IOperation ISandboxSupport ISearchableText ' + 
					'ISelectionManager ISimpleTextSelection ISWFContext ITabStopFormat ITextExporter ITextImporter ' + 
					'ITextLayoutFormat ITextLineCreator IUndoManager IVerticalJustificationLine JointStyle ' + 
					'JPEGLoaderContext JustificationRule JustificationStyle Kerning Keyboard KeyboardEvent KeyboardType ' + 
					'KeyLocation LastOperationStatus LeadingModel LigatureLevel LineBreak LineJustification LineScaleMode ' + 
					'LinkElement LinkState Loader LoaderContext LoaderInfo LoadVoucherSetting LocalConnection LocaleID ' + 
					'Math Matrix Matrix3D MemoryError Microphone ModifyInlineGraphicOperation MorphShape Mouse MouseCursor ' + 
					'MouseEvent MovieClip Multitouch MultitouchInputMode Namespace NationalDigitsType NavigationUtil ' + 
					'NetConnection NetGroup NetGroupInfo NetGroupReceiveMode NetGroupReplicationStrategy NetGroupSendMode ' + 
					'NetGroupSendResult NetStatusEvent NetStream NetStreamAppendBytesAction NetStreamInfo ' + 
					'NetStreamMulticastInfo NetStreamPlayOptions NetStreamPlayTransitions NewObjectSample Number ' + 
					'NumberFormatter NumberParseResult Object ObjectEncoding Orientation3D OverflowPolicy ParagraphElement ' + 
					'ParagraphFormattedElement PasteOperation PerspectiveProjection PixelSnapping PlainTextExporter Point ' + 
					'PressAndTapGestureEvent PrintJob PrintJobOptions PrintJobOrientation ProgressEvent Proxy QName ' + 
					'RangeError Rectangle RedoOperation ReferenceError RegExp RenderingMode Responder Sample ' + 
					'SampleDataEvent Scene ScriptTimeoutError ScrollPolicy Security SecurityDomain SecurityError ' + 
					'SecurityErrorEvent SecurityPanel SelectionEvent SelectionFormat SelectionManager SelectionState ' + 
					'Shader ShaderData ShaderEvent ShaderFilter ShaderInput ShaderJob ShaderParameter ShaderParameterType ' + 
					'ShaderPrecision Shape SharedObject SharedObjectFlushStatus SimpleButton Socket Sound SoundChannel ' + 
					'SoundCodec SoundLoaderContext SoundMixer SoundTransform SpaceJustifier SpanElement ' + 
					'SpecialCharacterElement SplitParagraphOperation SpreadMethod Sprite StackFrame StackOverflowError ' + 
					'Stage StageAlign StageDisplayState StageQuality StageScaleMode StandardFlowComposer StaticText ' + 
					'StatusChangeEvent StatusEvent String StringTextLineFactory StringTools StyleSheet ' + 
					'SubParagraphGroupElement SWFVersion SyncEvent SyntaxError System SystemUpdater SystemUpdaterType ' + 
					'TabAlignment TabElement TabStop TabStopFormat TCYElement TextAlign TextBaseline TextBlock ' + 
					'TextClipboard TextColorType TextContainerManager TextConverter TextDecoration TextDisplayMode ' + 
					'TextElement TextEvent TextExtent TextField TextFieldAutoSize TextFieldType TextFlow TextFlowLine ' + 
					'TextFlowLineLocation TextFlowTextLineFactory TextFormat TextFormatAlign TextJustifier TextJustify ' + 
					'TextLayoutEvent TextLayoutFormat TextLine TextLineCreationResult TextLineFactoryBase TextLineMetrics ' + 
					'TextLineMirrorRegion TextLineRecycler TextLineValidity TextRange TextRenderer TextRotation TextScrap ' + 
					'TextSnapshot Timer TimerEvent TLFTypographicCase TouchEvent TouchscreenType Transform ' + 
					'TransformGestureEvent TriangleCulling TruncationOptions TypeError TypographicCase uint ' + 
					'UncaughtErrorEvent UncaughtErrorEvents UndoManager UndoOperation UpdateCompleteEvent URIError ' + 
					'URLLoader URLLoaderDataFormat URLRequest URLRequestHeader URLRequestMethod URLStream URLVariables ' + 
					'Utils3D Vector Vector3D VerifyError VerticalAlign Video VoucherAccessInfo WhiteSpaceCollapse XML ' + 
					'XMLDocument XMLList XMLNode XMLNodeType XMLSocket'
					;
					
	var packages =	'flash.accessibility flash.desktop flash.display flash.errors flash.events flash.external ' +
					'flash.filters flash.geom flash.globalization flash.media flash.net.drm flash.net flash.printing ' +
					'flash.profiler flash.sampler flash.sensors flash.system flash.text.engine flash.text.ime flash.text' + 
					'flash.ui flash.utils flash.xml flashx.textLayout.compose flashx.textLayout.container ' + 
					'flashx.textLayout.conversion flashx.textLayout.edit flashx.textLayout.elements flashx.textLayout.events ' + 
					'flashx.textLayout.factory flashx.textLayout.formats flashx.textLayout.operations flashx.textLayout.utils ' + 
					'flashx.undo flash ';
	
	this.regexList = [
		{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },		// one line comments
		{ regex: SyntaxHighlighter.regexLib.multiLineCComments,		css: 'comments' },		// multiline comments
		{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },		// double quoted strings
		{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },		// single quoted strings
		{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi,				css: 'value' },			// numbers
		{ regex: new RegExp(this.getKeywords(inits), 'gm'),			css: 'color3' },		// initializations
		{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword' },		// keywords
		{ regex: new RegExp(this.getKeywords(as3Class), 'gm'),		css: 'color2' },		// AS3 Native classes
		{ regex: new RegExp(this.getKeywords(packages), 'gm'),		css: 'packages' },		// AS3 Native packages
		{ regex: new RegExp('var', 'gm'),							css: 'variable' },		// variable
		{ regex: new RegExp('trace', 'gm'),							css: 'color1' }			// trace
		];
	
	this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};

SyntaxHighlighter.brushes.AS3.prototype	= new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.AS3.aliases	= ['actionscript3', 'as3'];
