//=========================================================
//============ Check the username availability ============
//=========================================================
function mailProcess()
{

	document.getElementById("loader").style.display = 'block';
	var ajax = new AJAX();
	var arrParam = new Array();
	arrParam['email'] = obj.email.value;
	ajax.getRequest("mail_process.php", arrParam, showResult);
	//Cancel form submition
	return false;
}

//==================================================================
//============ Response handler for http request object ============
//==================================================================
function showResult(retVal)
{
	if(retVal == 'NO EMAIL')
	{
		document.getElementById("loader").style.display = 'none';
		document.getElementById("chk_mail").innerHTML = '<span class="red1" style="margin-left:30px;">Please enter your email</span>';
		obj.email.focus();
	}
	if(retVal == 'FAILURE')
	{
		document.getElementById("loader").style.display = 'none';
		document.getElementById("chk_mail").innerHTML = '<span class="red1" style="margin-left:30px;">Please enter a valid email</span>';
		obj.email.focus();
		obj.email.select();
	}
	if(retVal == 'SUCCESS')
	{
		document.getElementById("loader").style.display = 'none';
		document.getElementById("chk_mail").innerHTML = '<span class="grn1">Thank you for joining our Newsletter.</span>';
		obj.email.value = '';
	}
}
