function IsTextControlNotEmpty(TextControl)
{
	if ((TextControl.value == null) || (TextControl.value == ""))
	{
		alert("Input cannot be empty");
		TextControl.focus();
		TextControl.style.backgroundColor = 'red';
		return false;
	}
	else
		return true;
}

function IsEmailValid(Control)
{
	iAPos = Control.value.indexOf("@");
	iDotPos = Control.value.lastIndexOf(".");
	if ((iAPos < 1) || ((iDotPos-iAPos) < 2) || (iDotPos == (Control.value.length-1)))
	{
		alert("The input email is not valid");
		Control.focus();
		Control.style.backgroundColor = 'red';
		return false;
	}
	else
		return true;
}

function AlertValidating(strAlert, pControl)
{
	pControl.focus();
	pControl.style.backgroundColor = 'red';
	alert(strAlert);
}