function clearField(fieldName)
{
	$(fieldName).value = '';
}

function joinList(mainNav)
{
	var emailList = 'emailList';
	if (mainNav == 0)
	{
		emailList = 'emailListMain';
	}
	
	if ($F(emailList) == '' || $F(emailList) == 'Enter your email address')
	{
		alert('Please enter your email address.');
	}
	else if ($F('personID') == '')
	{
		var params = 'a=joinlist&e='+$F(emailList)+'&m='+$F('sourceMethod');
		var myAjax = new Ajax.Request(ajaxURL+'/web/util/joinEmail.php',
			{parameters: params, asynchronous: true, onSuccess: joinListResponse});		
	}
	else
	{
		alert('Please go to the edit account page to change your email settings.');
	}
}

function joinListResponse(req)
{	
	if (req.responseText == 1)
	{
		alert('Your email has been added to our list.');
	}
	else if (req.responseText == "-1")
	{
		alert('Your email has already been added to our list.');
	}
	else
	{
		alert('The email you entered is invalid.');
	}
}
function showHIW()
{
	$('overlay').style.display = 'block';
	$('hiw').style.display = 'block';
}
function closeHIW()
{
	$('hiw').style.display = 'none';
	$('overlay').style.display = 'none';
}