<!--//Additional JavaScript for ECommerce Fixes 
//Paul Boone (408)-646-2240 www.mindbucket.com






	function EnforceBounds(inputfield,min,max)
	{
		if (inputfield.value < min)
		{
			inputfield.value = min;
			alert("Please order at least the minimum number of items");	
			return false;
		}
		else if (inputfield.value > max)
		{
			inputfield.value = max;
			alert("Please order less than the maximum number of items");				
			return false;
		}
		return true;
	}
	
	
	//doesn't like select's with attribute multiple
	//array checks don't seem to work--so divided out add Surcharges into two functions
	function AddSurcharges(Order_ItemOptionsArray) {
	
		var box;
		var seloption;
		var priceIncrease = 0;

		
		if (!Order_ItemOptionsArray) {
			alert ('bad order options');
			return 0;
		}
		


		for (var iArr = 0;iArr<Order_ItemOptionsArray.length;iArr++)
		{
			box = Order_ItemOptionsArray[iArr];
			seloption = box.options[box.selectedIndex].value;
			//alert (seloption);
			if (seloption.indexOf('$') >= 0) {
				
				seloption = seloption.substr(seloption.indexOf('$') + 1);
				seloption = parseFloat(seloption);
	
				priceIncrease = priceIncrease + seloption;
			}
			
		}

		return priceIncrease;
	}
	
	//adds surcharges where argument is NOT an array!
	function AddSurchargesItem(Order_ItemOptions) {
	
		var box;
		var seloption;
		var priceIncrease = 0;

		
		if (!Order_ItemOptions) {
			alert ('bad order options');
			return 0;
		}
		
		box = Order_ItemOptions;
		seloption = box.options[box.selectedIndex].value;
		//alert (seloption);
		if (seloption.indexOf('$') >= 0) {
				
			seloption = seloption.substr(seloption.indexOf('$') + 1);
			seloption = parseFloat(seloption);

			priceIncrease = priceIncrease + seloption;
		}
			
		return priceIncrease;
	}
	
// -->