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

componentStepButton = function(name)
{
	//inherited	
	this.__componentImage = __componentImage;
	this.__componentImage(name);
	this.confirmAnswer = false;	
};

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

componentStepButton.prototype.componentStepButtonBaseOnCreate = componentStepButton.prototype.onCreate;
componentStepButton.prototype.onCreate = function(obj)
{
	this.componentStepButtonBaseOnCreate();
	
    this.resourcesURL = unescape(this.resourcesURL);
	
	this.captureMouseEvents();
	if ( this.stopTimeLine ) {
		page.stepsRunAutomate = false;	
		page._stepsTimerStop();
	};
};

componentStepButton.prototype.eventClick = function(e)
{
	if ((this.confirmAnswer) && (page.pageType == "Exercise") && (page._isEveryPageVisited())) {
		PageInterface.Execute("checkAnswer"); 
	} else {
		if (this.onClick && this.onClick(this))     return true;
		if (this.parent && this.parent.eventClick)  this.parent.eventClick(e);
    
		if(this.resetStepsOnChange) {
			PageInterface.Execute("showSingleStep", page._getLastNotVisitedStep());
		} else PageInterface.Execute("nextStep"); 
	};
	
	if ((page._isEveryPageVisited()) && (this.hideOnLastStep)) this.hide();
	return false;
};





















