function initBuyForms()
{
	$$('.buyForm').each(
	function(form)
	{
		getStockByCombination(form);
		showPriceByOption(form);
		form.addEvent('submit', function()
			{
				//overwrite form action
				this.action = shop.url + '/ajaxTemplates/products/addProduct.cfm';
				if( Spry.Widget.Form.validate(this) )
				{
					return Spry.Utils.submitForm(this, validateAddProduct);
				}
			}
		);
	}
	);
}


function validateAddProduct(req)
{
	var objResponse = eval('('+req.xhRequest.responseText+')');
	
	if(objResponse.ADDED)//product added
	{
		
		$('loadingImage'+ objResponse.PRODUCTID).destroy();
		$('addProduct'+objResponse.PRODUCTID).style.display = '';
		ajaxLoad(shop.url+'/ajaxTemplates/basket/asyncBasket.cfm', $('asyncBasketBox'), 'showMiniBasket();' );
		ajaxLoad(shop.url+ '/ajaxTemplates/basket/miniBasket.cfm', $('minibasket'), '' ,'');
		//reload asyncBasket
		//$('asyncBasket').innerHTML;		
		//showMiniBasket();
	}
	else
	{
		shop.cuteAlert.addMessage(languageSheet.lblError, languageSheet.lblProductNotAdded, 0, 0);
	}
	
}