


function setDonationAmount(field){
	if(field.options[field.selectedIndex].value == ""){
		$('tx-donations-amount-select').set('style', 'display:none;');
		//$('tx-donations-amount').set('type', 'text');
		var inputAmount = new Element('input', {'type': 'text', 'id': 'tx-donations-amount', 'name':'tx_donations[amount]' });
		inputAmount.replaces($('tx-donations-amount'));
	}
	else {
		$('tx-donations-amount').set('value', field.options[field.selectedIndex].value);
	}
}

function setDonationType(type){
	if(type == "normal"){
		$('tx-donations-normal-data').set('style', 'display:block;');
		$('tx-donations-name').set('value', '');
	}
	else {
		$('tx-donations-normal-data').set('style', 'display:none;');
		$('tx-donations-name').set('value', 'Anonym');
		$('tx-donations-company').set('value', '');
		$('tx-donations-addr').set('value', '');
		$('tx-donations-zip').set('value', '');
		$('tx-donations-city').set('value', '');
		$('tx-donations-country').set('value', '');
		$('tx-donations-email').set('value', '');
	}
}

formDisabled = 0;
function setDonationFormAction(action, form, mode){
	
	if(mode=="payment" && formDisabled==0){
		OpenSaferpayTerminal(action,form,'FORM');
		return false;
	}
	else {
		form.action = action;
		formDisabled = 1;
	}
}