/*
 * Copyright (C) 1995-2012 by 4system Polska Sp. z o.o.
 * All Rights Reserved. v4
 */

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

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

componentActiveXPowerPoint.prototype.componentActiveXPowerPointBaseonCreate = componentActiveXPowerPoint.prototype.onCreate;
componentActiveXPowerPoint.prototype.onCreate = function(obj)
{ 
	this.captureMouseEvents();
	this.componentActiveXPowerPointBaseonCreate();
};

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

componentActiveXPowerPoint.prototype.isActiveX = function()
{
	this.text = this.msg;
	var myApp = null;
	try
	{
		myApp = new ActiveXObject("Powerpoint.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;
	}
}
componentActiveXPowerPoint.prototype.onAfterLoad = function()
{
	var content = this.findContentObj();
	content.innerHTML = this.text;
}


