function item(code, name, info,category, subCategory,price, weight,link, selectName1, selections1, selectName2, selections2,mva) 
{
	this.code = code;
	this.name = name;
	this.info = info;
	this.mva = 1 + mva/100;
	this.price = price;
	this.weight = weight;
	this.selections1 = selections1;
	this.selectName1 = selectName1;
	this.selections2 = selections2;
	this.selectName2 = selectName2;
	this.link = link;
	
	
	
	categoryFound = false;

	for (var i = 0; i < allCategories.length; i++){
		cat = allCategories[i];	
		if (cat.name.toUpperCase() == category.toUpperCase())
			for (var j = 0; j < cat.subCategories.length; j++){
				subCat = cat.subCategories[j];
				if (subCat.name.toUpperCase() == subCategory.toUpperCase()) {
					subCat.addItem(this);
					categoryFound = true;
					break;
				}
			}
		if (categoryFound)
			break;
	}
	
}




function getItems( subCategoryName ) {
	returnVal = null;
	for (var i = 0; i < this.subCategories.length; i++){
		subCat = this.subCategories[i];
		if (subCat.name == subCategoryName) {
			returnVal =  subCat.items;
			break;
		}
	}
	return (returnVal);
}

function category( categoryName, subCategories ) {
	this.name = categoryName;
	this.subCategories = new Array();
	this.getItems = getItems;
	for (var i = 0; i < subCategories.length; i++){
		this.subCategories[i] = new subCategory( subCategories[i] );
	}
}


function addItem( item ) {
	this.items[this.items.length] = item;
}

function subCategory( subCategoryName ) {
	this.name = subCategoryName;
	this.items = new Array();
	this.addItem = addItem;
}





