var availableSizes = new Object();
            availableSizes["psas"] = {"Please Select Size":{"name":"Please Select Size"}};
			availableSizes["Round"] = {"Please Select Size":{"name":"Please Select Size"},"1":{"name":"1 inch","prices":{1000000:"0.21",9999:"0.22",4999:"0.25",2499:"0.28",999:"0.45",499:"0.57",249:"1.04",0:"0"}}"1 1/4":{"name":"1 1/4 inch","prices":{1000000:"0.21",9999:"0.22",4999:"0.25",2499:"0.28",999:"0.45",499:"0.57",249:"1.04",0:"0"}}, "1 1/2":{"name":"1 1/2 inch","prices":{1000000:"0.22",9999:"0.24",4999:"0.28",2499:"0.30",999:"0.46",499:"0.59",249:"1.08",0:"0"}}, "1 3/4":{"name":"1 3/4 inch","prices":{1000000:"0.24",9999:"0.25",4999:"0.29",2499:"0.32",999:"0.47",499:"0.65",249:"1.10",0:"0"}}, "2 1/4":{"name":"2 1/4 inch","prices":{1000000:"0.26",9999:"0.27",4999:"0.31",2499:"0.35",999:"0.5",499:"0.74",249:"1.17",0:"0"}}, "2 1/4 2pc":{"name":"2 1/4 inch 2pc","prices":{1000000:"0.29",9999:"0.3",4999:"0.34",2499:"0.38",999:"0.53",499:"0.79",249:"1.32",0:"0"}}, "2 1/2":{"name":"2 1/2 inch","prices":{1000000:"0.29",9999:"0.3",4999:"0.35",2499:"0.39",999:"0.53",499:"0.77",249:"1.25",0:"0"}}, "3":{"name":"3 inch","prices":{1000000:"0.33",9999:"0.35",4999:"0.4",2499:"0.43",999:"0.57",499:"0.81",249:"1.34",0:"0"}},"3 2pc":{"name":"3 inch 2pc","prices":{1000000:"0.38",9999:"0.4",4999:"0.44",2499:"0.46",999:"0.62",499:"0.86",249:"1.4",0:"0"}}, "3 1/2":{"name":"3 1/2 inch","prices":{1000000:"0.36",9999:"0.37",4999:"0.41",2499:"0.44",999:"0.70",499:"0.91",249:"1.4",0:"0"}}};
			availableSizes["Rectangle"] = {"Please Select Size":{"name":"Please Select Size"},"2 x 3 paper back":{"name":"2 x 3 inch paper back","prices":{1000000:"0.54",9999:"0.56",4999:"0.58",2499:"0.61",999:"0.78",499:"0.94",249:"1.65",0:"0"}}, "2 x 3 metal back":{"name":"2 x 3 inch metal back","prices":{1000000:"0.38",9999:"0.39",4999:"0.42",2499:"0.5",999:"0.63",499:"0.84",249:"1.54",0:"0"}}, "2 1/2 x 3 1/2":{"name":"2 1/2 x 3 1/2 inch","prices":{1000000:"0.42",9999:"0.43",4999:"0.45",2499:"0.5",999:"0.69",499:"1.06",249:"1.64",0:"0"}}, "1 x 1 1/2":{"name":"1 x 1 1/2 inch","prices":{1000000:"0.3",9999:"0.32",4999:"0.34",2499:"0.37",999:"0.49",499:"0.74",249:"1.39",0:"0"}}};
            availableSizes["Square"] = {"Please Select Size":{"name":"Please Select Size"},"2 paper back":{"name":"2 inch paper back","prices":{1000000:"0.54",9999:"0.56",4999:"0.58",2499:"0.61",999:"0.78",499:"0.94",249:"1.65",0:"0"}}, "2 metal back":{"name":"2 inch metal back","prices":{1000000:"0.35",9999:"0.36",4999:"0.39",2499:"0.46",999:"0.59",499:"0.79",249:"1.49",0:"0"}}};
            availableSizes["Triangle"] = {"3":{"name":"3 inch","prices":{1000000:"0.4",9999:"0.41",4999:"0.43",2499:"0.52",999:"0.53",499:"0.89",249:"1.55",0:"0"}}};
            availableSizes["Oval"] = {"1 7/8 x 2 7/8":{"name":"1 7/8 x 2 7/8 inch","prices":{1000000:"0.39",9999:"0.4",4999:"0.42",2499:"0.51",999:"0.52",499:"0.84",249:"1.53",0:"0"}}};
            availableSizes["Oblong"] = {"1 3/4":{"name":"1 3/4 inch","prices":{1000000:"0.48",9999:"0.49",4999:"0.51",2499:"0.56",999:"0.75",499:"1.13",249:"1.7",0:"0"}}};

			  function getSizes(shapeElement){
                // get the selected shape:
                var selectedShape = shapeElement.options[shapeElement.selectedIndex].value;
                // find the correct sizes for this shape:
                var sizes = availableSizes[selectedShape];
                // now we put the available sizes in the second drop down:
                var dropDown2 = document.getElementById("size");
                dropDown2.options.length = 0; // remove existing information in the dropdown
                
                for(var size in sizes){
                    var option = document.createElement("option");
                    option.text = sizes[size]["name"];
                    option.value = size;
                    
                    try {
                        dropDown2.add(option,null); // standards compliant
                    } catch(ex) {
                        dropDown2.add(option); // IE only
                    }
                }
            }
            function clearText(){
			if (document.getElementById("quantity").value == "Enter Quantity");
			(document.getElementById("quantity").value = "")}
            function doCalculation(){
                var selectedShape = document.getElementById("shape").options[document.getElementById("shape").selectedIndex].value;
                var selectedSize = document.getElementById("size").options[document.getElementById("size").selectedIndex].value;
                var selectedQuantity = document.getElementById("quantity").value;
				var doCalculation = true;
                
                // validate the data of the user:
                if (selectedQuantity == "") {
                    alert("Please select a quantity");
                    doCalculation = false;
                }
                
                // when the data is validated, do the calculation
                if (doCalculation){
                    // let's get all the available prices for the selcted shape & size:
                    var prices = availableSizes[selectedShape][selectedSize]["prices"];
                    
                    // get the correct price for the quantity
                    var previousPrice = 0;
                    for(price in prices){
                        if (selectedQuantity*1 > price){
                            // ok, we are 1 item too far; the end price should be calculated from the previousPrice:
                            alert(selectedQuantity + " x " + prices[previousPrice] + " = " + "$" + (selectedQuantity*prices[previousPrice]));
                            break; // we can stop going through the loop now
                        } else {
                            // the quantity is smaller than the maximum quantity for this price; no match found
                            previousPrice = price;
                        }
                    }
                }
 }// JavaScript Document// JavaScript Document