//Javascript File
//Product Metadata Object

//**************************************************************************************************
//GAProduct Object - Inherits AjaxPlugin class
var GAProducts = Class.create(AjaxPlugin, {
	//Methods
	initialize: function($super, json) {
		//superclass constructor
		$super();
		//Register Events
		this.register_event_names([]);
		//Properties
		this.jsonFile = json;
		this.productTypes = "";
    
		//Load JSON file into types
		new Ajax.Request(json, {
			evalJSON: false,
			onSuccess: function(transport) {
				try
				{
					eval('this.productTypes = new Hash('+transport.responseText+');'); 
				}
				catch (e)
				{
					this.logError('product JSON load failed:'+e.name+','+e.message);
				}
			}.bind(this)
		});
	}
});