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

componentPrevStepButton = function(name)
{
	//inherited
	this.componentStepButton = componentStepButton;
	this.componentStepButton(name);

	this.confirmAnswer = false;
};

componentPrevStepButton.prototype = new componentStepButton();
componentPrevStepButton.prototype.type = "componentPrevStepButton";

componentPrevStepButton.prototype.onBaseCreate = function(obj)
{
    this.resourcesURL = unescape(this.resourcesURL);
	this.captureMouseEvents();
};

componentPrevStepButton.prototype.eventClick = function(e)
{
	if (this.onClick && this.onClick(this))     return true;
	if (this.parent && this.parent.eventClick)  this.parent.eventClick(e);

	PageInterface.Execute("prevStep"); 

	return false;
};

componentPrevStepButton.prototype.onStep = function() //pg2-BSH_stepButton -if automatic lauch of steps is enabled, the button wouldn't be hidden on last step; also fixed in "page._isEveryPageVisited()"
{	
	if (!this.hideOnFirstStep || !page) return;

	if (page.stepIndex == 0) this.hide(); else this.show();
};
