function book_event(code, event_id, price, big_price, code_name, big_code_name)
{
	new Ajax.Request('/ajax.php', {method: 'post', parameters:'action=event&code=' + code + '&event_id=' + event_id,
		onSuccess:function(req){
     		if (req.responseText == '1')
     		{
     			document.forms.paypal.item_name.value=code_name;
     			document.forms.paypal.amount.value=	price;
     		}	
     		else
     		{
     			document.forms.paypal.item_name.value=	big_code_name;
     			document.forms.paypal.amount.value=	big_price;
     		}
     		
     		document.forms.paypal.submit();
    	}, 
		onFailure:function()
		{
			alert('error');
		}
		});
}