<!--function validate(form){	if(form.Name.value=="" || form.Address.value=="" || form.City.value=="" || form.State.value=="" || form.Code.value=="" || form.Country.value=="" || form.Email.value=="" || form.ReEmail.value=="" || form.Shipping.value=="" || form.Payment.value==""){		alert("You did not enter all required information. Please go back and check your entered information.");		return false;	}	if(form.Email.value != form.ReEmail.value ){		alert("Your email addresses do not match, please check then again.");		form.Email.focus();		return false;	}	} function setText(elemNum, value){	var elem = document.getElementById("SUB_"+elemNum);	elem.value = "$"+round_decimals(value,2);}function CalculateTotal(frm) {	//set all variables to initial zero    var order_total = 0   var item_total = 0   var sub_total=0   var num_items=0       // Run through all the form fields    for (var i=0; i < frm.elements.length; ++i) {        // Get the current field        form_field = frm.elements[i]        // Get the field's name        form_name = form_field.id        // Is it a "product" field?        if (form_name.substring(0,4) == "PROD") {			// If so, extract the price from the name            item_price = parseFloat(form_name.substring(form_name.lastIndexOf("_") + 1))            // Get the quantity            item_quantity = parseInt(form_field.value)			            // Update the order total            if (item_quantity >= 0) {				num_items+=item_quantity				sub_total += item_quantity * item_price 				item_total = item_quantity * item_price									//set the item amount total				setText(form_name,item_total)            }        }    }		//check and see if inidiana resident, if yes then add 6% sales tax                if(frm.State.value=="IN"){					var tax=(sub_total)*.06				}				else{					var tax=0				}	//calculate shipping based on ($x for first item and $0.50 for each additional	var shipping_total=0	var first_item=0	if(frm.Shipping.value!=""){		switch(frm.Shipping.value){			case "Media Mail" : first_item=3.50; break;			case "Priority": first_item=5.50; break;			case "Global Priority": first_item=9.00; break;			case "Standard Air": first_item=8.00; break;			case "Surface": first_item=6.00; break;		}		shipping_total=first_item+(num_items-1)*.50	}		//calculate final order total	order_total=sub_total+tax+shipping_total	    // Display the total rounded to two decimal places and update all relevant fields	frm.ShippingTotal.value="$"+round_decimals(shipping_total,2)	frm.SubTotal.value="$"+round_decimals(sub_total, 2)	frm.SalesTax.value="$"+round_decimals(tax, 2)    frm.Total.value = "$"+round_decimals(order_total, 2)}function round_decimals(original_number, decimals) {    var result1 = original_number * Math.pow(10, decimals)    var result2 = Math.round(result1)    var result3 = result2 / Math.pow(10, decimals)    return pad_with_zeros(result3, decimals)}function pad_with_zeros(rounded_value, decimal_places) {    // Convert the number to a string    var value_string = rounded_value.toString()        // Locate the decimal point    var decimal_location = value_string.indexOf(".")    // Is there a decimal point?    if (decimal_location == -1) {                // If no, then all decimal places will be padded with 0s        decimal_part_length = 0                // If decimal_places is greater than zero, tack on a decimal point        value_string += decimal_places > 0 ? "." : ""    }    else {        // If yes, then only the extra decimal places will be padded with 0s        decimal_part_length = value_string.length - decimal_location - 1    }        // Calculate the number of decimal places that need to be padded with 0s    var pad_total = decimal_places - decimal_part_length        if (pad_total > 0) {                // Pad the string with 0s        for (var counter = 1; counter <= pad_total; counter++)             value_string += "0"        }    return value_string}//-->