function checkRequest(){
	var txtRequest = document.getElementById("txtRequest");
	if (txtRequest.value == ""){
		alert("Please provide your topic or speaker interest.");
		txtRequest.focus();
		return false;
	}
	if (txtRequest.value.length > 20){
		alert("Requests cannot exceed 20 characters. Please shorten your request.");
		txtRequest.focus();
		return false;
	}
	//all good
	return true;
}
function isValidEmail(str) {
	var i=0;
	var iper=0;
	var iat=0;
	var iLen=0;
	var strReturn=1;
	var strChar=""
	
	iLen = str.length;
//	alert("here we go5++++---");
//	alert(iLen);
//	alert(str.charAt(1));
//	alert(str.indexOf("."));

//	while (i <= iLen)
//	{
//	/	document.write("The number is " + i);
//		document.write("<br />");		
//		i=i+1;
//	}
//	i=4;
//	strChar = str.charAt(i);
//	document.write("char at 4 is " + strChar);
//	document.write("<br />");		

	i = 0;
	while (i <= iLen)
	{
		strChar = str.charAt(i);
		if (strChar == ".")
		{
			iper=iper+1;
		}
		if (strChar == "@")
		{
			iat=iat+1;
		}
		i=i+1;
	}
//		document.write("Total Periods " + iper);
//		document.write("<br />");		
//		document.write("Total @ " + iat);
//		document.write("<br />");		
	if (iper == 0) 
	{
		strReturn=0;
	}
	if (iper > 3) 
	{
		strReturn=0;
	}
//	if (iat = 0)
//	{
//		strReturn=0;
//	}
	if (iat != 1)
	{
		strReturn=0;
	}
//	strReturn=0;
//	document.write("result " + strReturn);
//	document.write("<br />");		
	return strReturn;
}
function checkSubscribe(){
	var txtEmail = document.getElementById("txtEmail");
	if (txtEmail.value == ""){
		alert("Please provide your email address to subscribe to the newsletter.");
		txtEmail.focus();
		return false;
	}
	else if(!isValidEmail(txtEmail.value)){
		alert("Email address appears to be invalid.");
		txtEmail.focus();
		txtEmail.select();
		return false;
	}
	//all good
	return true;
}