function event_registration(id)
{
	// default initial registration screen. 

	// close the pop up and call the server with the event ID.
	hideddrivetip();
	var url = 'modules.php?mod=eventregistration&id='+id;
	displayText('maincontent',url);
	return false;
}

function submit_event_registration(id)
{
	// put registration record in database and the server side will determine
	// if the event has a fee and determine CC processor.
	var url = 'modules.php?mod=eventregistration&req=submit&id='+id;
	ret = serverFunction(url);
	ret = trimAll(ret);
	var pieces = ret.split('|');
	switch (pieces[0])
		{
		case 'paypal':		// paypal comes back 'paypal|(url to paypal to process)
			window.open(pieces[1],'win','left=40,top=40,width=980,height=600,toolbar=0,resizable=1,scrollbars=1');
			var result = 'paypal';
			break;
		case 'display':	// sent back to server command to display results of processing on the server side.
			var result = pieces[1];
			break;
		default:
			document.getElementById('maincontent').innerHTML = ret;
		}
	if (document.getElementById('submit'))
		{
		document.getElementById('submit').style.background = 'white';
		}
	
	// display the result page based on what was returned from the server and processed above.
	url = 'modules.php?mod=eventregistration&req=resultpage&id='+id;
	displayText('maincontent',url);
	return false;
}