function manageMLFields(theField, theState)
{
	var theString = 'Your Name'
	var theInput = document.forms["mailingListForm"].subscriberName
	if(theField == 2)
	{
	var theString = 'Your E-mail Address'
	var theInput = document.forms["mailingListForm"].subscriberEmail
	}
	
	if(theState == 1)
	{
		if(theInput.value == theString) theInput.value = ''
	}else{
		if(theInput.value == '') theInput.value = theString
	}
	
}

function validateMailingListForm()
{
	var flag = true;
	if(flag && document.forms["mailingListForm"].subscriberName.value == 'Your Name') {flag = false;document.getElementById('subscriberNameErrMsg').style.display = ''}
	if(flag && document.forms["mailingListForm"].subscriberEmail.value == 'Your E-mail Address') {flag = false;document.getElementById('subscriberEmailErrMsg').style.display = ''}
	if(flag) flag = validateInputNotNull('mailingListForm','subscriberName','subscriberNameErrMsg')
	if(flag) flag = validateEmail('mailingListForm', 'subscriberEmail', 'subscriberEmailErrMsg', 1)
	
	if(flag)
	{
		document.getElementById('subscriberNameErrMsg').style.display = 'none'
		document.getElementById('subscriberEmailErrMsg').style.display = 'none'
		document.getElementById('mlLoader').style.display = ''
		document.forms["mailingListForm"].submit()
		disableEnableForm('mailingListForm', true)
	}
}

function mailingListResult(theResult)
{
	document.getElementById('thanksMsg').style.display = 'none'
	document.getElementById('alreadyRegMsg').style.display = 'none'
	document.getElementById('subscriberNameErrMsg').style.display = 'none'
	document.getElementById('subscriberEmailErrMsg').style.display = 'none'
	document.getElementById('mlLoader').style.display = 'none'
	disableEnableForm('mailingListForm', false)
	if(theResult == 0)
	{
		document.getElementById('thanksMsg').style.display = ''
		timedMessageDisplay('thanksMsg',5)
		document.forms["mailingListForm"].reset()
	}else{
		document.getElementById('alreadyRegMsg').style.display = ''
		timedMessageDisplay('alreadyRegMsg',5)
	}
}
