/*
* Copyright © 1995-2012 by 4system Polska Sp. z o.o.
* All Rights Reserved.
*/

componentActiveXWord = function(name)
{
	this.__componentText = __componentText;
	this.__componentText(name);
	this.isApp = false;
};

componentActiveXWord.prototype = new __componentText;
componentActiveXWord.prototype.type = "componentActiveXWord";

componentActiveXWord.prototype.componentActiveXWordBaseonCreate = componentActiveXWord.prototype.onCreate;
componentActiveXWord.prototype.onCreate = function(obj)
{ 
	this.captureMouseEvents();
	this.componentActiveXWordBaseonCreate();
};

componentActiveXWord.prototype.componentContainerBaseOnPaint = componentActiveXWord.prototype.onPaint;
componentActiveXWord.prototype.onPaint = function(obj)
{
	if (page.state != psDesigning)
	{
		this.msg = this.text;
		if (this.filePath != '') 
		{
			this.isApp = this.isActiveX();
		}
	}
	this.componentContainerBaseOnPaint();
};

componentActiveXWord.prototype.isActiveX = function()
{
	this.text = this.msg;
	var myApp = null;
	try
	{
		myApp = new ActiveXObject("Word.Application");
		if (myApp != null)
		{
			this.text = '<IFRAME SRC="'+resourcesURL + this.filePath+'" ID="'+this.id+'FRAME" WIDTH="100%" HEIGHT="100%"></IFRAME>';
			return true;
		}
		else {
			return false;
		}
	}
	catch(e)
	{
		return false;
	}
}
componentActiveXWord.prototype.onAfterLoad = function()
{
	var content = this.findContentObj();
	content.innerHTML = this.text;
}


