	oldWindows = new Array();
	windowCount = 0;
	windowMin = 0;
	
	function submitForm(formNum){
		thisForm = eval('document.cartForm' +formNum);
		itemQuantity = thisForm.itemQuantity.value;
		itemID = thisForm.itemID.value;
		oldWindows[windowCount] = window.showModelessDialog("/shopping/AddToShoppingCart.cfm?itemID=" +itemID+ "&itemQuantity=" +itemQuantity,window,"dialogHeight: 265px; dialogWidth: 515px; dialogTop: 150px; dialogLeft: 150px; edge: Sunken; center: Yes; help: Yes; resizable: Yes; status: No;");
		oldWindows[windowCount].parentWindow = window;
		windowCount++;
	}
	
	function submitURL(newURL,windowTop,windowLeft) {
		oldWindows[windowCount] = window.showModelessDialog(newURL,window,"dialogHeight: 265px; dialogWidth: 515px; dialogTop: " + windowTop + "px; dialogLeft: " + windowLeft +"px; edge: Sunken; center: Yes; help: Yes; resizable: Yes; status: No;");
		oldWindows[windowCount].parentWindow = window;
		windowCount++;
	}
	
	function killOldWindows(){
		// try to kill each window in the array (assuming the user hasnt closed them themselves)
		try {
		  for (counter = windowMin; counter < windowCount-1; counter++) {
			oldWindows[counter].killMe();
		  }
		} catch (e){}
		// empty the array
		oldWindows = new Array(oldWindows[windowCount-1]);
		windowCount = 1; windowMin = 0;
	}

	function checkQty(valueString){
		var x = parseInt(valueString);
		var z = x.toString();
		if (z.length != valueString.length) {
			alert("Please enter a valid numeric value for quantity");
			return false;
		}
		if (x < 1) {
			alert("Please enter a positive quantity");
			return false;
		}
		return true;
	}