function showForm(piLL,pid) {
	$('ajax_popup_background').setStyle({ display: 'block' });
	new Ajax.Updater('ajax_popup_background', '/index.php?id=' + pid + '&L=' + piLL, {
	  	method: 'get',
		insertion: Insertion.Top
			});	
}

function submitForm(pid) {

	var test = $('additional_participants').request({
		onSuccess: function(response) { 
			if (response.responseText == 'OK') {
						
				integrateForm(pid);
			}
			else {
				$('ajax_popup').replace(response.responseText); 
			}
			}
	});
	

	
}

function integrateForm(pid) {
	closeForm();

	$('addparts').replace('<div id="addparts"></div>');
	
	new Ajax.Updater('addparts', '/index.php?id='+pid+'&tx_eurover_pi6[getparts]=true', {
	  	method: 'get',
			insertion: Insertion.Top
			});
	
}

function delPart(id,pid) {

	new Ajax.Request('/index.php?id='+pid+'&tx_eurover_pi6[delpart]=' + id, {
		  method: 'get',
		  onSuccess: function(transport) {
		    integrateForm(pid);
		  }
		});
}

function closeForm() {
	$('ajax_popup').setStyle({
		  display: 'none'
		});
	
	$('ajax_popup_background').setStyle({
		  display: 'none'
		});
}

function doBill() {
	if ($('do_payment_check').checked) {
		$('diff_payment').setStyle({
		  display: 'block'
		});
	}
	else {
		$('diff_payment').setStyle({
		  display: 'none'
		});
	}
}
	
function newCap() {
	//var another = new Element('input', { type: "hidden", name: "tx_eurover_pi3[newcap]", value: "true" } );
	
	var another = document.createElement('input');
	another.setAttribute('type','hidden');
	another.setAttribute('name','tx_eurover_pi3[newcap]');
	another.setAttribute('value','true');
	
	$('capnew').appendChild(another);
	document.forms[0].submit();
}
	
	
	
	

