		var oldSizeId = new Array();
		var oldSizeName = new Array();
		var oldColorId = new Array();
		var hoverColorId = "";
		var oldColorName = new Array();
		var productColorsToSizes = new Object();
		var productSizesToColors  = new Object();
		var productAllColorIds = new Object();
		var productAllColorNames = new Array();
		var productSwatchToImage = new Array();
		var productCurrentImage = new Array();
		var productCurrentImageLink = new Array();
		var productOriginalImage = new Array();
		var productOriginalImageLink = new Array();
		var productAllSizeIds = new Object();
		var productAllSizeNames = new Array();
		var disabledColors = new Array();
		var disabledSizes = new Array();
		var productSortVals = new Array();
		function changeSize(curProduct, sizeId, sizeName, formNum) {
			if(disabledSizes[sizeId] == 1) {
				return;
			}
			var newSelectionHtml = "";
			if(oldColorName[curProduct] != null && oldColorName[curProduct] != "") {
				newSelectionHtml = oldColorName[curProduct];
			}

			if(oldSizeId[curProduct] == sizeId) {
				if(document.getElementById(curProduct + "selection") != null) {
					if(newSelectionHtml != "") {
						document.getElementById(curProduct + "selection").innerHTML = newSelectionHtml;
					} else {
						document.getElementById(curProduct + "selection").innerHTML = "&nbsp;";
					}
				}
				document.getElementById(sizeId).className = "size_off";
				document.getElementById(curProduct + "selectedsize").innerHTML = "Select Size: ";
				oldSizeId[curProduct] = "";
				oldSizeName[curProduct] = "";
				document.getElementById("ATR_Kohls_Size_Sort_Value" + formNum).value = "";
			} else {
				if(document.getElementById(curProduct + "selection") != null) {	
					if(newSelectionHtml != null && newSelectionHtml != "") {
						newSelectionHtml = newSelectionHtml + ", " + sizeName;
					} else {
						newSelectionHtml = sizeName;
					}
					document.getElementById(curProduct + "selection").innerHTML = newSelectionHtml;
				}

				document.getElementById(sizeId).className = "size_on";
				if(oldSizeId[curProduct] != null && oldSizeId[curProduct] != "") {
					document.getElementById(oldSizeId[curProduct]).className = "size_off";
				}
				document.getElementById(curProduct + "selectedsize").innerHTML = "Select Size: " + sizeName;
				document.getElementById("ATR_Kohls_Size_Sort_Value" + formNum).value = productSortVals[sizeId];
				oldSizeId[curProduct] = sizeId;
				oldSizeName[curProduct] = sizeName;
			}
		}

		function colorMouseOver(productId, colorLoc) {
			if(disabledColors[productId + "swatch" + colorLoc] == 1) {
				return;
			}
			if(hoverColorId != "" && hoverColorId != oldColorId[productId]) {
				document.getElementById(oldColorId).src = "/media/images/StaticContent/products/swatch_off.gif";
			}
			if(productId + "swatch" + colorLoc != oldColorId[productId]) {
				document.getElementById(productId + "swatch" + colorLoc).src = "/media/images/StaticContent/products/swatch_hover.gif";
				hoverColorId = productId + "swatch" + colorLoc;
			}
				document.getElementById("productImage" + productId).src = productSwatchToImage[productId + "swatch" + colorLoc];
		}

		function colorMouseOut(productId, colorLoc) {
			if(disabledColors[productId + "swatch" + colorLoc] == 1) {
				return;
			}
			if(productId + "swatch" + colorLoc != oldColorId[productId]) {
				document.getElementById(productId + "swatch" + colorLoc).src = "/media/images/StaticContent/products/swatch_off.gif";
				hoverColorId = "";
				var useImage = productCurrentImage[productId];	
				if(useImage == null || useImage == "") {
					useImage = productOriginalImage[productId];
				}
				document.getElementById("productImage" + productId).src = useImage;
			}
			
		}

		function changeColor(curProduct, colorId, colorName, formNum) {
			if(disabledColors[colorId] == 1) {
				return;
			}
			var newSelectionHtml = "";

			if(oldColorId[curProduct] == colorId) {
				if(document.getElementById(curProduct + "selection") != null) {	
					if(oldSizeName[curProduct] != null && oldSizeName[curProduct] != "") {
						document.getElementById(curProduct + "selection").innerHTML = oldSizeName[curProduct];
					} else {
						document.getElementById(curProduct + "selection").innerHTML = "&nbsp;";
					}
				}
				if(colorId == hoverColorId) {
					document.getElementById(colorId).src = "/media/images/StaticContent/products/swatch_hover.gif";
				} else {
					document.getElementById(colorId).src = "/media/images/StaticContent/products/swatch_off.gif";
				}
				document.getElementById(curProduct + "selectedtext").innerHTML = "Select Color: ";
				document.getElementById("ATR_Display_Color" + formNum).value = "";
				oldColorId[curProduct] = "";
				oldColorName[curProduct] = "";
				productCurrentImage[curProduct] = productOriginalImage;
				document.getElementById("productImage" + curProduct).src = productOriginalImage;
			} else {
				if(document.getElementById(curProduct + "selection") != null) {	
					if(oldSizeName[curProduct] != null && oldSizeName[curProduct] != "") {
						document.getElementById(curProduct + "selection").innerHTML = colorName + ", " + oldSizeName[curProduct];
					} else {
						document.getElementById(curProduct + "selection").innerHTML = colorName;
					}
				}
				if(oldColorId[curProduct] != null && oldColorId[curProduct] != "") {
					if(oldColorId[curProduct] != hoverColorId) {
							document.getElementById(oldColorId[curProduct]).src = "/media/images/StaticContent/products/swatch_off.gif";
					} else {
							document.getElementById(oldColorId[curProduct]).src = "/media/images/StaticContent/products/swatch_hover.gif";
					}
				}
				document.getElementById(colorId).src = "/media/images/StaticContent/products/swatch_on.gif";
				document.getElementById(curProduct + "selectedtext").innerHTML = "Select Color: " + colorName;
				document.getElementById("ATR_Display_Color" + formNum).value = colorName;
				oldColorId[curProduct] = colorId;
				oldColorName[curProduct] = colorName;
				
				productCurrentImage[curProduct] = productSwatchToImage[colorId];
				document.getElementById("productImage" + curProduct).src = productCurrentImage[curProduct];
			}
		}

		//add a value to a mixed map
		function addMixedMapValue(mixedMap, key, value) {
			var mapKey;

			//see if the key already exists
			mapKey = mixedMap[key];
			if(mapKey == null) {
				mapKey = new Array();
				mixedMap[key] = mapKey;
			}
			//push it to the end of the array
			mapKey.push(value);
		}

		//gets the constraints for a given key pair
		//returned as an array
		function getMixedMapArray(mixedMap, keyId) {
			return mixedMap[keyId];
		}	

		    function showAvailColors(productId, sizeId) {
				var allColors = getMixedMapArray(productAllColorIds, productId);
				var allowedColors = getMixedMapArray(productSizesToColors, sizeId);
				var availColorLoc;
				var allColorLoc;
				if(disabledSizes[sizeId] == 1) {
					return;
				}
				for( allColorLoc in allColors) {
					if(allColors[allColorLoc] != oldColorId[productId]) {
						if(sizeId != oldSizeId[productId]) {
							document.getElementById(allColors[allColorLoc]).src = "/media/images/StaticContent/products/swatch_unavail.gif";
							disabledColors[allColors[allColorLoc]] = 1;
						} else {
							document.getElementById(allColors[allColorLoc]).src = "/media/images/StaticContent/products/swatch_off.gif";
							disabledColors[allColors[allColorLoc]] = 0;
						}

					}
				}
				if(sizeId != oldSizeId[productId]) {
					for(availColorLoc in allowedColors) {
						if(allowedColors[availColorLoc] != oldColorId[productId]) {
							document.getElementById(allowedColors[availColorLoc]).src = "/media/images/StaticContent/products/swatch_off.gif";
							disabledColors[allowedColors[availColorLoc]] = 0;
						}
					}
				}		
			}

		    function showAvailSizes(productId, colorId) {
			var allSizes = getMixedMapArray(productAllSizeIds, productId);
			var allowedSizes = getMixedMapArray(productColorsToSizes, colorId);
			var availSizeLoc;
			var allSizeLoc;
			if(disabledColors[colorId] == 1) {
				return;
			}
			for(allSizeLoc in allSizes) {
				if(allSizes[allSizeLoc] != oldSizeId[productId]) {
					if(colorId != oldColorId[productId]) {
						document.getElementById(allSizes[allSizeLoc]).className = "size_unavail";
						disabledSizes[allSizes[allSizeLoc]] = 1;
					} else {
						document.getElementById(allSizes[allSizeLoc]).className = "size_off";
						disabledSizes[allSizes[allSizeLoc]] = 0;
					}

				}
			}
			if(colorId != oldColorId[productId]) {
				for(availSizeLoc in allowedSizes) {
					if(allowedSizes[availSizeLoc] != oldSizeId[productId]) {
						document.getElementById(allowedSizes[availSizeLoc]).className = "size_off";
						disabledSizes[allowedSizes[availSizeLoc]] = 0;
					}
				}
			}		
		  }
		  
		  