function __GnxRestrictWords()
{
// public:

	this.isRestrictWordsLoad = false;
	this.isRaiseError = false;
	
	// Interface
	this.CheckPageEnd = GnxRestrictWords_CheckPageEnd;
	this.CreateObject = GnxRestrictWords_CreateObject;
	this.init = GnxRestrictWords_init;
	
	
	this.IsDataLoaded = GnxRestrictWords_IsDataLoaded;
	this.HasReservedWords = GnxRestrictWords_HasReservedWords;
	this.HasBanWords = GnxRestrictWords_HasBanWords;
	this.ReplaceBanWords = GnxRestrictWords_ReplaceBanWords;
	this.IsReservedID = GnxRestrictWords_IsReservedID;
	this.HasReservedID = GnxRestrictWords_HasReservedID;
}

function GnxRestrictWords_IsDataLoaded()
{
	return document.all.RestWord.IsDataLoaded();
}

function GnxRestrictWords_HasReservedWords( strValue, strGameCode )
{
	var nIndex = document.all.RestWord.HasRestrictWords( strValue, strGameCode );
	return ( nIndex != 0 );
}

function GnxRestrictWords_HasBanWords( strValue, strGameCode )
{
	var nIndex = document.all.RestWord.HasRestrictWords( strValue, strGameCode );
	return ( nIndex != 0 );
}

function GnxRestrictWords_ReplaceBanWords( strValue, strGameCode, strReplaceValue )
{
	return document.all.RestWord.ReplaceRestrictWords( strValue, strGameCode, strReplaceValue );
}

function GnxRestrictWords_IsReservedID( strValue, strGameCode )
{
	var nIndex = document.all.RestWord.IsRestrictWord( strValue, strGameCode );
	return ( nIndex != 0 );
}

function GnxRestrictWords_HasReservedID( strValue, strGameCode )
{
	var nIndex = document.all.RestWord.HasRestrictWords( strValue, strGameCode );
	return ( nIndex != 0 );
}

function GnxRestrictWords_CheckPageEnd()
{	
	EVM.addCommand( EVM.k_nEventType_onPageEnd, EVM.k_nPriority_normal, new EVMDelegator( GnxRestrictWords.CreateObject ) );
}

function GnxRestrictWords_CreateObject()
{
	if ( !NXPM.IsRestrictWordsInstalled() )
	{
		NXPM.InstallRestrictWords();
	}
	
	document.body.insertBefore( document.createElement( "<div id='divRestrictWords'></div>" ) );
	divRestrictWords.innerHTML = ( new NxActiveX( 'RestWord' ) ).GetString();
}

function GnxRestrictWords_init()
{
	EVM.addCommand( EVM.k_nEventType_onNXPMInitialized, EVM.k_nPriority_normal, new EVMDelegator( GnxRestrictWords.CheckPageEnd ) );	
}

// Singleton object »ý¼º
var GnxRestrictWords = new __GnxRestrictWords();
GnxRestrictWords.init();
