<!--

function popup2(url)
{
	var newwindow=window.open(url,'name','height=360,width=680,left=5,top=84,resizable=no,scrollbars=no,toolbar=no,status=no');
	if (window.focus) {newwindow.focus()}
}

function checkEmail(strEmail)
{
	var AT = "@";
	var DOT = ".";

	var len = strEmail.length;
	var posAT = strEmail.indexOf(AT);
	var posDOT = strEmail.indexOf(DOT);
	
	if (posAT == -1){alert("Invalid E-mail ID"); return false;}
	if (posAT == -1 || posAT == 0 || posAT == len){alert("Invalid E-mail ID");return false;}

	if (posDOT == -1 || posDOT == 0 || posDOT == len){alert("Invalid E-mail ID");return false;}
	
	if (strEmail.indexOf(AT,(posAT + 1)) != -1){alert("Invalid E-mail ID");return false;}

	if (strEmail.substring(posAT - 1,posAT) == DOT || strEmail.substring(posAT + 1,posAT + 2)== DOT){alert("Invalid E-mail ID");return false;}

	if (strEmail.indexOf(DOT,(posAT + 2)) == -1){alert("Invalid E-mail ID");return false;}
		
	if (strEmail.indexOf(" ") != -1){alert("Invalid E-mail ID");return false;}

 	return true
}

function validateEmail(strEmail)
{
	var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	return re.test(strEmail);
}

function removeWhiteSpace(strValue)
{
	return strValue.replace(/^\s*|\s*$/g,'');
}

function ValidateRegistrationForm()
{
	var FName = removeWhiteSpace(document.getElementById('txtFName').value);
	if(FName == '')
	{
		alert("Please enter your first name.");
		document.getElementById('txtFName').focus();
		return false;
	}

	var Email = removeWhiteSpace(document.getElementById('txtEmail').value);
	if(Email == '')
	{
		alert("Please enter your email.");
		document.getElementById('txtEmail').focus();
		return false;
	}
	
	if(!validateEmail(Email)) 
	{
		alert("Invalid email.");
		document.getElementById('txtEmail').focus();
		document.getElementById('txtEmail').select();
		return false;
	}
	
	return true;
}

// -->

