
function isEmail(newstr)
{
	var emailexp = /^[a-z][a-z_0-9\-\.]+@[a-z_0-9\-\.]+\.[a-z]{2,5}$/i

	if (!emailexp.test(newstr) || newstr.indexOf("..") >= 0)
	{
		return false;
	}
	return true;
}


function ValidateForm(form_obj)
{

	var teststring;
	teststring=/\S/;

	if(form_obj.firstname && !teststring.test(form_obj.firstname.value))
	{
		alert("Please insert First Name!");
		form_obj.firstname.focus();
		return false;
	}
	if(form_obj.lastname && !teststring.test(form_obj.lastname.value))
	{
		alert("Please insert Last Name!");
		form_obj.lastname.focus();
		return false;
	}
	if(form_obj.country && !teststring.test(form_obj.country.value))
	{
		alert("Please insert Country!");
		form_obj.country.focus();
		return false;
	}
	if(form_obj.email && !teststring.test(form_obj.email.value))
	{
		alert("Please provide Email!");
		form_obj.email.focus();
		return false;
	}
	if(form_obj.email && teststring.test(form_obj.email.value) && !isEmail(form_obj.email.value))
	{
		alert("Enter Valid Email id");
		form_obj.email.focus();
		return false;
	}

	document.getElementById('table1').style.display = "none";
	document.getElementById('table2').style.display = "";
	parent.window.changeheight();
	return true;
}
