
/*---------------------------------------------------------------------
Store
---------------------------------------------------------------------*/
function objStore() {
	this.galleryFolder = "";
	this.thumbnailWidth = 0;
	this.thumbnailHeight = 0;
	this.imageWidth = 0;
	this.imageHeight = 0;
	
	this.productGroupsArr = null;
	return this;
}

function objStore.prototype.addGroup(oProductGroup) {
	if (this.productGroupsArr==null) this.productGroupsArr = new Array();
	this.productGroupsArr[this.productGroupsArr.length] = oProductGroup;
}

function objStore.prototype.setImageSizes(gtw,gth,tw,th,iw,ih) {
	this.groupThumbnailWidth = gtw;
	this.groupThumbnailHeight = gth;
	this.thumbnailWidth = tw;
	this.thumbnailHeight = th;
	this.imageWidth = iw;
	this.imageHeight = ih;
}

/*---------------------------------------------------------------------
Product Group
---------------------------------------------------------------------*/
function objProductGroup(pgid) {
	this.productGroupID=pgid;
	this.name = "";
	this.productsArr = null;
	return this;
}
function objProductGroup.prototype.addProduct(oProduct) {
	if (this.productsArr==null) this.productsArr = new Array();
	oProduct.oProductGroup = this;
	
	this.productsArr[oProduct.productID] = oProduct;
}
function objProductGroup.prototype.getProduct(pid) {
	if (this.productArr) return this.productArr[pid];
	else return null;
}

/*---------------------------------------------------------------------
Product
---------------------------------------------------------------------*/
function objProduct(pid) {
	this.productID=pid;
	this.productVariationsArr = null;
	
	this.code = "";
	this.description = "";
	this.price = "";
	
	this.thumbnailFilename = "";
	this.imageFilename = "";
	
	this.oProductGroup = null;
	
	return this;
}
function objProduct.prototype.addVariation(oProductVariation) {
	if (this.productVariationsArr==null) this.productVariationsArr = new Array();
	oProductVariation.oProduct = this;
	
	this.productVariationsArr[oProductVariation.productVariationID] = oProductVariation;
}
function objProduct.prototype.getVariation(pvid) {
	if (this.productVariationsArr) return this.productVariationsArr[pvid];
	else return null;
}

/*---------------------------------------------------------------------
Product Variation
---------------------------------------------------------------------*/
function objProductVariation(pvid) {
	this.productVariationID = pvid;
	
	this.code = "";
	this.description = "";
	this.price = "";
	
	this.thumbnailFilename="";
	this.imageFilename = "";
	
	this.oProduct = null;
	
	return this;
}


