

function item(code, name, info,price, link, selectName1, selections1, selectName2, selections2) 
{
	this.code = code;
	this.name = name;
	this.info = info;
	this.price = price;
	this.weight = 0;
	this.selections1 = selections1;
	this.selectName1 = selectName1;
	this.selections2 = selections2;
	this.selectName2 = selectName2;
	this.link = link;
	
        index1 = allCategories.length - 1;
	temp_Category = allCategories[index1];

        index2 = temp_Category.subCategories.length - 1;
	temp_SubCategory = temp_Category.subCategories[index2];

        index3 = temp_SubCategory.subCategories.length - 1;
	temp_SubCategory2 = temp_SubCategory.subCategories[index3];

	if (currentLevel == "subCategory") {
		temp_SubCategory.addItem(this);
	}
	else if (currentLevel == "subCategory2") {
		temp_SubCategory2.addItem(this);
	}
	else {
		temp_SubCategory2.addItem(this);
	}


}


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 hjcategory( categoryName ) {
	
	//document.writeln("<SCRIPT language=\"JavaScript\"> ");
	
	//document.writeln("new hjCategory(\"" + categoryName + "\");");
	//document.writeln("<\/script>");
}


function addItem( item ) {
	this.items[this.items.length] = item;
}

function hjsubCategory( subCategoryName ) {
	//document.writeln("<SCRIPT language=\"JavaScript\"> ");
	//document.writeln("new hjSubCategory(\"" + subCategoryName + "\");");
	//document.writeln("<\/script>");
}

function hjsubCategory2( subCategoryName ) {
	//document.writeln("<SCRIPT language=\"JavaScript\"> ");
	//document.writeln("new hjSubCategory2(\"" + subCategoryName + "\");");
	//document.writeln("<\/script>");
}

function category( categoryName ) {
	this.name = categoryName;
	this.subCategories = new Array();
	this.getItems = getItems;

	currentLevel = "category";

	allCategories[allCategories.length] = this;
}


function subCategory( subCategoryName ) {
	this.name = subCategoryName;
	this.items = new Array();
	this.getItems = getItems;
	this.addItem = addItem;
	this.subCategories = new Array();

	currentLevel = "subCategory";

        index1 = allCategories.length - 1;
        index2 = allCategories[index1].subCategories.length;
	allCategories[index1].subCategories[index2]  = this;
}

function subCategory2( subCategoryName ) {
	this.name = subCategoryName;
	this.items = new Array();
	this.getItems = getItems;
	this.addItem = addItem;

	currentLevel = "subCategory2";

        index1 = allCategories.length - 1;
        index2 = allCategories[index1].subCategories.length - 1;
	index3 = allCategories[index1].subCategories[index2].subCategories.length;
	allCategories[index1].subCategories[index2].subCategories[index3]  = this;	
}



function include(file) {
	document.write("<SCRIPT language=\"JavaScript\" src=\"" + file +"\"><\/script>");


}

var allCategories = new Array();
var currentLevel = "";









