﻿/**
CLASS_HIGHLIGHT
**/

function CLASS_HIGHLIGHT(code,syntax)
{
	//Hash table class
	function Hashtable(){
		this._hash = new Object();
		this.add = function(key,value){
			if(typeof(key)!="undefined"){
				if(this.contains(key)==false){
					this._hash[key]=typeof(value)=="undefined"?null:value;
					return true;
				}else{
					return false;
				}
			}
			else{
				return false;
			}
		}
		this.remove		= function(key){delete this._hash[key];}
		this.count		= function(){var i=0;for(var k in this._hash){i++;} return i;}
		this.items		= function(key){return this._hash[key];}
		this.contains	= function(key){return typeof(this._hash[key])!="undefined";}
		this.clear		= function(){for(var k in this._hash){delete this._hash[k];}}
	}

	this._caseSensitive = true;

	//Convert string 2 hashtable
	this.str2hashtable = function(key,cs){
		var _key	= key.split(/,/g);
		var _hash	= new Hashtable();
		var _cs		= true;

		if(typeof(cs)=="undefined"||cs==null){
			_cs = this._caseSensitive;
		}else{
			_cs = cs;
		}

		for(var i in _key){
			if(_cs){
				_hash.add(_key[i]);
			}else{
				_hash.add((_key[i]+"").toLowerCase());
			}
		}
		return _hash;
	}

	//Get code
	this._codetxt = code;

	if(typeof(syntax)=="undefined"){
		syntax = "";
	}	
	
	switch(syntax.toLowerCase()){
		case "sql":
			//大小写敏感
			this._caseSensitive	= false;
			//关键字
			this._keywords		= this.str2hashtable("COMMIT,DELETE,INSERT,LOCK,ROLLBACK,SELECT,TRANSACTION,READ,ONLY,WRITE,USE,ROLLBACK,SEGMENT,ROLE,EXCEPT,NONE,UPDATE,DUAL,WORK,COMMENT,FORCE,FROM,WHERE,INTO,VALUES,ROW,SHARE,MODE,EXCLUSIVE,UPDATE,ROW,NOWAIT,TO,SAVEPOINT,UNION,UNION,ALL,INTERSECT,MINUS,START,WITH,CONNECT,BY,GROUP,HAVING,ORDER,UPDATE,NOWAIT,IDENTIFIED,SET,DROP,PACKAGE,CREATE,REPLACE,PROCEDURE,FUNCTION,TABLE,RETURN,AS,BEGIN,DECLARE,END,IF,THEN,ELSIF,ELSE,WHILE,CURSOR,EXCEPTION,WHEN,OTHERS,NO_DATA_FOUND,TOO_MANY_ROWS,CURSOR_ALREADY_OPENED,FOR,LOOP,IN,OUT,TYPE,OF,INDEX,BINARY_INTEGER,RAISE,ROWTYPE,VARCHAR2,NUMBER,LONG,DATE,RAW,LONG RAW,CHAR,INTEGER,MLSLABEL,CURRENT,OF,DEFAULT,CURRVAL,NEXTVAL,LEVEL,ROWID,ROWNUM,DISTINCT,ALL,LIKE,IS,NOT,NULL,BETWEEN,ANY,AND,OR,EXISTS,ASC,DESC,ABS,CEIL,COS,COSH,EXP,FLOOR,LN,LOG,MOD,POWER,ROUND,SIGN,SIN,SINH,SQRT,TAN,TANH,TRUNC,CHR,CONCAT,INITCAP,LOWER,LPAD,LTRIM,NLS_INITCAP,NLS_LOWER,NLS_UPPER,REPLACE,RPAD,RTRIM,SOUNDEX,SUBSTR,SUBSTRB,TRANSLATE,UPPER,ASCII,INSTR,INSTRB,LENGTH,LENGTHB,NLSSORT,ADD_MONTHS,LAST_DAY,MONTHS_BETWEEN,NEW_TIME,NEXT_DAY,ROUND,SYSDATE,TRUNC,CHARTOROWID,CONVERT,HEXTORAW,RAWTOHEX,ROWIDTOCHAR,TO_CHAR,TO_DATE,TO_LABEL,TO_MULTI_BYTE,TO_NUMBER,TO_SINGLE_BYTE,DUMP,GREATEST,GREATEST_LB,LEAST,LEAST_UB,NVL,UID,USER,USERENV,VSIZE,AVG,COUNT,GLB,LUB,MAX,MIN,STDDEV,SUM,VARIANCE");
			//内建对象
			this._commonObjects = this.str2hashtable("");
			//标记字符
			this._tags			= this.str2hashtable("",false);
			//分隔字符
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			//引号
			this._quotation		= this.str2hashtable("'");
			//行注释字符
			this._lineComment	= "--";
			//转义字符
			this._escape		= "";
			//多行注释开始
			this._commentOn		= "/*";
			//多行注释结束
			this._commentOff	= "*/";
			//忽略字符
			this._ignore		= "";
			//是否处理标记
			this._dealTag		= false;
			break;
		case "csharp": //C#
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("abstract,as,base,bool,break,byte,case,catch,char,checked,class,const,continue,decimal,default,delegate,do,double,else,enum,event,explicit,extern,false,finally,fixed,float,for,foreach,get,goto,if,implicit,in,int,interface,internal,is,lock,long,namespace,new,null,object,operator,out,override,params,private,protected,public,readonly,ref,return,sbyte,sealed,short,sizeof,stackalloc,static,set,string,struct,switch,this,throw,true,try,typeof,uint,ulong,unchecked,unsafe,ushort,using,value,virtual,void,volatile,while");
			this._commonObjects = this.str2hashtable("String,Boolean,DateTime,Int32,Int64,Exception,DataTable,DataReader");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\"");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "";
			this._dealTag		= false;
			this._dealAPI		= true;
			break;			
		case "java":
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("abstract,boolean,break,byte,case,catch,char,class,const,continue,default,do,double,else,extends,final,finally,float,for,goto,if,implements,import,instanceof,int,interface,long,native,new,package,private,protected,public,return,short,static,strictfp,super,switch,synchronized,this,throw,throws,transient,try,void,volatile,while");
			this._commonObjects = this.str2hashtable("String,Boolean,DateTime,Int32,Int64,Exception,DataTable,DataReader");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\"");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "";
			this._dealTag		= false;
			break;
		case "js":
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("function,void,this,boolean,while,if,return,new,true,false,try,catch,throw,null,else,int,long,do,var");
			this._commonObjects = this.str2hashtable("String,Number,Boolean,RegExp,Error,Math,Date");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "<!--";
			break;
		case "vbs":
		case "vb":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("Lib,Declare,And,ByRef,ByVal,Call,Case,Class,Const,Dim,Do,Each,Else,ElseIf,Empty,End,Eqv,Erase,Error,Exit,Explicit,False,For,Get,If,Imp,In,Is,Let,Loop,Mod,Next,Not,Nothing,Null,As,New,On,Option,Or,Private,Property,Public,Randomize,ReDim,Resume,Select,Set,Step,Sub,Then,To,True,Until,Wend,While,Xor,Anchor,Array,Asc,Atn,CBool,CByte,CCur,CDate,CDbl,Chr,CInt,CLng,Cos,CreateObject,CSng,CStr,Date,DateAdd,DateDiff,DatePart,DateSerial,DateValue,Day,Dictionary,Document,Element,Err,Exp,FileSystemObject,Filter,Fix,Int,Form,FormatCurrency,FormatDateTime,FormatNumber,FormatPercent,GetObject,Hex,Hour,InputBox,InStr,InstrRev,IsArray,IsDate,IsEmpty,IsNull,IsNumeric,IsObject,Join,LBound,LCase,Left,Len,Link,LoadPicture,Location,Log,LTrim,RTrim,Trim,Mid,Minute,Month,MonthName,MsgBox,Navigator,Now,Oct,Replace,Right,Rnd,Round,Second,Sgn,Sin,Space,Split,Sqr,StrComp,StrReverse,Tan,Time,TextStream,TimeSerial,TimeValue,TypeName,UBound,UCase,VarType,Weekday,WeekDayName,Year,Typeof,Type,Enum,Input,Output,Open,Close,Line,Seek,FileAttr,GetAttr,SetAttr,FileLen,EOF,LOF,Reset,Spc,Dir,Kill,Lock,Unlock,Name,Format,Tab,FileDateTime,Put,Input,Print,FileCopy,Write,FreeFile,Loc,CallByName,Choose,CVErr,DDB,DoEvents,Environ");
			this._commonObjects = this.str2hashtable("String,Number,Boolean,Date,Integer,Long,Double,Single,Currency,Decimal,Object,Variant,Wscript,Function,ScriptEngine,ScriptEngineBuildVersion,ScriptEngineMajorVersion,ScriptEngineMinorVersion");
			this._tags		= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\"");
			this._lineComment	= "'";
			this._escape		= "";
			this._commentOn		= "";
			this._commentOff	= "";
			this._ignore		= "<!--";
			this._dealTag		= false;
			this._dealAPI		= true;
			break;			
		case "c":
		case "cpp":
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("upper_bound,lower_bound,binary_search,equal_range,make_heap,sort_heap,popheap,push_heap,sort,reverse,copy,null,NULL,comment,lib,in,out,break,case,catch,class,const,__finally,__exception,__try,const_cast,continue,private,public,protected,__declspec,default,delete,deprecated,dllexport,dllimport,do,dynamic_cast,else,enum,explicit,extern,if,for,friend,goto,inline,mutable,naked,new,noinline,noreturn,nothrow,register,reinterpret_cast,return,selectany,sizeof,static,static_cast,struct,switch,template,this,thread,throw,true,false,TRUE,FALSE,try,typedef,typeid,typename,union,uuid,virtual,void,volatile,istream,ostring,ifstream,ofstream,iteratorstruct,using,namespace,whcar_t,_asm,__asm,while,#include,#if,#elif,#else,#ifdef,#ifndef,#define,#undef,#endif,#pragma,#line");
			this._commonObjects = this.str2hashtable("ATOM,BOOL,BOOLEAN,BYTE,CHAR,COLORREF,DWORD,DWORDLONG,DWORD_PTR,DWORD32,DWORD64,FLOAT,HACCEL,HALF_PTR,HANDLE,HBITMAP,HBRUSH,HCOLORSPACE,HCONV,HCONVLIST,HCURSOR,HDC,HDDEDATA,HDESK,HDROP,HDWP,HENHMETAFILE,HFILE,HFONT,HGDIOBJ,HGLOBAL,HHOOK,HICON,HINSTANCE,HKEY,HKL,HLOCAL,HMENU,HMETAFILE,HMODULE,HMONITOR,HPALETTE,HPEN,HRESULT,HRGN,HRSRC,HSZ,HWINSTA,HWND,INT,INT_PTR,INT32,INT64,LANGID,LCID,LCTYPE,LGRPID,LONG,LONGLONG,LONG_PTR,LONG32,LONG64,LPARAM,LPBOOL,LPBYTE,LPCOLORREF,LPCSTR,LPCTSTR,LPCVOID,LPCWSTR,LPDWORD,LPHANDLE,LPINT,LPLONG,LPSTR,LPTSTR,LPVOID,LPWORD,LPWSTR,LRESULT,PBOOL,PBOOLEAN,PBYTE,PCHAR,PCSTR,PCTSTR,PCWSTR,PDWORDLONG,PDWORD_PTR,PDWORD32,PDWORD64,PFLOAT,PHALF_PTR,PHANDLE,PHKEY,PINT,PINT_PTR,PINT32,PINT64,PLCID,PLONG,PLONGLONG,PLONG_PTR,PLONG32,PLONG64,POINTER_32,POINTER_64,PSHORT,PSIZE_T,PSSIZE_T,PSTR,PTBYTE,PTCHAR,PTSTR,PUCHAR,PUHALF_PTR,PUINT,PUINT_PTR,PUINT32,PUINT64,PULONG,PULONGLONG,PULONG_PTR,PULONG32,PULONG64,PUSHORT,PVOID,PWCHAR,PWORD,PWSTR,SC_HANDLE,SC_LOCK,SERVICE_STATUS_HANDLE,SHORT,SIZE_T,SSIZE_T,TBYTE,TCHAR,UCHAR,UHALF_PTR,UINT,UINT_PTR,UINT32,UINT64,ULONG,ULONGLONG,ULONG_PTR,ULONG32,ULONG64,USHORT,USN,VOID,WCHAR,WORD,WPARAM,STRING,atom,bool,boolean,byte,char,colorref,dword,dwordlong,dword_ptr,dword32,dword64,float,haccel,half_ptr,handle,hbitmap,hbrush,hcolorspace,hconv,hconvlist,hcursor,hdc,hddedata,hdesk,hdrop,hdwp,henhmetafile,hfile,hfont,hgdiobj,hglobal,hhook,hicon,hinstance,hkey,hkl,hlocal,hmenu,hmetafile,hmodule,hmonitor,hpalette,hpen,hresult,hrgn,hrsrc,hsz,hwinsta,hwnd,int,int_ptr,int32,int64,langid,lcid,lctype,lgrpid,long,longlong,long_ptr,long32,long64,lparam,lpbool,lpbyte,lpcolorref,lpcstr,lpctstr,lpcvoid,lpcwstr,lpdword,lphandle,lpint,lplong,lpstr,lptstr,lpvoid,lpword,lpwstr,lresult,pbool,pboolean,pbyte,pchar,pcstr,pctstr,pcwstr,pdwordlong,pdword_ptr,pdword32,pdword64,pfloat,phalf_ptr,phandle,phkey,pint,pint_ptr,pint32,pint64,plcid,plong,plonglong,plong_ptr,plong32,plong64,pointer_32,pointer_64,pshort,psize_t,pssize_t,pstr,ptbyte,ptchar,ptstr,puchar,puhalf_ptr,puint,puint_ptr,puint32,puint64,pulong,pulonglong,pulong_ptr,pulong32,pulong64,pushort,pvoid,pwchar,pword,pwstr,sc_handle,sc_lock,service_status_handle,short,size_t,ssize_t,tbyte,tchar,uchar,uhalf_ptr,uint,uint_ptr,uint32,uint64,ulong,ulonglong,ulong_ptr,ulong32,ulong64,ushort,usn,void,wchar,word,wparam,string,NTSTATUS,PIRP,PDEVICE_OBJECT,PDRIVER_OBJECT,PUNICODE_STRING,UNICODE_STRING,char,bool,short,int,__int32,__int64,__int8,__int16,long,float,double,__wchar_t,clock_t,_complex,_dev_t,_diskfree_t,div_t,ldiv_t,_exception,_EXCEPTION_POINTERS,FILE,_finddata_t,_finddatai64_t,_wfinddata_t,_wfinddatai64_t,__finddata64_t,__wfinddata64_t,_FPIEEE_RECORD,fpos_t,_HEAPINFO,_HFILE,lconv,intptr_t,jmp_buf,mbstate_t,_off_t,_onexit_t,_PNH,ptrdiff_t,_purecall,_handler,sig_atomic_t,size_t,_stat,__stat64,_stati64,terminate_function,time_t,__time64_t,_timeb,__timeb64,tm,uintptr_t,_utimbuf,va_list,wchar_t,wctrans_t,wctype_t,wint_t,signed,main,printf,vector,VECTOR,queue,QUEUE,priority_queue,PRIORITY_QUEUE,deque,DEQUE,stack,STACK,pair,PAIR");
	//增加对驱动源码的支持
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\/<>(){}[]\"'\r\n\t\\=+-|*%@$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "";
			this._dealAPI		= true;
			break;
		case "css":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("ascent,azimuth,background-attachment,background-color,background-image,background-position,background-repeat,background,baseline,bbox,border-collapse,border-color,border-spacing,border-style,border-top,border-right,border-bottom,border-left,border-top-color,border-right-color,border-bottom-color,border-left-color,border-top-style,border-right-style,border-bottom-style,border-left-style,border-top-width,border-right-width,border-bottom-width,border-left-width,border-width,border,cap-height,caption-side,centerline,clear,clip,color,content,counter-increment,counter-reset,cue-after,cue-before,cue,cursor,definition-src,descent,direction,display,elevation,empty-cells,float,font-size-adjust,font-family,font-size,font-stretch,font-style,font-variant,font-weight,font,height,letter-spacing,line-height,list-style-image,list-style-position,list-style-type,list-style,margin-top,margin-right,margin-bottom,margin-left,margin,marker-offset,marks,mathline,max-height,max-width,min-height,min-width,orphans,outline-color,outline-style,outline-width,outline,overflow,padding-top,padding-right,padding-bottom,padding-left,padding,page,page-break-after,page-break-before,page-break-inside,pause,pause-after,pause-before,pitch,pitch-range,play-during,position,quotes,richness,size,slope,src,speak-header,speak-numeral,speak-punctuation,speak,speech-rate,stemh,stemv,stress,table-layout,text-align,text-decoration,text-indent,text-shadow,text-transform,unicode-bidi,unicode-range,units-per-em,vertical-align,visibility,voice-family,volume,white-space,widows,width,widths,word-spacing,x-height,z-index");
			this._commonObjects = this.str2hashtable("above,absolute,all,always,aqua,armenian,attr,aural,auto,avoid,baseline,behind,below,bidi-override,black,blink,block,blue,bold,bolder,both,bottom,braille,capitalize,caption,center,center-left,center-right,circle,close-quote,code,collapse,compact,condensed,continuous,counter,counters,crop,cross,crosshair,cursive,dashed,decimal,decimal-leading-zero,default,digits,disc,dotted,double,embed,embossed,e-resize,expanded,extra-condensed,extra-expanded,fantasy,far-left,far-right,fast,faster,fixed,format,fuchsia,gray,green,groove,handheld,hebrew,help,hidden,hide,high,higher,icon,inline-table,inline,inset,inside,invert,italic,justify,landscape,large,larger,left-side,left,leftwards,level,lighter,lime,line-through,list-item,local,loud,lower-alpha,lowercase,lower-greek,lower-latin,lower-roman,lower,low,ltr,marker,maroon,medium,message-box,middle,mix,move,narrower,navy,ne-resize,no-close-quote,none,no-open-quote,no-repeat,normal,nowrap,n-resize,nw-resize,oblique,olive,once,open-quote,outset,outside,overline,pointer,portrait,pre,print,projection,purple,red,relative,repeat,repeat-x,repeat-y,rgb,ridge,right,right-side,rightwards,rtl,run-in,screen,scroll,semi-condensed,semi-expanded,separate,se-resize,show,silent,silver,slower,slow,small,small-caps,small-caption,smaller,soft,solid,speech,spell-out,square,s-resize,static,status-bar,sub,super,sw-resize,table-caption,table-cell,table-column,table-column-group,table-footer-group,table-header-group,table-row,table-row-group,teal,text-bottom,text-top,thick,thin,top,transparent,tty,tv,ultra-condensed,ultra-expanded,underline,upper-alpha,uppercase,upper-latin,upper-roman,url,visible,wait,white,wider,w-resize,x-fas");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "";
			break;
		case "php":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("and,or,xor,__FILE__,__LINE__,array,as,break,case,cfunction,class,const,continue,declare,default,die,do,else,elseif,empty,enddeclare,endfor,endforeach,endif,endswitch,endwhile,extends,for,foreach,function,include,include_once,global,if,new,old_function,return,static,switch,use,require,require_once,var,while,__FUNCTION__,__CLASS__,__METHOD__,abstract,interface,public,implements,extends,private,protected,throw");
			this._commonObjects = this.str2hashtable("abs,acos,acosh,addcslashes,addslashes,array_change_key_case,array_chunk,array_combine,array_count_values,array_diff,array_diff_assoc,array_diff_key,array_diff_uassoc,array_diff_ukey,array_fill,array_filter,array_flip,array_intersect,array_intersect_assoc,array_intersect_key,array_intersect_uassoc,array_intersect_ukey,array_key_exists,array_keys,array_map,array_merge,array_merge_recursive,array_multisort,array_pad,array_pop,array_product,array_push,array_rand,array_reduce,array_reverse,array_search,array_shift,array_slice,array_splice,array_sum,array_udiff,array_udiff_assoc,array_udiff_uassoc,array_uintersect,array_uintersect_assoc,array_uintersect_uassoc,array_unique,array_unshift,array_values,array_walk,array_walk_recursive,atan,atan2,atanh,base64_decode,base64_encode,base_convert,basename,bcadd,bccomp,bcdiv,bcmod,bcmul,bindec,bindtextdomain,bzclose,bzcompress,bzdecompress,bzerrno,bzerror,bzerrstr,bzflush,bzopen,bzread,bzwrite,ceil,chdir,checkdate,checkdnsrr,chgrp,chmod,chop,chown,chr,chroot,chunk_split,class_exists,closedir,closelog,copy,cos,cosh,count,count_chars,date,decbin,dechex,decoct,deg2rad,delete,ebcdic2ascii,echo,empty,end,ereg,ereg_replace,eregi,eregi_replace,error_log,error_reporting,escapeshellarg,escapeshellcmd,eval,exec,exit,exp,explode,extension_loaded,feof,fflush,fgetc,fgetcsv,fgets,fgetss,file_exists,file_get_contents,file_put_contents,fileatime,filectime,filegroup,fileinode,filemtime,fileowner,fileperms,filesize,filetype,floatval,flock,floor,flush,fmod,fnmatch,fopen,fclose,fpassthru,fprintf,fputcsv,fputs,fread,fscanf,fseek,fsockopen,fstat,ftell,ftok,getallheaders,getcwd,getdate,getenv,gethostbyaddr,gethostbyname,gethostbynamel,getimagesize,getlastmod,getmxrr,getmygid,getmyinode,getmypid,getmyuid,getopt,getprotobyname,getprotobynumber,getrandmax,getrusage,getservbyname,getservbyport,gettext,gettimeofday,gettype,glob,gmdate,gmmktime,ini_alter,ini_get,ini_get_all,ini_restore,ini_set,interface_exists,intval,ip2long,is_a,is_array,is_bool,is_callable,is_dir,is_double,is_executable,is_file,is_finite,is_float,is_infinite,is_int,is_integer,is_link,is_long,is_nan,is_null,is_numeric,is_object,is_readable,is_real,is_resource,is_scalar,is_soap_fault,is_string,is_subclass_of,is_uploaded_file,is_writable,is_writeable,mkdir,mktime,nl2br,parse_ini_file,parse_str,parse_url,passthru,pathinfo,readlink,realpath,rewind,rewinddir,rmdir,round,str_ireplace,str_pad,str_repeat,str_replace,str_rot13,str_shuffle,str_split,str_word_count,strcasecmp,strchr,strcmp,strcoll,strcspn,strftime,strip_tags,stripcslashes,stripos,stripslashes,stristr,strlen,strnatcasecmp,strnatcmp,strncasecmp,strncmp,strpbrk,strpos,strptime,strrchr,strrev,strripos,strrpos,strspn,strstr,strtok,strtolower,strtotime,strtoupper,strtr,strval,substr,substr_compare");
			this._tags			= this.str2hashtable("html,head,body,title,style,script,language,input,select,div,span,button,img,iframe,frame,frameset,table,tr,option,a,p,td,caption,form,font,meta,textarea",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "<!--";
			this._dealTag		= false;
			break;
		case "delphi":
		case "pascal":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("abs,addr,and,ansichar,ansistring,array,as,asm,begin,boolean,byte,cardinal,case,char,class,comp,const,constructor,currency,destructor,div,do,double,downto,else,end,except,exports,extended,false,file,finalization,finally,for,function,goto,if,implementation,in,inherited,int64,initialization,integer,interface,is,label,library,longint,longword,mod,nil,not,object,of,on,or,packed,pansichar,pansistring,pchar,pcurrency,pdatetime,pextended,pint64,pointer,private,procedure,program,property,pshortstring,pstring,pvariant,pwidechar,pwidestring,protected,public,published,raise,real,real48,record,repeat,set,shl,shortint,shortstring,shr,single,smallint,string,then,threadvar,to,true,try,type,unit,until,uses,val,var,varirnt,while,widechar,widestring,with,word,write,writeln,xor,inline,dword,qword,assign,operator");
			this._commonObjects = this.str2hashtable("");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:{}\\/<>()[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= this.str2hashtable("/*");
			this._commentOff	= this.str2hashtable("*/");
			this._ignore		= "";
			this._dealAPI		= true;
			break;			
		case "ruby":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("alias,and,BEGIN,begin,break,case,class,def,define_method,defined,do,each,else,elsif,END,end,ensure,false,for,if,in,module,new,next,nil,not,or,raise,redo,rescue,retry,return,self,super,then,throw,true,undef,unless,until,when,while,yield");
			this._commonObjects = this.str2hashtable("Array,Bignum,Binding,Class,Continuation,Dir,Exception,FalseClass,File::Stat,File,Fixnum,Fload,Hash,Integer,IO,MatchData,Method,Module,NilClass,Numeric,Object,Proc,Range,Regexp,String,Struct::TMS,Symbol,ThreadGroup,Thread,Time,TrueClass");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "<!--";
			break;
		case "python":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("and,assert,break,class,continue,def,del,elif,else,except,exec,finally,for,from,global,if,import,in,is,lambda,not,or,pass,print,raise,return,try,yield,while,None,True,False,self,cls,class");
			this._commonObjects = this.str2hashtable("");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "<!--";
			break;
		case "html":
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("function,void,this,boolean,while,if,return,new,true,false,try,catch,throw,null,else,int,long,do,var");
			this._commonObjects = this.str2hashtable("String,Number,Boolean,RegExp,Error,Math,Date");
			this._tags			= this.str2hashtable("html,head,body,title,style,script,language,input,select,div,span,button,img,iframe,frame,frameset,table,tr,option,a,p,td,caption,form,font,meta,textarea",false);
			this._wordDelimiters= " ,.?!;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._ignore		= "<!--";
			this._dealTag		= true;
			break;
		case "asm":	
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("FRSTOR,LOOPDNE,LOOPD,PREFIX,REPNE,AAA,AAD,AAM,AAS,ADC,ADD,AND,ARPL,BOUND,CBW,CLC,CLD,CLI,CLTS,CMC,CMP,CMPSB,CMPSW,CWD,DAA,DAS,DEC,DIV,ENTER,ESC,HLT,IDIV,IMUL,IN,INC,INSB,INSW,INT,INTO,IRET,LAHF,LAR,LDS,LEA,LEAVE,LES,LGDT,LIDT,LLDT,LMSW,LOCK,LODSB,LODSW,LOOP,LOOPNZ,LOOPZ,LSL,LTR,MOV,MOVSB,MOVSW,MUL,NEG,NOP,NOT,OR,OUT,OUTSB,OUTSW,POP,POPA,POPF,PUSH,PUSHA,PUSHF,RCL,RCR,REP,REPNZ,REPZ,RET,RETN,REFT,ROL,ROR,SAHF,SAR,SAL,SBB,SCASB,SCASW,SGDT,SHL,SHR,SLDT,SMSW,STC,STD,STI,STOSB,STOSW,STR,SUB,TEST,WAIT,VERR,VERW,XCHG,XLAT,XOR,BSF,BSR,BT,BTC,BTR,BTS,CDQ,CWDE,IRETD,LFS,LGS,LSS,MOVSX,MOVZX,POPAD,POPFD,PUSHAD,PUSHFD,SETA,SETB,SETBE,SETE,SETG,SETL,SETLE,SETNB,SETNE,SETNL,SETNO,SETNP,SETNS,SETO,SETP,SETS,SHLD,SHRD,CMPSD,STOSD,LODSD,MOVSD,SCASD,INSD,OUTSD,JECXZ,BSWAP,CMPXCHG,INVD,INVLPG,WBINVD,XADD,FABS,FADD,FADDP,FBLD,FBSTP,FCHS,FCLEX,FCOM,FCOMP,FCOMPP,FDECSTP,FDISI,FDIV,FDIVP,FDIVR,FDIVRP,FENI,FFREE,FIADD,FIACOM,FIACOMP,FIDIV,FIDIVR,FILD,FIMUL,FINCSTP,FINIT,FIST,FISTP,FISUB,FISUBR,FLD,FLDCWR,FLDENV,FLDLG2,FLDLN2,FLDL2E,FLDL2T,FLDPI,FLDZ,FLD1,FLDCW,FMUL,FMULP,FNOP,FNSTS,FPATAN,FPREM,FPTAN,FRNDINT,FSAVENT,FSCALE,FSETPM,FSQRT,FST,FSTCW,FSTENV,FSTP,FSTSW,FSUB,FSUBP,FSUBR,FSUBRP,FTST,FWAIT,FXAM,FXCH,FXTRACT,FYL2X,FYL2XPI,F2XM1,FCOS,FSIN,FPREM1,FSINCOS,FUCOM,FUCOMP,FUCOMPP,CALL");
			this._commonObjects = this.str2hashtable("EAX,AH,AL,EBX,BX,BH,BL,ECX,CX,CH,CL,EDX,DX,DH,DL,ESI,SI,EDI,DI,ESP,SP,EBP,BP,EFLAGS,FLAGS,CS,DS,ES,SS,FS,GS,ST,CR,DR,TR,GDTR,LDTR,IDTR,WORD,BYTE,DWORD,QWORD,FWORD,TBYTE,PTR,SHORT,NEAR,JA,JAE,JB,JBE,JCXZ,JC,JNC,JE,JNGE,JNG,JNL,JG,JGE,JL,JLE,JMP,JNB,JNBE,JNE,JNLE,JNO,JNP,JNZ,JPO,JZ,JO,JP,JS,JNS");	
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " \n\r\t,/?:;\"'{[}]~`%^()*-+=!";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= ";";
			this._escape		= "\\";
			this._commentOn		= "";
			this._commentOff	= "";
			this._ignore		= "";
			this._dealAPI		= true;
			break;
		case "bat":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("append,arp,assoc,at,atmadm,attrib,bootcfg,break,buffers,cacls,call,change,chcp,chdir,chkdsk,chkntfs,cipher,cls,cmd,cmstp,color,commands,comp,compact,convert,copy,country,cprofile,cscript,date,debug,defrag,del,device,devicehigh,dir,diskcomp,diskcopy,diskpart,dos,doskey,dosonly,driveparm,driverquery,echo,echoconfig,edit,edlin,endlocal,eventcreate,eventquery,eventtriggers,evntcmd,exe2bin,exit,expand,fastopen,fc,fcbs,files,filter,find,findstr,finger,flattemp,for,forcedos,format,fsutil,ftp,ftype,getmac,goto,gpresult,gpupdate,graftabl,graphics,help,helpctr,hostname,if,install,ipconfig,ipseccmd,ipxroute,irftp,label,lastdrive,lh,loadfix,loadhigh,lodctr,logman,lpq,lpr,macfile,md,mem,mkdir,mmc,mode,more,mountvol,move,msiexec,msinfo32,nbtstat,net,netstat,nlsfunc,nslookup,ntbackup,ntcmdprompt,ntsd,openfiles,pagefileconfig,path,pathping,pause,pbadmin,pentnt,perfmon,ping,popd,print,prncnfg,prndrvr,prnjobs,prnmngr,prnport,prnqctl,prompt,pushd,query,rasdial,rcp,recover,reg,regsvr32,relog,rem,rename,replace,reset,rexec,rmdir,route,rsh,rsm,runas,sc,schtasks,secedit,services,session,set,setlocal,setver,sfc,share,shell,shift,shutdown,sort,stacks,start,subst,switches,systeminfo,taskkill,tasklist,tcmsetup,telnet,tftp,time,title,tracerpt,tracert,tree,type,typeperf,unlodctr,ver,verify,vol,vssadmin,w32tm,winnt,winnt32,wmic,xcopy,off");
			this._commonObjects = this.str2hashtable("%ALLUSERSPROFILE%,%APPDATA%,%CD%,%CMDCMDLINE%,%CMDEXTVERSION%,%COMPUTERNAME%,%COMSPEC%,%DATE%,%ERRORLEVEL%,%HOMEDRIVE%,%HOMEPATH%,%HOMESHARE%,%,OGONSEVER%,%NUMBER_OF_PROCESSORS%,%OS%,%PATH%,%PATHEXT%,%PROCESSOR_ARCHITECTURE%,%PROCESSOR_IDENTFIER%,%PROCESSOR_LEVEL%,%,ROCESSOR_LEVEL%,%PROMPT%,%RANDOM%,%SYSTEMDRIVE%,%SYSTEMROOT%,%TEMP%and%TMP%,%TIME%,%USERDOMAIN%,%USERNAME%,%UserPrefix%,%WINDIR%");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&:;";
			this._quotation		= this.str2hashtable("\"");
			this._lineComment	= "::";
			this._escape		= "\\";
			break;
		case "pbasic":
			this._caseSensitive	= false;
			this._keywords		= this.str2hashtable("And,Or,Xor,Not,If,EndIf,Else,EndProcedure,While,Wend,Break,Continue,For,Next,ForEach,Next,Gosub,Return,If,Else,EndIf,Repeat,Until,Select,EndSelect,While,Wend,Others,Break,Continue,For,Next,ForEach,Next,Gosub,Swap,End,Return,If,Else,EndIf,Repeat,Until,Select,EndSelect,While,Wend,Others,DefineDim,ReDim,Debug,Enumeration,EndEnumeration,Interface,EndInterface,NewList,Structure,EndStructure,With,EndWith,Global,Procedure,EndProcedure,Protected,Shared,Static,Import,EndImport,Macro,EndMacro,Prototype,Pseudotype,ACos,ASin,ATan,Abs,Date,Day,Month,Hour.Minute,PeekB,PeekC,PeekD,PeekF,PeekL,PeekQ,PeekS,PeekW,BackColor,BillboardX,BillboardY,BillboardZ,Bin,BinQ,Blue,Box,CameraX,CameraY,CameraZ,BillboardGroupX,BillboardGroupY,BillboardGroupZ,Chr,Circle,Cos,Loc,Lof,Log,Log10,Inkey,Input,,Int,IntQ,IsBillboardGroup,IsCamera,IsDatabase,IsDirectory,IsEntity,IsFile,IsFingerprint,IsFont,IsFtp,IsGadget,IsImage,IsLibrary,IsLight,IsMail,IsMaterial,IsMenu,IsMesh,IsModule,IsMovie,IsPalette,IsParticleEmitter,IsProgram,IsRegularExpression,IsScreenActive,IsSerialPort,IsSound,IncludeFile,IsSprite,IsSprite3D,IsStatusBar,IsSysTrayIcon,IsTexture,IsThread,IsToolBar,IsWindow,IsXML,JoystickAxisX,JoystickAxisY,EntityX,EntityY,EntityZ,EventDropX,EventDropY,GadgetX,GadgetY,Line,LineXY,MouseDeltaX,MouseDeltaY,MouseLocate,MouseWheel,MouseX,MouseY,ParticleEmitterX,ParticleEmitterY,ParticleEmitterZ,Sin,SkyBox,SkyDome,SortArray,SortList,SortStructuredArray,SortStructuredList,Str,StrD,StrF,StrQ,StrU,Val,ValD,ValF,ValQ,Year,WindowEvent,WindowHeight,WindowID,WindowMouseX,WindowMouseY,Window,Tan,Second,MinuteHex,HexQ,XMLImageHeight,ImageID,ImageOutput,ImageWidth,OSVersion,On,Error,Exit,Gosub,Goto,Resume,LCase,LSet,LTrim,LastElement,Left,Len,Mid,LibraryID,LightColor,MenuHeight,MenuID,MenuItem,MenuTitle,MeshID,Sqr,Trim,Plot,Point,PokeB,PokeC,PokeD,PokeF,PokeL,PokeQ,PokeS,PokeW,Pow,DataSection,EndDataSection");
			//so many... - -!
			this._commonObjects = this.str2hashtable("Byte,Character,Word,Long,Float,Quad,Double,String,Fixed,Add3DArchive,AddBillboard,AddDate,AddElement,AddGadgetColumn,AddGadgetItem,AddKeyboardShortcut,AddMailAttachment,AddMailAttachmentData,AddMailRecipient,AddMaterialLayer,AddPackFile,AddPackMemory,AddStatusBarField,AddSysTrayIcon,AllocateMemory,AmbientColor,AnimateEntity,Asc,AudioCDLength,AudioCDName,AudioCDStatus,AudioCDTrackLength,AudioCDTrackSeconds,AudioCDTracks,AvailableProgramOutput,AvailableScreenMemory,AvailableSerialPortInput,AvailableSerialPortOutput,DesktopHeight,DesktopMouseX,DesktopMouseY,DesktopName,DesktopWidth,Base64Decoder,Base64Encoder,BillboardGroupLocate,BillboardGroupMaterial,BillboardHeight,BillboardLocate,BillboardWidth,ButtonGadget,ButtonImageGadget,CRC32FileFingerprint,CRC32Fingerprint,CalendarGadget,CallCFunction,CallCFunctionFast,CallFunction,CallFunctionFast,CameraBackColor,CameraFOV,CameraLocate,CameraLookAt,CameraProjection,CameraRange,CameraRenderMode,CatchImage,CatchSound,CatchSprite,CatchXML,ChangeAlphaIntensity,ChangeCurrentElement,ChangeGamma,ChangeListIconGadgetDisplay,ChangeSysTrayIcon,CheckBoxGadget,CheckEntityCollision,CheckFTPConnection,CheckFilename,ChildXMLNode,ClearBillboards,ClearClipboard,ClearConsole,ClearError,ClearGadgetItemList,ClearList,ClearScreen,ClipSprite,CloseConsole,CloseDatabase,CloseFTP,CloseFile,CloseGadgetList,CloseHelp,CloseLibrary,CloseNetworkConnection,CloseNetworkServer,ClosePack,ClosePreferences,CloseProgram,CloseScreen,CloseSerialPort,CloseSubMenu,CloseWindow,ColorRequester,ComboBoxGadget,CompareMemory,CompareMemoryString,ConnectionID,ConsoleColor,ConsoleCursor,ConsoleError,ConsoleLocate,ConsoleTitle,ContainerGadget,CopyDirectory,CopyEntity,CopyFile,CopyImage,CopyLight,CopyMaterial,CopyMemory,CopyMemoryString,CopyMesh,CopySprite,CopyTexture,CopyXMLNode,CountBillboards,CountGadgetItems,CountLibraryFunctions,CountList,CountMaterialLayers,CountProgramParameters,CountRenderedTriangles,CountString,CreateBillboardGroup,CreateCamera,CreateDirectory,CreateEntity,CreateFTPDirectory,CreateFile,CreateGadgetList,CreateImage,CreateImageMenu,CreateLight,CreateMail,CreateMaterial,CreateMenu,CreateMesh,CreateMutex,CreateNetworkServer,CreatePack,CreatePalette,CreateParticleEmitter,CreatePopupImageMenu,CreatePopupMenu,CreatePreferences,CreateRegularExpression,CreateSprite,CreateSprite3D,CreateStatusBar,CreateTerrain,CreateTexture,CreateThread,CreateToolBar,CreateXML,CreateXMLNode,DESFingerprint,DatabaseColumnName,DatabaseColumnType,DatabaseColumns,DatabaseDriverDescription,DatabaseDriverName,DatabaseError,DatabaseQuery,DatabaseUpdate,DateGadget,DayOfWeek,DayOfYear,DefaultPrinter,Delay,DeleteDirectory,DeleteElement,DeleteFTPDirectory,DeleteFTPFile,DeleteFile,DeleteXMLNode,DesktopDepth,DesktopFrequency,DirectoryEntryAttributes,DirectoryEntryDate,DirectoryEntryName,DirectoryEntrySize,DirectoryEntryType,DisASMCommand,DisableGadget,DisableMaterialLighting,DisableMenuItem,DisableToolBarButton,DisableWindow,DisplayAlphaSprite,DisplayPalette,DisplayPopupMenu,DisplayRGBFilter,DisplayShadowSprite,DisplaySolidSprite,DisplaySprite,DisplaySprite3D,DisplayTranslucentSprite,DisplayTransparentSprite,DragFiles,DragImage,DragOSFormats,DragPrivate,DragText,DrawAlphaImage,DrawImage,DrawText,DrawingBuffer,DrawingBufferPitch,DrawingBufferPixelFormat,DrawingFont,DrawingMode,EditorGadget,EjectAudioCD,ElapsedMilliseconds,Ellipse,EnableGadgetDrop,EnableGraphicalConsole,EnableWindowDrop,EnableWorldCollisions,EnableWorldPhysics,Engine3DFrameRate,EntityAnimationLength,EntityLocate,EntityMaterial,EntityPhysicBody,EntityRenderMode,EnvironmentVariableName,EnvironmentVariableValue,Eof,EventClient,EventDropAction,EventDropBuffer,EventDropFiles,EventDropImage,EventDropPrivate,EventDropSize,EventDropText,EventDropType,EventGadget,EventMenu,EventServer,EventType,EventWindow,ExamineDatabaseDrivers,ExamineDesktops,ExamineDirectory,ExamineEnvironmentVariables,ExamineFTPDirectory,ExamineIPAddresses,ExamineJoystick,ExamineKeyboard,ExamineLibraryFunctions,ExamineMD5Fingerprint,ExamineMouse,ExaminePreferenceGroups,ExaminePreferenceKeys,ExamineSHA1Fingerprint,ExamineScreenModes,ExamineWorldCollisions,ExamineXMLAttributes,ExplorerComboGadget,ExplorerListGadget,ExplorerTreeGadget,ExportXML,ExportXMLSize,ExtractRegularExpression,FTPDirectoryEntryAttributes,FTPDirectoryEntryDate,FTPDirectoryEntryName,FTPDirectoryEntrySize,FTPDirectoryEntryType,FTPProgress,FileBuffersSize,FileID,FileSeek,FileSize,FillArea,FindString,FinishDirectory,FinishFTPDirectory,FinishFingerprint,FirstDatabaseRow,FirstElement,FirstWorldCollisionEntity,FlipBuffers,FlushFileBuffers,Fog,FontID,FontRequester,FormatDate,FormatXML,Frame3DGadget,FreeBillboardGroup,FreeCamera,FreeEntity,FreeFont,FreeGadget,FreeImage,FreeLight,FreeMail,FreeMaterial,FreeMemory,FreeMenu,FreeMesh,FreeModule,FreeMovie,FreeMutex,FreePalette,FreeParticleEmitter,FreeRegularExpression,FreeSound,FreeSprite,FreeSprite3D,FreeStatusBar,FreeTexture,FreeToolBar,FreeXML,FrontColor,GadgetHeight,GadgetID,GadgetItemID,GadgetToolTip,GadgetType,GadgetWidth,GetActiveGadget,GetActiveWindow,GetClientIP,GetClientPort,GetClipboardImage,GetClipboardText,GetCurrentDirectory,GetCurrentEIP,GetDatabaseDouble,GetDatabaseFloat,GetDatabaseLong,GetDatabaseQuad,GetDatabaseString,GetDisASMString,GetEntityAnimationTime,GetEntityFriction,GetEntityMass,GetEnvironmentVariable,GetErrorAddress,GetErrorCounter,GetErrorDLL,GetErrorDescription,GetErrorLineNR,GetErrorModuleName,GetErrorNumber,GetErrorRegister,GetExtensionPart,GetFTPDirectory,GetFileAttributes,GetFileDate,GetFilePart,GetFunction,GetFunctionEntry,GetGadgetAttribute,GetGadgetColor,GetGadgetData,GetGadgetFont,GetGadgetItemAttribute,GetGadgetItemColor,GetGadgetItemData,GetGadgetItemState,GetGadgetItemText,GetGadgetState,GetGadgetText,GetHTTPHeader,GetHomeDirectory,GetMailAttribute,GetMailBody,GetMenuItemState,GetMenuItemText,GetMenuTitleText,GetModulePosition,GetModuleRow,GetPaletteColor,GetPathPart,GetSerialPortStatus,GetTemporaryDirectory,GetToolBarButtonState,GetURLPart,GetWindowColor,GetWindowState,GetWindowTitle,GetXMLAttribute,GetXMLEncoding,GetXMLNodeName,GetXMLNodeOffset,GetXMLNodeText,GetXMLStandalone,GoToEIP,GrabImage,GrabSprite,Green,HideBillboardGroup,HideEntity,HideGadget,HideLight,HideMenu,HideParticleEmitter,HideWindow,HostName,Hour,HyperLinkGadget,IPAddressField,IPAddressGadget,IPString,ImageDepth,ImageGadget,InitAudioCD,InitEngine3D,InitJoystick,InitKeyboard,InitMouse,InitMovie,InitNetwork,InitPalette,InitScintilla,InitSound,InitSprite,InitSprite3D,InputRequester,InsertElement,JoystickButton,KeyboardInkey,KeyboardMode,KeyboardPushed,KeyboardReleased,KillProgram,KillThread,LibraryFunctionAddress,LibraryFunctionName,LightLocate,LightSpecularColor,ListIconGadget,ListIndex,ListViewGadget,LoadFont,LoadImage,LoadMesh,LoadModule,LoadMovie,LoadPalette,LoadSound,LoadSprite,LoadTexture,LoadXML,LockMutex,MD5FileFingerprint,MD5Fingerprint,MDIGadget,MailProgress,MainXMLNode,MakeIPAddress,MatchRegularExpression,MaterialAmbientColor,MaterialBlendingMode,MaterialDiffuseColor,MaterialFilteringMode,MaterialID,MaterialShadingMode,MaterialSpecularColor,MemorySize,MemoryStringLength,MenuBar,MessageRequester,ModuleVolume,MouseButton,MoveBillboard,MoveBillboardGroup,MoveCamera,MoveEntity,MoveLight,MoveMemory,MoveParticleEmitter,MoveXMLNode,MovieAudio,MovieHeight,MovieInfo,MovieLength,MovieSeek,MovieStatus,MovieWidth,NetworkClientEvent,NetworkServerEvent,NewPrinterPage,NextDatabaseDriver,NextDatabaseRow,NextDirectoryEntry,NextElement,NextEnvironmentVariable,NextFTPDirectoryEntry,NextFingerprint,NextIPAddress,NextLibraryFunction,NextPackFile,NextPreferenceGroup,NextPreferenceKey,NextScreenMode,NextSelectedFilename,NextWorldCollision,NextXMLAttribute,NextXMLNode,OpenConsole,OpenDatabase,OpenDatabaseRequester,OpenFTP,OpenFile,OpenFileRequester,OpenGadgetList,OpenHelp,OpenLibrary,OpenNetworkConnection,OpenPack,OpenPreferences,OpenScreen,OpenSerialPort,OpenSubMenu,OpenWindow,OpenWindowedScreen,OptionGadget,PackFileSize,PackMemory,PackerCallback,PanelGadget,ParentXMLNode,Parse3DScripts,ParseDate,ParticleColorFader,ParticleColorRange,ParticleEmissionRate,ParticleEmitterDirection,ParticleEmitterLocate,ParticleMaterial,ParticleSize,ParticleTimeToLive,ParticleVelocity,PathRequester,PauseAudioCD,PauseMovie,PauseThread,PlayAudioCD,PlayModule,PlayMovie,PlaySound,PreferenceComment,PreferenceGroup,PreferenceGroupName,PreferenceKeyName,PreferenceKeyValue,PreviousDatabaseRow,PreviousElement,PreviousXMLNode,Print,PrintN,PrintRequester,PrinterOutput,PrinterPageHeight,PrinterPageWidth,ProgramExitCode,ProgramFilename,ProgramID,ProgramParameter,ProgramRunning,ProgressBarGadget,RGB,RSet,RTrim,Random,RandomSeed,RawKey,ReAllocateMemory,ReadByte,ReadCharacter,ReadConsoleData,ReadData,ReadDouble,ReadFile,ReadFloat,ReadLong,ReadPreferenceDouble,ReadPreferenceFloat,ReadPreferenceLong,ReadPreferenceQuad,ReadPreferenceString,ReadProgramData,ReadProgramError,ReadProgramString,ReadQuad,ReadSerialPortData,ReadString,ReadStringFormat,ReadWord,ReceiveFTPFile,ReceiveHTTPFile,ReceiveNetworkData,ReceiveNetworkFile,Red,RegularExpressionError,ReleaseMouse,RemoveBillboard,RemoveEnvironmentVariable,RemoveGadgetColumn,RemoveGadgetItem,RemoveKeyboardShortcut,RemoveMailRecipient,RemoveMaterialLayer,RemovePreferenceGroup,RemovePreferenceKey,RemoveString,RemoveSysTrayIcon,RemoveXMLAttribute,RenameFTPFile,RenameFile,RenderMovieFrame,RenderWorld,ReplaceRegularExpression,ReplaceString,ResetList,ResizeBillboard,ResizeEntity,ResizeGadget,ResizeImage,ResizeMovie,ResizeParticleEmitter,ResizeWindow,ResolveXMLAttributeName,ResolveXMLNodeName,ResumeAudioCD,ResumeMovie,ResumeThread,Right,RootXMLNode,RotateBillboardGroup,RotateCamera,RotateEntity,RotateMaterial,RotateSprite3D,Round,RunProgram,SHA1FileFingerprint,SHA1Fingerprint,SaveFileRequester,SaveImage,SaveSprite,SaveXML,ScaleEntity,ScintillaGadget,ScintillaSendMessage,ScreenID,ScreenModeDepth,ScreenModeHeight,ScreenModeRefreshRate,ScreenModeWidth,ScreenOutput,ScrollAreaGadget,ScrollBarGadget,ScrollMaterial,SecondWorldCollisionEntity,SelectElement,SelectedFilePattern,SelectedFontColor,SelectedFontName,SelectedFontSize,SelectedFontStyle,SendFTPFile,SendMail,SendNetworkData,SendNetworkFile,SendNetworkString,SerialPortError,SerialPortID,SerialPortTimeouts,SetActiveGadget,SetActiveWindow,SetClipboardImage,SetClipboardText,SetCurrentDirectory,SetDragCallback,SetDropCallback,SetEntityAnimationTime,SetEntityFriction,SetEntityMass,SetEnvironmentVariable,SetErrorNumber,SetFTPDirectory,SetFileAttributes,SetFileDate,SetFrameRate,SetGadgetAttribute,SetGadgetColor,SetGadgetData,SetGadgetFont,SetGadgetItemAttribute,SetGadgetItemColor,SetGadgetItemData,SetGadgetItemState,SetGadgetItemText,SetGadgetState,SetGadgetText,SetMailAttribute,SetMailBody,SetMenuItemState,SetMenuItemText,SetMenuTitleText,SetMeshData,SetModulePosition,SetPaletteColor,SetRefreshRate,SetSerialPortStatus,SetToolBarButtonState,SetURLPart,SetWindowCallback,SetWindowColor,SetWindowState,SetWindowTitle,SetXMLAttribute,SetXMLEncoding,SetXMLNodeName,SetXMLNodeOffset,SetXMLNodeText,SetXMLStandalone,SmartWindowRefresh,SoundFrequency,SoundPan,SoundVolume,Space,SpinGadget,SplitterGadget,Sprite3DBlendingMode,Sprite3DQuality,SpriteCollision,SpriteDepth,SpriteHeight,SpriteID,SpriteOutput,SpritePixelCollision,SpriteWidth,Start3D,StartDrawing,StartPrinting,StartSpecialFX,StatusBarHeight,StatusBarID,StatusBarIcon,StatusBarText,StickyWindow,Stop3D,StopAudioCD,StopDrawing,StopModule,StopMovie,StopPrinting,StopSound,StopSpecialFX,StringByteLength,StringField,StringGadget,SwapElements,SysTrayIconToolTip,TerrainHeight,TextGadget,TextHeight,TextWidth,TextureHeight,TextureID,TextureOutput,TextureWidth,ThreadID,ThreadPriority,ToolBarHeight,ToolBarID,ToolBarImageButton,ToolBarSeparator,ToolBarStandardButton,ToolBarToolTip,TrackBarGadget,TransformSprite3D,TransparentSpriteColor,TreeGadget,TruncateFile,TryLockMutex,UCase,URLDecoder,URLEncoder,UnlockMutex,UnpackMemory,UseAudioCD,UseBuffer,UseFLACSoundDecoder,UseGadgetList,UseJPEGImageDecoder,UseJPEGImageEncoder,UseODBCDatabase,UseOGGSoundDecoder,UsePNGImageDecoder,UsePNGImageEncoder,UseSQLiteDatabase,UseTGAImageDecoder,UseTIFFImageDecoder,WaitProgram,WaitThread,WaitWindowEvent,WebGadget,WebGadgetPath,WindowOutput,WindowWidth,WindowX,WindowY,WorldGravity,WorldShadows,WriteByte,WriteCharacter,WriteConsoleData,WriteData,WriteDouble,WriteFloat,WriteLong,WritePreferenceDouble,WritePreferenceFloat,WritePreferenceLong,WritePreferenceQuad,WritePreferenceString,WriteProgramData,WriteProgramString,WriteProgramStringN,WriteQuad,WriteSerialPortData,WriteSerialPortString,WriteString,WriteStringFormat,WriteStringN,WriteWord,XMLAttributeName,XMLAttributeValue,XMLChildCount,XMLError,XMLErrorLine,XMLErrorPosition,XMLNodeFromID,XMLNodeFromPath,XMLNodePath,XMLNodeType,XMLStatus,ZoomSprite3D");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&:~";
			this._quotation		= this.str2hashtable("\"");
			this._lineComment	= ";";
			this._escape		= "\\";
			this._dealAPI		= true;
			break;
		case "nsi":
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("!include,!addincludedir,!addplugindir,!appendfile,!cd,!delfile,!echo,!error,!execute,!packhdr,!system,!tempfile,!warning,!verbose,!define,!undef,!ifdef,!ifndef,!ifmacrodef,!ifmacrondef,!else,!endif,!insertmacro,!macro,!macroend,Icon,InstallButtonText,InstallColors,InstallDir,InstallDirRegKey,InstProgressFlags,InstType,LicenseBkColor,LicenseData,LicenseForceSelection,LicenseText,MiscButtonText,Name,OutFile,SetFont,ShowInstDetails,ShowUninstDetails,SilentInstall,SilentUnInstall,SpaceTexts,SubCaption,UninstallButtonText,UninstallCaption,UninstallIcon,UninstallSubCaption,UninstallText,WindowIcon,XPStyle,AllowSkipFiles,FileBufSize,Section,SectionEnd,Delete,Exec,ExecShell,ExecWait,File,Rename,ReserveFile,RMDir,SetOutPath,Abort,Call,ClearErrors,Goto,IfAbort,IfErrors,IfFileExists,IfRebootFlag,Function,FunctionEnd,IfSilent,IntCmp,IntCmpU,MessageBox,Return,Quit,SetErrors,StrCmp,FFind,Sleep,StrCpy,StrLen,Exch,Pop,Push,IntFmt,IntOp,Reboot,LangString,LicenseLangString,SectionGroupEnd,SectionGroup");
			this._commonObjects = this.str2hashtable("InstallOptions,Page,UninstPage,PageEx,PageExEnd,PageCallbacks,onGUIInit,onInit,onInstFailed,onInstSuccess,onGUIEnd,onMouseOverSection,onRebootFailed,onSelChange,onUserAbort,onVerifyInstDir,${__FILE__},${__LINE__},${__DATE__},${__TIME__},${__TIMESTAMP__},Locate,GetSize,DriveSpace,GetDrives,GetTime,GetFileAttributes,GetFileVersion,GetExeName,GetExePath,GetParameters,GetOptions,GetRoot,GetParent,GetFileName,GetBaseName,GetFileExt,BannerTrimPath,DirState,RefreshShellIcons,LineFind,LineRead,FileReadFromEnd,LineSum,FileJoin,TextCompare,ConfigRead,ConfigWrite,FileRecode,TrimNewLines,WordFind,WordFind2X,WordFind3X,WordReplace,WordAdd,WordInsert,StrFilter,VersionCompare,VersionConvert,Locate,GetSize,DriveSpace,GetDrives,GetTime,GetFileAttributes,GetFileVersion,GetExeName,GetExePath,GetParameters,GetOptions,GetRoot,GetParent,GetFileName,GetBaseName,GetFileExt,BannerTrimPath,DirState,RefreshShellIcons,LineFind,LineRead,FileReadFromEnd,LineSum,FileJoin,TextCompare,ConfigRead,ConfigWrite,FileRecode,TrimNewLines,WordFind,WordFind2X,WordFind3X,WordReplace,WordAdd,WordInsert,StrFilter,VersionCompare,VersionConvert,Find,FindI,FindLast,FindLastI,StrStr,StrStrI,StrRStrI,TrimLine,TrimLineEx,Replace,ReplaceEx,VerCmp,StrCase,StrToHex,ConvertANSIToUTF8,ConvertUTF8ToANSI,GetParent,GetChild,GetFileExt,DumpLog,AppendFile,DelFileByLog,RMDir,ForEachFile,ForEachFileEx,SearchFile,IsWritable,GetVolume,TrimDir,FileTimeCmp,GetFileSize,CompactPathEx,RenameExtension,RelativePathTo,PathCanonicalize,RemoveArgs,CheckFileEncoding,CopyReg,ReadRegBin,ReadRegMultiStr,WriteRegBin,WriteRegStrW,SHCopyKey,SHRegGetPath,GetRegKeyCount,GetRegValueCount,CloseApp,IsWinNT,GetComputerName,GetInstallerName,GetLocaleInfo,GetWinName,GetUserName,RefreshIcon,ClearDetail,GetDllVersion,LoadImage,DeleteObject,DestroyCursor,DestroyIcon,MessageBox,WriteEnvStr,DeleteEnvStr,StartRadioButtons,RadioButton,EndRadioButtons,EndRadioButtons2,AddBrandingImage,AllowRootDirInstall,AutoCloseWindow,BGFont,BGGradient,BrandingText,Caption,ChangeUI,CheckBitmap,CompletedText,ComponentText,CRCCheck,DetailsButtonText,DirText,DirVar,DirVerify,FileErrorText,SetCompress,WriteIniStr,SetCompressor,SetCompressorDictSize,SetDatablockOptimize,SetDateSave,InitPluginsDir,SetErrorLevel,SetShellVarContext,SetOverwrite,SetPluginUnload,VIAddVersionKey,VIProductVersion,DeleteINISec,DeleteINIStr,DeleteRegKey,DeleteRegValue,EnumRegKey,EnumRegValue,ExpandEnvStrings,FlushINI,ReadEnvStr,ReadINIStr,ReadRegDWORD,ReadRegStr,WriteINIStr,WriteRegBin,WriteRegDWORD,WriteRegStr,WriteRegExpandStr,CallInstDLL,CopyFiles,CreateDirectory,CreateShortCut,GetDLLVersion,GetDLLVersionLocal,GetFileTime,GetFileTimeLocal,GetFullPathName,GetTempFileName,SearchPath,SetFileAttributes,RegDLL,UnRegDLL,GetCurrentAddress,GetFunctionAddress,GetLabelAddress,oleClose,FileOpen,FileRead,FileReadByte,FileSeek,FileWrite,FileWriteByte,FindClose,FindFirst,WriteUninstaller,GetErrorLevel,GetInstDirError,SetRebootFlag,LogSet,LogText,SectionSetFlags,SectionGetFlags,SectionSetText,SectionGetText,SectionSetInstTypes,SectionGetInstTypes,SectionSetSize,SectionGetSize,SetCurInstType,GetCurInstType,InstTypeSetText,InstTypeGetText,BringToFront,CreateFont,DetailPrint,EnableWindow,FindWindow,GetDlgItem,HideWindow,IsWindow,LockWindow,SendMessage,SetAutoClose,SetBrandingImage,SetDetailsView,SetDetailsPrint,SetCtlColors,SetSilent,ShowWindow,LoadLanguageFile");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.;:\\/<>(){}[]\"'\r\n\t=+-|*%@#^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= ";";
			this._escape		= "\\";
			this._commentOn		= "/*";
			this._commentOff	= "*/";
			this._dealAPI		= true;
			break;
		case "as": //Action Script
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("isActive,a,abs,acos,add,addListener,addProperty,addheader,align,allowDomain,appendChild,apply,arguments,argumentscallee,argumentscaller,asin,atan,atan2,attachAudio,attachMovie,attachSound,attachVideo,attributes,autoSize,background,backgroundColor,beginFill,beginGradientFill,blockIndent,bold,border,borderColor,bottomScroll,break,broadcastMessage,bullet,get,install,list,uninstall,call,callee,caller,capabilities,case,ceil,charAt,charCodeAt,childNodes,chr,clear,clearInterval,cloneNode,close,color,concat,condenseWhite,connect,constructor,contentType,continue,cos,createElement,createEmptyMovieClip,createTextField,createTextNode,curveTo,data,decode,default,delete,do,docTypeDecl,domain,dragOut,dragOver,duplicateMovieClip,duration,else,embedFonts,enabled,endFill,enterFrame._escape,eval,exp,false,firstChild,floor,flush,focusEnabled,font,for,fromCharCode,fscommand,function,get,getAscii,getBeginIndex,getBounds,getBytesLoaded,getBytesTotal,getCaretIndex,getCode,getCookie,getDate,getDay,getDepth,getDuration,getEndIndex,getFocus,getFontList,getFullYear,getHours,getMilliseconds,getMinutes,getMonth,getNewTextFormat,getPan,getPosition,getProperty,getRGB,getSeconds,getSize,getTextExtent,getTextFormat,getTime,getTimer,getTimezoneOffset,getTransform,getURL,getUTCDate,getUTCDay,getUTCFullYear,getUTCHours,getUTCMilliseconds,getUTCMinutes,getUTCMonth,getUTCSeconds,getUTCYear,getVersion,getVolume,getYear,globalToLocal,gotoAndPlay,gotoAndStop,hasAccessibility,hasAudio,hasAudioEncoder,hasChildNodes,hasMP3,hasOwnProperty,hasVideoEncoder,height,hide,hitArea,hitTest,hscroll,html,htmlText,if,ifFrameLoaded,ignoreWhite,in,indent,indexOf,input,insertBefore,install,instanceof,int,isActive,isDebugger,isDown,isFinite,isNaN,isPropertyEnumerable,isPrototypeOf,isToggled,italic,join,getAscii,getCode,isDown,isToggled,keyDown,keyPress,keyUp,LoadVars,LocalConnection,language,lastChild,lastIndexOf,leading,leftMargin,length,lineStyle,lineTo,list,load,loadMovie,loadMovieNum,loadSound,loadVariables,loadVariablesNum,loaded,localToGlobal,log,abs,acos,asin,atan,atan2,ceil,cos,exp,floor,log,max,min,pow,random,round,sin,sqrt,tan,hide,show,manufacturer,max,maxChars,maxhscroll,maxscroll,mbchr,mblength,mbord,mbsubstring,metaInfo,meth,min,mouseDown,mouseMove,mouseUp,moveTo,multiline,new,newline,nextFrame,nextScene,nextSibling,nodeName,nodeType,nodeValue,null,on,onChanged,onClipEvent,onClose,onConnect,onData,onDragOut,onDragOver,onEnterFrame,onKeyDown,onKeyUp,onKillFocus,onLoad,onMouseDown,onMouseMove,onMouseUp,onPress,onRelease,onReleaseOutside,onResize,onRollOut,onRollOver,onScroller,onSetFocus,onSoundComplete,onUnload,onXML,registerClass,parentNode,parseFloat,parseInt,parseXML,password,pause,pixelAspectRatio,play,pop,position,pow,press,prevFrame,prevScene,previousSibling,print,printAsBitmap,printAsBitmapNum,printNum,prototype,publish,push,random,receiveAudio,receiveVideo,registerClass,release,releaseOutside,removeListener,removeMovieClip,removeNode,removeTextField,replaceSel,restrict,return,reverse,rightMargin,rollOut,rollOver,round,getBeginIndex,getCaretIndex,getEndIndex,getFocus,setFocus,setSelection,align,height,scaleMode,showMenu,width,fromCharCode,hasAccessibility,hasAudio,hasAudioEncoder,hasMP3,hasVideoEncoder,input,isDebugger,language,manufacturer,os,pixelAspectRatio,screenColor,screenDPI,screenResolutionX,screenResolutionY,serverString,version,allowDomain,scaleMode,screenColor,screenDPI,screenResolutionX,screenResolutionY,scroll,security,seek,selectable,send,sendAndLoad,serverString,set,setBufferTime,setCookie,setDate,setDuration,setFocus,setFps,setFullYear,setGain,setHours,setInterval,setKeyFrameInterval,setLoopback,setMask,setMilliseconds,setMinutes,setMode,setMonth,setMotionLevel,setNewTextFormat,setPan,setPosition,setProperty,setQuality,setRGB,setRate,setSeconds,setSelection,setSilenceLevel,setTextFormat,setTime,setTransform,setUTCDate,setUTCFullYear,setUTCHours,setUTCMilliseconds,setUTCMinutes,setUTCMonth,setUTCSeconds,setUseEchoSuppression,setVolume,setYear,shift,show,showMenu,sin,size,slice,sort,sortOn,splice,split,sqrt,start,startDrag,status,stop,stopAllSounds,stopDrag,substr,substring,super,swapDepths,switch,tabChildren,tabEnabled,tabIndex,tabStops,tan,target,targetPath,tellTarget,text,textColor,textHeight,textWidth,this,toLocaleString,toLowerCase,toString,toUpperCase,toggleHighQuality,trace,trackAsMenu,true,type,typeof,undefined,underline,u._escape,uninstall,unload,unloadMovie,unloadMovieNum,unshift,unwatch,updateAfterEvent,url,useHandCursor,valueOf,var,variable,version,void,watch,while,width,with,wordWrap,xmlDecl");
			this._commonObjects = this.str2hashtable("ALT,ASSetNative,ASSetPropFlags,ASconstructor,ASnative,Accessibility,Accessibility.isActive,Array,AsBroadcaster,BACKSPACE,Boolean,Button,CAPSLOCK,CONTROL,Camera,Capabilities,Color,Cookie,CustomActions,DELETEKEY,DOWN,Date,UTC,E,END,ENTER,ESCAPE,FStyleFormat,HOME,INSERT,Infinity,IsActive,Key,ALT,BACKSPACE,CAPSLOCK,CONTROL,DELETEKEY,DOWN,END,ENTER,ESCAPE,HOME,INSERT,LEFT,PGDN,PGUP,RIGHT,SHIFT,SPACE,TAB,UP,LEFT,LN10,LN2,LOG10E,LOG2E,MAX_VALUE,MIN_VALUE,MMSave,Math,E,LN10,LN2,LOG10E,LOG2E,PI,SQRT1_2,SQRT2,Microphone,Mouse,MovieClip,NEGATIVE_INFINITY,NaN,NetConnection,NetStream,Number,MAX_VALUE,MIN_VALUE,NEGATIVE_INFINITY,NaN,POSITIVE_INFINITY,Object,ord,os,PGDN,PGUP,PI,POSITIVE_INFINITY,Product,RIGHT,SHIFT,SPACE,SQRT1_2,SQRT2,Selection,SendEvent,SharedObject,ShowSettings,Sound,Stage,String,System,capabilities,security");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "//";
			this._escape		= "\\";
			this.commentOn		= "/*";
			this.commentOff		= "*/";
			break;
		case "xml":			
		default:
			this._caseSensitive	= true;
			this._keywords		= this.str2hashtable("!DOCTYPE,?xml,script,version,encoding");
			this._commonObjects = this.str2hashtable("");
			this._tags			= this.str2hashtable("",false);
			this._wordDelimiters= " ,.;:\\/<>(){}[]\"'\r\n\t=+-|*%@#$^&";
			this._quotation		= this.str2hashtable("\",'");
			this._lineComment	= "";
			this._escape		= "\\";
			this._commentOn		= "<!--";
			this._commentOff	= "-->";
			this._ignore		= "<!--";
			this._dealTag		= true;
			break;
	}
	
	this._APIs = this.str2hashtable(szApi);		
	this._operators =",.?!;:\\/<>(){}[]=+-|*%@#$^&";

	this.highlight	= function(){
		var codeArr = new Array();
		var word_index = 0;
		var htmlTxt = new Array();

		//得到分割字符数组(分词)
		for (var i=0; i<this._codetxt.length; i++) {
			if (this._wordDelimiters.indexOf(this._codetxt.charAt(i)) == -1) {
				if (codeArr[word_index] == null || typeof(codeArr[word_index]) == 'undefined') {
					codeArr[word_index] = "";
				}
				codeArr[word_index] += this._codetxt.charAt(i);
			} else {
				if (typeof(codeArr[word_index]) != 'undefined' && codeArr[word_index].length > 0)
					word_index++;
				codeArr[word_index++] = this._codetxt.charAt(i);
			}
		}

		var quote_opened				= false;	//引用标记
		var slash_star_comment_opened	= false;	//多行注释标记
		var slash_slash_comment_opened	= false;	//单行注释标记
		var line_num					= 1;		//行号
		var quote_char					= "";		//引用标记类型
		var tag_opened					= false;	//标记开始
		
		htmlTxt[htmlTxt.length] = ("<pre><font style='font-size:12px' color='black' face='" + getFont() + "'>");
		
		//按分割字，分块显示
		for (var i=0;i <=word_index;i++)
		{		
			//处理空行（由于转义带来）
			if(typeof(codeArr[i])=="undefined"||codeArr[i].length==0){
				continue;
			}//处理空格
			if (codeArr[i] == " "){
				htmlTxt[htmlTxt.length] = (" ");
			//处理API
			} else if (!slash_slash_comment_opened && !slash_star_comment_opened && !quote_opened && this._APIs.contains(codeArr[i]) && this._dealAPI){
				htmlTxt[htmlTxt.length] = ("<font color='#0062A8'>" + codeArr[i] + "</font>");
			//处理关键字
			} else if (!slash_slash_comment_opened && !slash_star_comment_opened && !quote_opened && this.isKeyword(codeArr[i])){
				if(codeArr[i-3]=="#include" && codeArr[i-1]=="<" && codeArr[i+1]==">"){htmlTxt[htmlTxt.length] = codeArr[i];}
				else{htmlTxt[htmlTxt.length] = ("<font color='#000080'>" + codeArr[i] + "</font>");}
			//处理普通对象
			} else if (!slash_slash_comment_opened && !slash_star_comment_opened && !quote_opened && this.isCommonObject(codeArr[i])){
				if(codeArr[i-3]=="#include" && codeArr[i-1]=="<" && codeArr[i+1]==">"){htmlTxt[htmlTxt.length] = codeArr[i];}
				else{htmlTxt[htmlTxt.length] = ("<font color='#0000FF'>" + codeArr[i] + "</font>");}
			//处理标记
			} else if (!slash_slash_comment_opened && !slash_star_comment_opened && !quote_opened && tag_opened && this.isTag(codeArr[i])){
				htmlTxt[htmlTxt.length] = ("<font color='#0000FF'>" + codeArr[i] + "</font>");
			//处理换行
			} else if (codeArr[i] == "\n"||codeArr[i] == "\r")
			{			
				if (slash_slash_comment_opened){
					htmlTxt[htmlTxt.length] = ("</font>"+codeArr[i]);
					slash_slash_comment_opened = false;					
				} else {
					htmlTxt[htmlTxt.length] = (codeArr[i]);}
				line_num++;
			//处理双引号（引号前不能为转义字符）
			} else if (this._quotation.contains(codeArr[i])&&!slash_star_comment_opened&&!slash_slash_comment_opened){
				if (quote_opened){
					//是相应的引号
					if (quote_char==codeArr[i]){
						if(tag_opened){
							htmlTxt[htmlTxt.length] = (codeArr[i]+"</font><font color='#224c14'>");
						} else {
							htmlTxt[htmlTxt.length] = (codeArr[i]+"</font>");
						}
						quote_opened= false;
						quote_char	= "";
					} else {
						htmlTxt[htmlTxt.length] = codeArr[i].replace(/\</g,"&lt;");
					}
				} else {
					if (tag_opened){
						htmlTxt[htmlTxt.length] =  ("</font><font color='#224c14'>" + codeArr[i]);
					} else {
						htmlTxt[htmlTxt.length] =  ("<font color='#224c14'>" + codeArr[i]);
					}
					quote_opened	= true;
					quote_char		= codeArr[i];
				}
			//处理转义字符
			} else if(codeArr[i] == this._escape){
				htmlTxt[htmlTxt.length] = (codeArr[i]);
				if (i<word_index){
					if (codeArr[i+1].charCodeAt(0)>=32&&codeArr[i+1].charCodeAt(0)<=127){
						htmlTxt[htmlTxt.length] = codeArr[i+1].substr(0,1);
						codeArr[i+1] = codeArr[i+1].substr(1);
					}
				}
			//处理Tab
			} else if (codeArr[i] == "\t") {
				htmlTxt[htmlTxt.length] = ("    ");
			//处理多行注释的开始
			} else if (this.isStartWith(this._commentOn,codeArr,i)&&!slash_slash_comment_opened && !slash_star_comment_opened &&!quote_opened){
				slash_star_comment_opened = true;
				htmlTxt[htmlTxt.length] =  ("<font color='#008000'>" + this._commentOn.replace(/\</g,"&lt;"));
				i = i + this._commentOn.length-1;
			//处理单行注释
			} else if (this.isStartWith(this._lineComment,codeArr,i)&&!slash_slash_comment_opened && !slash_star_comment_opened&&!quote_opened){
				slash_slash_comment_opened = true;
				htmlTxt[htmlTxt.length] =  ("<font color='#008000'>" + this._lineComment);
				i = i + this._lineComment.length-1;
			//处理忽略词
			} else if (this.isStartWith(this._ignore,codeArr,i)&&!slash_slash_comment_opened && !slash_star_comment_opened&&!quote_opened){
				slash_slash_comment_opened = true;
				htmlTxt[htmlTxt.length] =  ("<font color='#008000'>" + this._ignore.replace(/\</g,"&lt;"));
				i = i + this._ignore.length-1;
			//处理多行注释结束
			} else if (this.isStartWith(this._commentOff,codeArr,i)&&!quote_opened&&!slash_slash_comment_opened){
				if (slash_star_comment_opened) {
					slash_star_comment_opened = false;
					htmlTxt[htmlTxt.length] =  (this._commentOff +"</font>");
					i = i + this._commentOff.length-1;
				}
			//处理左标记
			} else if (this._dealTag&&!slash_slash_comment_opened && !slash_star_comment_opened&&!quote_opened&&codeArr[i] == "<") {
				htmlTxt[htmlTxt.length] = "&lt;<font color='#336699'>";
				tag_opened	= true;
			//处理右标记
			} else if (this._dealTag&&tag_opened&&codeArr[i] == ">") {
				htmlTxt[htmlTxt.length] = "</font>&gt;";
				tag_opened	= false;
			//处理数字
			} else if (!isNaN(codeArr[i])&&!slash_slash_comment_opened&&!slash_star_comment_opened && !quote_opened){			
				htmlTxt[htmlTxt.length] = ("<font color='red'>" + codeArr[i] + "</font>");
			//处理运算符
			} else if (!slash_slash_comment_opened && !slash_star_comment_opened && !quote_opened && (this._operators.indexOf(codeArr[i])>0)){
				htmlTxt[htmlTxt.length] = ("<font color='navy'>" + codeArr[i] + "</font>");
			//处理HTML转义符号
			} else if (codeArr[i] == "&") {
				htmlTxt[htmlTxt.length] = "&amp;";
			} else {
				htmlTxt[htmlTxt.length] = codeArr[i].replace(/\</g,"&lt;");
			}
		}	
		
		if(slash_slash_comment_opened) htmlTxt[htmlTxt.length] = ("</font>");
		htmlTxt[htmlTxt.length] = ("</font></pre>");

		return htmlTxt.join("");
	}

	this.isStartWith = function(str,code,index){
		if(typeof(str)!="undefined"&&str.length>0){
			for(var i=0;i<str.length;i++){
				if(this._caseSensitive){
					if(str.charAt(i)!=code[index+i]||(index+i>=code.length)){
						return false;
					}
				} else {
					if(str.charAt(i).toLowerCase()!=code[index+i].toLowerCase()||(index+i>=code.length)){
						return false;
					}
				}
			}
			return true;
		} else {
			return false;
		}
	}

	this.isKeyword = function(val){
		return this._keywords.contains(this._caseSensitive?val:val.toLowerCase());
	}

	this.isCommonObject = function(val){
		return this._commonObjects.contains(this._caseSensitive?val:val.toLowerCase());
	}

	this.isTag = function(val){
		return this._tags.contains(val.toLowerCase());
	}
	
	this.isWinAPI = function(val){
		this._isContainedAPI = false;
		
		switch(val.substring(val.length-1,val.length)){
			case "W","A":
				this._isContainedAPI = this._APIs.contains(val.substring(0,val.length-1));
				break;
			default:
				this._isContainedAPI = this._APIs.contains(this._caseSensitive?val:val.toLowerCase());
		}
		return this._isContainedAPI;
	}
}

function doHighlight(o, syntax){
	var htmltxt = "";

	if(o == null)
	{
		/*alert("domode is null!");*/
		return;
	}
	var _codetxt = "";

	if(typeof(o)=="object")
	{
		switch(o.tagName)
		{
			case "TEXTAREA":
			case "INPUT":
				_codetxt = o.value;
				break;
			case "DIV":
			case "SPAN":
				_codetxt = o.innerText;
				break;
			default:
				_codetxt = o.innerHTML;
				break;
		}
	}else{
		_codetxt = o;
	}
	var _syn = new CLASS_HIGHLIGHT(_codetxt,syntax);
	htmltxt = _syn.highlight();
	return  htmltxt;
}