
//************************************* 
//* #Begin GnxStringToggleCommand 
//*************************************

var GnxStringToggleCommand = NxScriptClass.create();

GnxStringToggleCommand.prototype = {
	
	initialize : function () {
		
		this.strCommand			= -1;
		this.isUserInterface	= false;
		this.strValue			= false;
		this.EditorControl		= null;
	}

,	Execute : function () {
	
		if ( this.EditorControl != null )  {
		
			this.EditorControl.get_StageFocus();
			this.EditorControl.get_StageSelection().execCommand( this.strCommand, this.isUserInterface, this.strValue );
		}
	}
}

//************************************* 
//* #End GnxStringToggleCommand 
//*************************************

//************************************* 
//* #Begin GnxStringToggleCommand 
//*************************************

var GnxCreateTagCommand = NxScriptClass.create();

GnxCreateTagCommand.prototype = {
	
	initialize : function () {
		
		this.strTagSource	= null;
		this.EditorControl	= null;
	}

,	Execute : function () {
	
		if ( this.EditorControl != null && this.strTagSource != null )  {
		
			this.EditorControl.get_StageFocus();
			this.EditorControl.Append_StageContent( this.strTagSource );
		}
	}
}

//************************************* 
//* #End GnxStringToggleCommand 
//*************************************

//************************************* 
//* #Begin GnxSelectAttributeCommand 
//*************************************

var GnxSelectAttributeCommand = NxScriptClass.create();

GnxSelectAttributeCommand.prototype = {
	
	initialize : function () {
		
		this.strCommand			= -1;
		this.isUserInterface	= false;
		this.strValue			= false;
		this.EditorControl		= null;
		this.elSelectBox		= null;
	}

,	Execute : function () {
	
	if ( this.elSelectBox != null && this.EditorControl != null ) {
			
			this.EditorControl.get_StageFocus();
			
			for ( var i = 0; i < this.elSelectBox.options.length; i++ ) {
				
				if ( this.elSelectBox.options[ i ].index > 0 && this.elSelectBox.options[ i ].selected == true ) {
					
					this.EditorControl.get_StageSelection().execCommand( this.strCommand, this.isUserInterface, this.elSelectBox.options[ i ].text.toFontValue() ); 
					break;
				}				
			}
			
			if ( this.elSelectBox.options.length > 0 )
				this.elSelectBox.options[ 0 ].selected = true;
		}
	}
}

//************************************* 
//* #End GnxSelectAttributeCommand 
//*************************************

//************************************* 
//* #Begin GnxOpenEditorToolCommand 
//*************************************

var GnxOpenEditorToolCommand = NxScriptClass.create();

GnxOpenEditorToolCommand.prototype = {
	
	initialize : function () {
		
		this.EditorControl			= null;
		this.strEditorToolPath		= null;
		this.n4ToolWidth			= 900;
		this.n4ToolHeight			= 590;
		this.n4ItemMaxWidth			= 0;
		this.n4ItemMaxHeight		= 0;
		this.n4UploadRangeMsec		= 0;
		this.n4ImageThumbWidth		= 0;
		this.n4ImageThumbHeight		= 0;
		this.strCallBackQuery		= "";
		this.codeImgEditorVersion	= 1;
		this.blRemoveActiveX		= false;
		this.n1ButtonType					= 0;//0-ÀÌ¹ÌÁö, 1-µ¿¿µ»ó - 090622 ¹ö¹ÌÃß°¡
		
		this.n4VodBitrate			= 0;
		this.n4VodResolution		= 0;
		
		//<! ÆÄÀÏ½Ã½ºÅÛ ºÐ¸®·Î ÀÎÇÏ¿© maskGameCode Property ¸¦ Ãß°¡ ÇÑ´Ù by emong ( emong@neoxn.co.kr )
		this.maskGameCode			= 0;
	}

,	Execute : function () {
		
		if ( this.strEditorToolPath != null && this.EditorControl != null ) {
		
			var strQueryStringPrefix = "?";
		
			if ( this.blRemoveActiveX ) strQueryStringPrefix = "&"
			
			if(this.n1ButtonType==1)
				this.strCallBackQuery += strQueryStringPrefix + "CallBackComplete=GnxEditor_CallBack.UploadVodFileComplete";
			else if ( ( +this.codeImgEditorVersion ).equals( 1 ) )
				this.strCallBackQuery += strQueryStringPrefix + "CallBackComplete=GnxEditor_CallBack.UploadImgFileComplete";
			else
				this.strCallBackQuery += strQueryStringPrefix + "CallBackComplete=GnxEditor_CallBack.UploadImg2FileComplete";			
			
			this.strCallBackQuery += "&CallBackCancel=GnxEditor_CallBack.UploadCancel";
			
			if ( this.n4ItemMaxWidth > 0 )
				this.strCallBackQuery += "&nRSWidth=" + this.n4ItemMaxWidth;
			
			if ( this.n4ItemMaxHeight > 0 )
				this.strCallBackQuery += "&nRSHeight=" + this.n4ItemMaxHeight;
			
			if ( this.n4ImageThumbWidth > 0 && ( +this.EditorControl.codeThumbFileType ).equals( 1 ) )
				this.strCallBackQuery += "&thumbnailWidth=" + this.n4ImageThumbWidth;
				
			if ( this.n4ImageThumbHeight > 0 && ( +this.EditorControl.codeThumbFileType ).equals( 1 ) )
				this.strCallBackQuery += "&thumbnailHeight=" + this.n4ImageThumbHeight;
				
			if ( this.n4UploadRangeMsec > 0 )
				this.strCallBackQuery += "&n4UploadMaxTime=" + this.n4UploadRangeMsec;
				
			if ( this.n4VodBitrate > 0 )
				this.strCallBackQuery += "&Bitrate=" + this.n4VodBitrate;
				
			if ( this.n4VodResolution > 0 )
				this.strCallBackQuery += "&Resolution=" + this.n4VodResolution;			
			
			if ( this.maskGameCode > 0 )
			this.strCallBackQuery += "&maskGameCode=" + this.maskGameCode;
			
			if( this.maskGameCode != 589824 ) // ¸ÞÀÌÇÃÀÌ ¾Æ´Ï¸é
				this.strCallBackQuery += "&codeFileService=7";
			
			//!> IE ¹öÀü ¸¶´Ù ÆË¾÷ Å©±â°¡ ´Þ¶óÁüÀ¸·Î ¹öÀü Ã¼Å©¸¦ ÇÏ¿© Å©±â¸¦ ¼³Á¤ÇÑ´Ù. by emong@nexon.co.kr
			var _keyword		= "MSIE";
			var _varsion		= null;
			
			var _varsionLength	= 1;
			var _emptyLength	= 1; 
			
			var _browInfo	= navigator.userAgent.toLowerCase();
			var _startPoint	= _browInfo.indexOf( _keyword.toLowerCase() );
			
			if ( +_startPoint > -1 )
			{
				_startPoint = ( +_startPoint + _keyword.length ) + _emptyLength;
				_varsion	= _browInfo.substring( _startPoint, ( _startPoint + _varsionLength ) );
				
				switch ( +_varsion )
				{
					case 6 : this.n4ToolHeight = this.n4ToolHeight + 24; break;
					case 7 : this.n4ToolHeight = this.n4ToolHeight + 48; break; 
				}
			}
			
			NxScript.popup( this.strEditorToolPath + this.strCallBackQuery, "tool", "width=" + this.n4ToolWidth + ", height=" + this.n4ToolHeight );
		}
	}
}

//************************************* 
//* #End GnxOpenEditorToolCommand 
//*************************************


//************************************* 
//* #Begin GnxAddImageSourceCommand 
//*************************************

var GnxAddImageSourceCommand = NxScriptClass.create();

GnxAddImageSourceCommand.prototype = {

	initialize : function () {
		
		this.EditorControl		= null;
		this.oidFile			= 0;
		this.oidThumbFile		= 0;
		this.strFileName		= null;
		this.strFilePath		= null;
		this.visible			= true;
	}

,	Execute : function () {
		
		if ( this.EditorControl != null 
		&& ( +this.EditorControl.codeStageModeType ).equals( NxScriptCode.codeEditorModeType_designAndHtml )  
		&& ( ( +this.oidFile ) > 0 || this.strFilePath != null ) ) {
			
			var _id		= null;
			var _path	= null;
			var _src	= null;
			var _thread = new NxScriptArray();
			var _visible= this.visible?'':"style='display:none;width:0px;height:0px' width=0 height=0";
			
			if ( this.oidFile > 0 ) {
				
				_thread.add( this.oidFile );
				_thread.add( this.strFileName.regReplace( "_", "-" ) );
				
				if ( this.oidThumbFile != "" )
					_thread.add( this.oidThumbFile );
				
				_id		= "_IMAGE_" + _thread.join( ":" ) + "_UPLOAD_";
				_path	= this.EditorControl.strFileDownloader + "?oidFile=" + this.oidFile;
				_src	= "<img "+_visible+" src='" + _path + "' id='" + _id + "'>";
			}
			else {
							
				_id		= null;
				_path	= this.strFilePath;
				_src	= "<img "+_visible+" src='" + _path + "' id='_EDITOR_EMOTICON_'>";
			}
			
			this.EditorControl.get_StageFocus();
			this.EditorControl.Append_StageContent( _src );
			
			if ( _id != null )
				NxScriptClass.extend( this.EditorControl.get_StageDoc().getElementById( _id ), this.EditorControl.handleDisabledContent() );
		}
	}
};

//************************************* 
//* #End GnxAddImageSourceCommand 
//*************************************

//************************************* 
//* #Begin GnxAddMultiImagesSourceCommand 
//*************************************

var GnxAddBulkImageSourceCommand = NxScriptClass.create();

GnxAddBulkImageSourceCommand.prototype = {

	initialize : function () {
		
		this.EditorControl		= null;
		this.ArrayUploadInfo	= null;
	}

,	Execute : function () {
		
		if ( this.EditorControl != null 
		&& ( +this.EditorControl.codeStageModeType ).equals( NxScriptCode.codeEditorModeType_designAndHtml ) ) {
			
			for ( var i = 0; i < this.ArrayUploadInfo.length; i++ ) {
				
				var cmd = new GnxAddImageSourceCommand();
				
				cmd.EditorControl	= this.EditorControl;
				cmd.oidFile			= this.ArrayUploadInfo[ i ].oidFile;
				cmd.oidThumbFile	= this.ArrayUploadInfo[ i ].oidThumb;
				cmd.strFileName		= this.ArrayUploadInfo[ i ].strFileName;
				
				cmd.Execute();
			}		
		}
	}
};

//************************************* 
//* #End GnxAddMultiImageSourceCommand 
//*************************************

//************************************* 
//* #Begin GnxAddMovieSourceCommand 
//*************************************

var GnxAddMovieSourceCommand = NxScriptClass.create();

GnxAddMovieSourceCommand.prototype = {

	initialize : function () {
		
		this.EditorControl		= null;
		this.ArrayUploadInfo	= null;
	}
	
,	Execute : function () {

		var _thread = new NxScriptArray();
		
		_thread.add( this.ArrayUploadInfo.file_movIdx );
		_thread.add( this.ArrayUploadInfo.file_movSize );
		_thread.add( this.ArrayUploadInfo.file_movDate );
		
		_thread.add( this.ArrayUploadInfo.thumb_titleIndex );
		_thread.add( this.ArrayUploadInfo.thumb_selectIndex );
		
		_thread.add( this.ArrayUploadInfo.thumb1_fileIndex );
		_thread.add( this.ArrayUploadInfo.thumb2_fileIndex );
		_thread.add( this.ArrayUploadInfo.thumb3_fileIndex );
		_thread.add( this.ArrayUploadInfo.thumb4_fileIndex );
		_thread.add( this.ArrayUploadInfo.thumb5_fileIndex );
		_thread.add( this.ArrayUploadInfo.thumb6_fileIndex );
		
		_thread.add( this.ArrayUploadInfo.file_realName.regReplace( "_", "-" ) );
		_thread.add( this.ArrayUploadInfo.thumb_selectName.regReplace( "_", "-" ) );		
		
		if ( this.EditorControl != null 
		&& ( +this.EditorControl.codeStageModeType ).equals( NxScriptCode.codeEditorModeType_designAndHtml )
		&& this.ArrayUploadInfo != null ) {
			
			var _id			= "_MOVIE_" + _thread.join( ":" ) + "_UPLOAD_";
			var _path		= this.EditorControl.strFileDownloader + "?oidFile=" + this.ArrayUploadInfo.thumb_playerIndex;
			if( this.maskGameCode == 589824 ) // ¸ÞÀÌÇÃ
				var _src		= "<div id='" + _id + "' style='width:338px;height:304px;background-Image:url(" + _path + ")'></div>";
			else
				var _src		= "<div id='" + _id + "' style='width:380px;height:276px;background-Image:url(http://s.nx.com/S2/Portal/Nexon/Nexon2007/image/gch/img_space_movie.gif)'></div>";
			
			this.EditorControl.get_StageFocus();
			this.EditorControl.Append_StageContent( _src );
			
			NxScriptClass.extend( this.EditorControl.get_StageDoc().getElementById( _id ), this.EditorControl.handleDisabledContent() );
		}
	}
};

//************************************* 
//* #End GnxAddMovieSourceCommand 
//*************************************


//************************************* 
//* #Begin ExecPagingDataGetListCommand 
//*************************************

var GnxPagingDataGetListCommand = NxScriptClass.create();

GnxPagingDataGetListCommand.prototype = {

	initialize : function () {
		
		this.EditorControl		= null;
		this.strType			= null;
		this.cateDataSource		= null;
		this.arryDataSource		= null;
		this.strCacheName		= null;
		this.n4PageScale		= 20;
		this.n1DataNo			= 1;
		this.n4QuotaSize		= 4;
		this.n1Category			= null;
		
		this.strNextBtnId		= null;
		this.strPrevBtnId		= null;
		this.strCloseBtnId		= null;
		this.strConfirmBtnId	= null;
		this.strPageNoId		= null;
		this.strSelectBoxId		= null;
		this.strDisplayAreaId	= null;
		this.strPreviewAreaId	= null;
		this.strInputId			= null;
		
		this.strSelectValue		= new NxScriptArray();
		this.arryDataSet		= new NxScriptArray();
	}
	
,	n4TotalCount	: function() { return ( this.arryDataSet.count() ); }
,	n4PageSize		: function() { return Math.ceil( this.n4TotalCount() / this.n4PageScale ); }
,	n4StartNo		: function() { return ( ( this.n1DataNo - 1 ) * this.n4PageScale ); }
,	n4EndNo			: function() { return ( this.n1DataNo * this.n4PageScale ); }

,	setDataSet		: function() {

		this.arryDataSet.reset();
		
		for ( var i = 0; i < this.arryDataSource.count(); i++ ) {
			
			if ( this.n1Category != null ) {
				
				if ( this.arryDataSource.row( i ).n1Category == this.n1Category )
					this.arryDataSet.add( this.arryDataSource.row( i ) );
			}
			else {
				this.arryDataSet.add( this.arryDataSource.row( i ) );
			}
		}
	}

,	getDataRow		: function ( no ) {
		
		return ( this.arryDataSet.row( no ) != null ) ? this.arryDataSet.row( no ) : null;
	}

,	handleItemEvent : function() {
		
		if ( this.strType.equals( "EMOTICON" ) ) {
		
			return ( { 
				
				thread_object : this
				
			,	onclick : function () {
					
					with ( this.thread_object ) {
					
						var _key	= null;
						var _el		= ( typeof( event ) == 'object' ) ? event.srcElement : null;
						var _parent	= ( typeof( _el.parentElement ) == 'object' ) ? _el.parentElement : null;
						
						if ( _parent != null && _parent.tagName.equals( "TD" ) ) {
							
							if( ( typeof _parent.changeState ).equals( 'undefined' ) )									
								NxScriptClass.extend( _parent, { changeState : true } );
							
							if ( _parent.changeState ) {
							
								_parent.style.borderStyle	= 'solid';
								_parent.style.borderWidth	= '1px';
								_parent.style.borderColor	= '#FF6600';
								
								_parent.changeState			= false;
								
								strSelectValue.add( _el.src );					
							}
							else {
								
								_parent.style.borderStyle	= 'solid';
								_parent.style.borderWidth	= '1px';
								_parent.style.borderColor	= '#ffffff';
								
								_parent.changeState			= true;
								
								strSelectValue.remove( strSelectValue.search( _el.src ) );
							}
						}
					}
				}								
			} );
		}
		
		else if ( this.strType.equals( "FORECOLOR" ) || this.strType.equals( "BACKCOLOR" ) ) {
		
			return ( {
			
				thread_object : this
				
			,	onclick : function () {
					
					with ( this.thread_object ) {
						
						var _el		= ( typeof( event ) == 'object' ) ? event.srcElement : null;
						var _parent	= ( typeof( _el.parentElement ) == 'object' ) ? _el.parentElement : null;
						
						if ( _parent != null && _parent.tagName.equals( "TD" ) ) {
							
							if ( NxScript.findElement( strInputId ) != null )
								NxScript.findElement( strInputId ).value = _parent.style.backgroundColor.replace( "#", "" );
							
							if ( NxScript.findElement( strPreviewAreaId ) != null )
								NxScript.findElement( strPreviewAreaId ).setStylesheet( { backgroundColor : _parent.style.backgroundColor } );
						}
					}
				}			
			} );
		}	
	}

,	handleConfirmButton : function () {
		
		if ( this.strType.equals( "EMOTICON" ) ) {
		
			return ( { 
					
				thread_object : this
				
			,	onclick : function () {
					
					with ( this.thread_object ) {
						
						for( var i = 0; i < strSelectValue.count(); i++ ) {
							
							var cmd = new GnxAddImageSourceCommand;
							
							cmd.EditorControl	= EditorControl;
							cmd.strFilePath		= strSelectValue.row( i );
							
							cmd.Execute();
						}
					}
				}								
			} );			
		}
		
		else if ( this.strType.equals( "FORECOLOR" ) || this.strType.equals( "BACKCOLOR" ) ) {
			
			return ( { 
					
				thread_object	: this
			,	thread_range	: ( this.EditorControl.hasStageSelection() ) ? this.EditorControl.get_StageSelection() : null
					
			,	onclick : function () {
					
					with ( this.thread_object ) {
					
						if ( strType.equals( "FORECOLOR" ) ) {
						
							if ( NxScript.findElement( strInputId ) != null ) {
								
								var cmd = new GnxForegroundColorCommand;
								
								cmd.strValue		= NxScript.findElement( strInputId ).value;
								cmd.EditorControl	= EditorControl;
								cmd.EditorRange		= this.thread_range;
								
								cmd.Execute();
							}
						}
						else if ( strType.equals( "BACKCOLOR" ) ) {
							
							if ( NxScript.findElement( strInputId ) != null ) {
							
								var cmd = new GnxBackgroundColorCommand;
								
								cmd.strValue		= NxScript.findElement( strInputId ).value;
								cmd.EditorControl	= EditorControl;
								cmd.EditorRange		= this.thread_range;
								
								cmd.Execute();
							}
						}	
					}
				}								
			} );
		}
	}
	
,	handleSelectEvent : function () {
		
		return ( {
		
			thread_object : this
			
		,	onchange : function () {
		
				if ( ( +this.value ) > 0 ) {
				
					with ( this.thread_object ) {
					
						var _html_			= null;
						var _strCacheName	= null;
						
						n1DataNo = 1;				
						n1Category = this.value;
						
						setDataSet();
						
						if ( NxScript.findElement( strNextBtnId ) != null )
							NxScript.findElement( strNextBtnId ).thread_integer = 1;
						
						if ( NxScript.findElement( strPrevBtnId ) != null )
							NxScript.findElement( strPrevBtnId ).thread_integer = 1;
						
						if ( NxScript.findElement( strPageNoId ) != null )
							NxScript.findElement( strPageNoId ).bound( "1 / " + n4PageSize() );	
						
						_strCacheName = strCacheName + "_list_1_cate_" + n1Category;
						
						if ( NxScriptCache.get( _strCacheName ) == null ) {
								
							_html_ = EditorControl.get_bindSrcFactory( this.thread_object ) 
							
							NxScriptCache.set( _strCacheName, _html_ );
						}
						else {
							_html_ = NxScriptCache.get( _strCacheName );
						}						
						
						if ( NxScript.findElement( strDisplayAreaId ) != null )
							NxScript.findElement( strDisplayAreaId ).bound( _html_ );
							
						strSelectValue.reset();
					}
				}
			}		
		} );
	}

,	handlePrevButton : function () {
	
		return ( {
				
			thread_object	: this
		,	thread_integer	: 1
		
		,	onclick : function() {
							
				with ( this.thread_object ) {
				
					if ( this.thread_integer > 1 ) {
					
						var _html_			= null;
						var _strCacheName	= null;
						
						this.thread_integer	= ( this.thread_integer - 1 );
						_strCacheName		= strCacheName + "_list_" + this.thread_integer + "_cate_" + n1Category;
						
						if ( NxScript.findElement( strNextBtnId ) != null )
							NxScript.findElement( strNextBtnId ).thread_integer = this.thread_integer;
						
						if ( NxScript.findElement( strPageNoId ) != null )
							NxScript.findElement( strPageNoId ).bound( this.thread_integer + " / " + n4PageSize() );	
						
						n1DataNo = this.thread_integer;
						
						if ( NxScriptCache.get( _strCacheName ) == null ) {
							
							_html_ = EditorControl.get_bindSrcFactory( this.thread_object ) 
							
							NxScriptCache.set( _strCacheName, _html_ );
						}
						else {
							_html_ = NxScriptCache.get( _strCacheName );
						}
						
						if ( NxScript.findElement( strDisplayAreaId ) != null )
							NxScript.findElement( strDisplayAreaId ).bound( _html_ );
							
						strSelectValue.reset();
					}
				}				
			}
		} );
	}

,	handleNextButton : function () {
		
		return ( {
		
			thread_object	: this
		,	thread_integer	: 1
		
		,	onclick : function() {
				
				with ( this.thread_object ) {
				
					if ( this.thread_integer < n4PageSize() ) {
					
						var _html_			= null;
						var _strCacheName	= null;
						
						this.thread_integer	= ( this.thread_integer + 1 );
						_strCacheName		= strCacheName + "_list_" + this.thread_integer + "_cate_" + n1Category;
						
						if ( NxScript.findElement( strPrevBtnId ) != null )
							NxScript.findElement( strPrevBtnId ).thread_integer = this.thread_integer;
						
						if ( NxScript.findElement( strPageNoId ) != null )
							NxScript.findElement( strPageNoId ).bound( this.thread_integer + " / " + n4PageSize() );	
						
						n1DataNo = this.thread_integer;
						
						if ( NxScriptCache.get( _strCacheName ) == null ) {
							
							_html_ = EditorControl.get_bindSrcFactory( this.thread_object ) 
							
							NxScriptCache.set( _strCacheName, _html_ );
						}
						else {
							_html_ = NxScriptCache.get( _strCacheName );
						}					
						
						if ( NxScript.findElement( strDisplayAreaId ) != null )
							NxScript.findElement( strDisplayAreaId ).bound( _html_ );
						
						strSelectValue.reset();
					}
				}				
			}
		} );			
	}
	
,	handleCloseButton : function () {

		return ( { 
			
			thread_object : this	
			
		,	onclick : function () {
				
				with ( this.thread_object ) {
					
					EditorControl.__EditorDivision.visible( true );
					EditorControl.get_StageFocus();
				}
			}
		
		} );
	}

,	handleInputEvent : function () {
		
		if ( this.strType.equals( "FORECOLOR" ) || this.strType.equals( "BACKCOLOR" ) ) {
			
			return ( { 
			
				thread_object : this	
				
			,	onkeyup : function () {
					
					try {
						
						with ( this.thread_object ) {
							
							if ( this.value.length.equals( 6 ) ) {
							
								if ( NxScript.findElement( strPreviewAreaId ) != null )
									NxScript.findElement( strPreviewAreaId ).setStylesheet( { backgroundColor : "#" + this.value } );
								
								if ( NxClient._keyCode().equals( 13 ) )
									NxScript.findElement( strConfirmBtnId ).click();
							}
						}
					}
					catch ( e ) {}
				}
			
			,	maxLength : 6
			
			} ); 
		}
	}

,	Execute : function () {
		
		if ( this.EditorControl != null ) {
			
			with ( this.EditorControl ) {
			
				var _html_			= null;
				var _strCacheName	= this.strCacheName + "_list_" + this.n1DataNo + "_cate_" + this.n1Category;
				
				__EditorDivision.bound( get_htmlSrcFactory( this ) );
				__EditorDivision.setStylesheet( divStyleSheet( { strDisplay : 'block' } ) );
				
				NxScriptClass.extend( NxScript.findElement( this.strPageNoId ),		handleElement() );
				NxScriptClass.extend( NxScript.findElement( this.strPreviewAreaId ),	handleElement() );
				NxScriptClass.extend( NxScript.findElement( this.strDisplayAreaId ),	handleElement() );
				NxScriptClass.extend( NxScript.findElement( this.strDisplayAreaId ),	this.handleItemEvent() );
				NxScriptClass.extend( NxScript.findElement( this.strPrevBtnId ),		this.handlePrevButton() );
				NxScriptClass.extend( NxScript.findElement( this.strNextBtnId ),		this.handleNextButton() );
				NxScriptClass.extend( NxScript.findElement( this.strConfirmBtnId ),	this.handleConfirmButton() );
				NxScriptClass.extend( NxScript.findElement( this.strCloseBtnId ),		this.handleCloseButton() );
				NxScriptClass.extend( NxScript.findElement( this.strSelectBoxId ),	this.handleSelectEvent() );
				NxScriptClass.extend( NxScript.findElement( this.strInputId ),		this.handleInputEvent() );
				
				this.setDataSet();
				
				if ( NxScript.findElement( this.strPageNoId ) != null )
					NxScript.findElement( this.strPageNoId ).bound( this.n1DataNo + " / " + this.n4PageSize() );
				
				if ( NxScript.findElement( this.strDisplayAreaId ) != null ) {
				
					if ( NxScriptCache.get( _strCacheName ) == null ) {
						
						_html_ = get_bindSrcFactory( this );
						
						NxScriptCache.set( _strCacheName ,_html_ );
					}
					else {
					
						_html_ = NxScriptCache.get( _strCacheName );
					}
					
					NxScript.findElement( this.strDisplayAreaId ).bound( _html_ );
				}
			}
		}
	}
};

//************************************* 
//* #End ExecPagingDataGetListCommand 
//*************************************

//************************************* 
//* #Begin ExecCreateLinkCommand 
//*************************************

var GnxCreateLinkCommand = NxScriptClass.create();

GnxCreateLinkCommand.prototype = {

	initialize : function () {
		
		this.strType			= null;
		this.EditorControl		= null;
		this.strInputId			= null;
		this.strConfirmBtnId	= null;
		this.strCloseBtnId		= null;
		this.strCacheName		= null;
		this.codeLinkType		= 0;	
	}

,	handleCloseButton : function () {
		
		return ( { 
			
			thread_object : this	
			
		,	onclick : function () {
				
				with ( this.thread_object ) {
					
					EditorControl.__EditorDivision.visible( true );
					EditorControl.get_StageFocus();
				}
			}		
		} );
	}

,	handleInputEvent : function () {

		return ( {
		
			thread_object : this
			
		,	onkeyup : function () {
		
				try {
				
					with ( this.thread_object ) {
						
						if ( NxClient._keyCode() == 13 )
							NxScript.findElement( strConfirmBtnId ).click();
					}
				}
				catch ( e ) {}
			}
		
		} );
	}

,	handleConfirmButton : function () {
		
		return ( {
		
			thread_object	: this
		,	thread_select	: ( this.EditorControl.hasStageSelection() ) ? this.EditorControl.get_StageSelection() : null
			
		,	onclick : function () {
				
				with ( this.thread_object ) {
					
					if ( NxScript.findElement( strInputId ) != null )
						strValue = NxScript.findElement( strInputId ).value;
					
					if ( strValue != false ) {
						
						if ( !strValue.equals( "http://" ) && this.thread_select != null ) {
							
							this.thread_select.select();
							this.thread_select.execCommand( "CreateLink", false, strValue );	
						}
						else {
						
							if ( this.thread_select != null ) {
								
								EditorControl.get_StageSelection().select();
								EditorControl.get_StageSelection().execCommand( "Unlink", false, false );
							}
							else {
								
								EditorControl.get_StageFocus();
							}
						}						
					}
				}
			}			
		} );
	}

,	Execute : function () {
		
		if ( this.EditorControl != null ) {
			
			with ( this.EditorControl ) {
			
				var _html_			= null;
				
				if ( NxScriptCache.get( this.strCacheName ) == null ) {
					
					_html_ = get_bindSrcFactory( this );
					
					NxScriptCache.set( this.strCacheName, _html_ );
				}
				else {
				
					_html_ = NxScriptCache.get( this.strCacheName );
				}
				
				__EditorDivision.bound( get_htmlSrcFactory( this ) );
				__EditorDivision.setStylesheet( divStyleSheet( { strDisplay : 'block' } ) );			
				
				NxScriptClass.extend( NxScript.findElement( this.strConfirmBtnId ),	this.handleConfirmButton() );
				NxScriptClass.extend( NxScript.findElement( this.strCloseBtnId ),		this.handleCloseButton() );
				NxScriptClass.extend( NxScript.findElement( this.strInputId ),		this.handleInputEvent() );
			}
		}		
	}
};

//************************************* 
//* #End ExecCreateLinkCommand 
//*************************************

//************************************* 
//* #Begin GnxForegroundColorCommand 
//*************************************

var GnxForegroundColorCommand = NxScriptClass.create();

GnxForegroundColorCommand.prototype = {

	initialize : function () {
		
		this.strValue			= false;
		this.EditorControl		= null;
		this.EditorRange		= null;
	}
	
,	Execute : function () {
		
		if ( this.EditorRange != null ) {
			
			this.EditorRange.select();
			this.EditorRange.execCommand( "ForeColor", false, "#" + this.strValue );
		}
		else {
		
			this.EditorControl.get_StageFocus();
			this.EditorControl.get_StageSelection().execCommand( "ForeColor", false, "#" + this.strValue );
		}
	}
};

//************************************* 
//* #End GnxForegroundColorCommand 
//*************************************

//************************************* 
//* #Begin GnxBackgroundColorCommand 
//*************************************

var GnxBackgroundColorCommand = NxScriptClass.create();

GnxBackgroundColorCommand.prototype = {

	initialize : function () {
		
		this.strValue			= false;
		this.EditorControl		= null;
		this.EditorRange		= null;
	}
	
,	Execute : function () {
		
		if ( this.EditorRange != null ) {
			
			this.EditorRange.select();
			this.EditorRange.execCommand( "BackColor", false, "#" + this.strValue );
		}
		else {
		
			this.EditorControl.get_StageFocus();
			this.EditorControl.get_StageSelection().execCommand( "BackColor", false, "#" + this.strValue );
		}
	}
};

//************************************* 
//* #End GnxBackgroundColorCommand 
//*************************************

//************************************* 
//* #Begin GnxCreatePopupCommand 
//*************************************

var GnxCreatePopupCommand = NxScriptClass.create();

GnxCreatePopupCommand.prototype = {

	initialize : function () {
		
		this.n4PopupWidth	= 0;
		this.n4PopupHeight	= 0;
		this.strContent		= null;
	}
	
,	Execute : function () {
		
		if ( this.strContent != null ) {
		
			var popup			= null; 
			var n4PopupWidth	= 0;
			var n4PopupHeight	= 0;
			var n4ScreenWidth	= screen.Width;
			var n4ScreenHeight	= screen.Height;
			
			n4PopupWidth	= ( n4ScreenWidth <= this.n4PopupWidth ) ? ( n4ScreenWidth / 2 ) : this.n4PopupWidth;
			n4PopupHeight	= ( n4ScreenHeight <= this.n4PopupHeight ) ? ( n4ScreenHeight / 2 ) : this.n4PopupHeight;
			
			popup = NxScript.popup( '', "popup", "top=0,left=0,resizable=yes,width=" + ( n4PopupWidth )  + ",height=" + ( n4PopupHeight ) + "" ); 
			
			popup.document.open( "text/html" );
			popup.document.write( "<html><head></head><body></body></html>" );
			popup.document.close();
			
			popup.document.title						= document.title;
			popup.document.body.onclick					= function () { popup.self.close(); }
			popup.document.body.style.backgroundColor	= "#000000";
			popup.document.body.style.margin			= "0px";
			popup.document.body.style.cursor			= "hand";
			popup.document.body.innerHTML				= "<div style='width:100%;height:100%;overflow:auto;padding:5px'>" + this.strContent + "</div>";
		}
	}	
};

//************************************* 
//* #Begin GnxCreatePopupCommand 
//*************************************
