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

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

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

componentActiveXAccess.prototype.componentActiveXAccessBaseonCreate = componentActiveXAccess.prototype.onCreate;
componentActiveXAccess.prototype.onCreate = function(obj)
{ 
	this.captureMouseEvents();
	this.componentActiveXAccessBaseonCreate();
};

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

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