/**
	buy-check.js contains the methods used by quant/buy in each user shopping cart item description page
		doNumCheck - sanitizes the quantity
		buy - records the information needed to purchase a particular item; use cart.addItem to put it into the cart.
**/
 	
 	function doNumCheck(thing) {
 		var n = parseInt( thing.value );
 		if( isNaN(n) ) n=1;
 		if( n < 0 ) n = -n;
 		thing.value=n;
 	}

	function buy(size1, size2, model, description, quantity, price ) {
		var itemPrice = calcCost( quantity, price );
		itemPrice = makeCents( "" + itemPrice );
	
		cart.addItem( size1, size2, model, description, quantity, price, itemPrice );
		document.location = 'cart-display.html';
	}