AddScript("modules/AltaB2xUi/scripts/ajax.js");

function ProductPhotos(InstanceName, Containter, ProdID, GRN, FCAfterLoad)
{
	this._InstanceName = InstanceName;
	this._Containter = Containter;
	this._ProdID = ProdID;
	this._GRN = GRN ? GRN : "";
	this._FCAfterLoad = FCAfterLoad ? FCAfterLoad : "";
	
	this.Intilize = function() 
	{
		TextHttpInit("default.aspx?bridge=productphotos&c=true&m=Catalog&prod=" + this._ProdID + (this._GRN && this._GRN != "" ? "&grn=" + this._GRN : ""), this._InstanceName + ".LoadPhotos");
	}
	
	this.LoadPhotos = function(_html)
	{
		if(GetObject(this._Containter))
		{
			GetObject(this._Containter).innerHTML = _html;
		}
		
		if(this._FCAfterLoad && this._FCAfterLoad != "")
		{
			if(typeof(this._FCAfterLoad) == "string") eval(this._FCAfterLoad+"()");
			else if(this._FCAfterLoad.length) for(var i=0;i<this._FCAfterLoad.length;i++) eval(this._FCAfterLoad[i]+"()");
		}
	}
	
	this.Intilize();
}


