var Step = new Class({
	initialize: function(data)
	{
	  this.attributeKeys = ["id", "name", "icon_url", "image_url", "custom_image"];
	  
	  for ( var i=0; i<this.attributeKeys.length; i++ ) 
	  {
	    this[this.attributeKeys[i]] = data[this.attributeKeys[i]];
	  }
	},
	
	getData: function()
	{
	  var data = {};
	  
	  for ( var i=0; i<this.attributeKeys.length; i++ ) 
	  {
	    data[this.attributeKeys[i]] = this[this.attributeKeys[i]];
	  }
	  data.custom_image = parseInt(this.custom_image) ? 1 : 0;
	  
	  return data;	  
	},
	
	clone: function()
	{
	  return new Step(this.getData());
	},
	
	toXML: function()
	{
	  return XMLBuilder.openTag("step", this.getData() )+XMLBuilder.closeTag("step");
	}
});

// Registers a step to be used in the Step library
Step.register = function(step)
{
  Step.all.push(step);
}

Step.all = [];