function googlecartConfigure() {
	//googlecart.configuration.postCartToSandbox = true;
	var oldCheckout = googlecart.checkout;
	googlecart.checkout = function() {
		tempor=googlecartWidget.getQuantityMessage();
		iCount=tempor.substring(0,tempor.indexOf(" "));
		var stateCount=shipping(1,'West','15',0,Array('AZ','CA','CO','ID','MT','NV','NM','OR','WA','WY'),iCount);
		stateCount=shipping(2,'East','20',stateCount,Array('AL','AR','CT','DE','IL','IN','IA','KS','ME','MD','MA','MI','MN','MO','NE','NH','NJ','NY','NC','ND','OH','OK','PA','RI','SD','UT','VT','VA','WV','WI'),iCount);
		stateCount=shipping(3,'South East','25',stateCount,Array('FL','GA','KY','LA','MS','SC','TN','TX'),iCount);
		stateCount=shipping(4,'Alska, Hawaii','50',stateCount,Array('AK','HI'),iCount);
		oldCheckout()
	}
}

function shipping(id,name,price,stateCount,states,iCount){
	$("#googlecart-checkout-config").append('<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-'+id+'.name" value="'+name+'"/>');
	$("#googlecart-checkout-config").append('<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-'+id+'.price" value="'+(iCount*price)+'.00"/>');
	$("#googlecart-checkout-config").append('<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-'+id+'.currency" value="USD"/>');
	for ( var i=0, len=states.length; i<len; ++i ){
		$("#googlecart-checkout-config").append('<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-'+id+'.shipping-restrictions.allowed-areas.us-state-area-'+(i+1+stateCount)+'.state" value="'+states[i]+'"/>');
	}
	return stateCount+states.length;
}