<!-- hide script
var gEnvelopeWeight = .4;
var gMaxArray = 100;
var gNumberOfBoxes = 1;
var gOrderTotal = 0.00;
var gPackagingWeight = 0.00;
var gPostageAdditional = 0.00;
var gPostageInitial = 0.00;
var gRowNum = 0;
var gShippingCost = 0.00;
var gShippingHeight = 0.00;
var gShippingLength = 0.00;
var gShippingSize = 0.00;
var gShippingWeight = 0.00;
var gShippingWidth = 0.00;
var gTotalItemCount = 0;
var gTotalProductCost = 0.00;
var gTotalProductQuantity = 0;
var gTotalProductWeight = 0.00;

var itemArray = new Array(gMaxArray);

function itemQuantity(code)
{
	var loc, quantity = 0;

	if((loc = checkExists(code)) != -1)
		quantity = itemArray[loc].quantity;
	return quantity;
}

function product(code, quantity)
{ 
	this.code = code
	this.quantity = quantity
	return this;
}

function initializeArray(array)
{
	for (i = 0; i < gMaxArray; i++)
	{
		array[i] = new product('',0)
	}
}

function allItemCount()
{
	var numItems = 0;

	for (i = 0; i < gRowNum; i++)
	{
		numItems += itemArray[i].quantity
	}
	return numItems;
}

function emptyCart()
{
	var numItems = 0;

	for (i = 0; i < gRowNum; i++)
	{
		itemArray[i].quantity = 0;
	}
	gTotalItemCount = allItemCount();
}

function openInFrame2(file)
{
	parent.frames[2].document.close()
	parent.frames[2].location = file;
	parent.frames[2].document.close()
}

function showShoppingCart()
{
	if(gTotalItemCount == 0)
	{
		alert('Your shopping cart is empty.');
	}
	else
	{
		openInFrame2('shoppingCart.htm');
	}
}

function checkExists(code)
{
	var i = 0;
	var loc = -1;
	
	while (i < gRowNum)
	{
		if(itemArray[i].code == code)
		{
			loc = i;
			break;
		}
		i++;
	}
	return loc;
}

function addItem(code)
{
	var loc;
	if((loc = checkExists(code)) != -1)
	{
		itemArray[loc].quantity++;
	}
	else // add a new item
	{
		itemArray[gRowNum] = new product(code, 1);
		gRowNum++;
	}
	gTotalItemCount = allItemCount();
 }

function subtractItem(code)
{
	var loc;
	if((loc = checkExists(code)) != -1)
	{
		if(itemArray[loc].quantity > 0)
		{
			itemArray[loc].quantity--;
		}
	}
	gTotalItemCount = allItemCount();
}

function removeItem(code)
{
	var loc;
	if((loc = checkExists(code)) != -1)
	{
		itemArray[loc].quantity = 0;
	}
	gTotalItemCount = allItemCount();
}

function shipRecord()
{
	this.shipNameFirst = '';
	this.shipNameLast = '';
	this.shipEmail = '';
	this.shipAddress1 = '';
	this.shipAddress2 ='';
	this.shipAddress3 ='';
	this.shipCity = '';
	this.shipState ='';
	this.shipZipCode ='';
	this.shipCountry = 'USA';
	this.shipPhone = '';
	this.residentialIndicator1 = true;
	this.residentialIndicator2 = false;
	this.paymentType1 = false;
	this.paymentType2 = false;
	this.shipMethod;
	this.internationalIndicator = 'N';
	return this;
}

initializeArray(itemArray)
shipDetails = new shipRecord();
// end script hide -->