function Validate()

{	

	var txtName   = document.getElementById("txtName")    		

	var txtCountry   = document.getElementById("txtCountry")    

	var txtEmail   = document.getElementById("txtEmail")    	

	var txtQuerry   = document.getElementById("txtQuerry")    	


	if ( trimAll(txtName.value) == "" || trimAll(txtName.value).length == 0)
	{
		alert('Please Enter Your Name.');
		txtName.focus();
		return false;
	}

	
	if ( trimAll(txtCountry.value) == "" || trimAll(txtCountry.value).length == 0)
	{
		alert('Please Enter Your Country Name.');
		txtCountry.focus();
		return false;
	}

	
	if ( trimAll(txtEmail.value) == "" || trimAll(txtEmail.value).length == 0)
	{
		alert('Please Enter Vaild Email Address.');
		txtEmail.focus();
		return false;
	}
	else
	{
		invalidChars = " /:,;" 

		for (i=0; i<invalidChars.length; i++) 

		{ 

			badChar = invalidChars.charAt(i) 

			if ( txtEmail.value.indexOf(badChar,0) != -1) 

			{ 

				alert('Please Enter Vaild Email Address.');

				txtEmail.focus();

				return (false); 

			} 								 

		}	

		

		atPos = txtEmail.value.indexOf("@",1) 

		if (atPos == -1) 

		{ 

			alert('Please Enter Vaild Email Address.');

			txtEmail.focus();

			return (false); 

		} 

				 

		if (txtEmail.value.indexOf("@",atPos+1) != -1) 

		{ 

			alert('Please Enter Vaild Email Address.');

			txtEmail.focus();

			return (false); 

		} 

				 

		periodPos = txtEmail.value.indexOf(".",atPos) 

		if (periodPos == -1) 

		{ 

			alert('Please Enter Vaild Email Address.');

			txtEmail.focus(); 

			return (false); 

		} 

				 

		if (periodPos+3 > txtEmail.value.length)	

		{ 

			alert('Please Enter Vaild Email Address.');

			txtEmail.focus();

			return (false); 

		}

	}

	

	if ( trimAll(txtQuerry.value) == "" || trimAll(txtQuerry.value).length == 0)
	{

		alert('Please Enter Your Query.');

		txtQuerry.focus();

		return false;

	}

	

	return true;

}


function trimAll(sString)
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
} 

document.writeln("<table border='0' cellpadding='0' cellspacing='0'>");

	document.writeln("<tr>");

		document.writeln("<td align='left' valign='top' class='testimonial'>");

			document.writeln("<form action='for_more_information_mail.php?FromName=" + _FromPageName + "' method='post' name='frmMoreInfo' onsubmit='javascript:return Validate();'>");

				document.writeln("<table width='189' border='0' align='center' cellpadding='3' cellspacing='0'>");

					document.writeln("<tr>");

						document.writeln("<td colspan='2' align='left'><h5>For More Information</h5></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");

						document.writeln("<td width='51' align='left'>Name:</td>");

						document.writeln("<td width='126'><input type='text' name='txtName' id = 'txtName' class='input-size' maxlength='50' /></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");

						document.writeln("<td align='left'>Country:</td>");

						document.writeln("<td><input type='text' name='txtCountry' id = 'txtCountry' class='input-size' maxlength='50' /></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");

						document.writeln("<td align='left'>Email : </td>");

						document.writeln("<td><input type='text' name='txtEmail' id = 'txtEmail' class='input-size' maxlength='50' /></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");

						document.writeln("<td align='left'>Mobile: </td>");

						document.writeln("<td><input type='text' name='txtMobile' id = 'txtMobile' class='input-size' maxlength='50' /></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");		

						document.writeln("<td align='left'>Skype:</td>");

						document.writeln("<td><input type='text' name='txtSkype' id = 'txtSkype' class='input-size' maxlength='50' /></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");

						document.writeln("<td align='left'>Query:</td>");

						document.writeln("<td><input type='text' name='txtQuerry' id = 'txtQuerry' class='input-size' maxlength='50' /></td>");

					document.writeln("</tr>");

					document.writeln("<tr>");

						document.writeln("<td colspan='2' align='center'><input type='submit' name='Submit22' value='Submit' /><input type='hidden' id='hdn_FromPageName' name='hdn_FromPageName' value='"+_FromPageName+"'  /></td>");

					document.writeln("</tr>");

				document.writeln("</table>");

			document.writeln("</form>");

		document.writeln("</td>");

	document.writeln("</tr>");

document.writeln("</table>");