/*
script By Ravi Karmacharya
webdesigners@mail.com
*/
function verify()
{
	var obj;
	
		
	//START: nanme
	obj = document.forms['frm_feedback']['name'];
	if (!(obj.value))
	{
		alert('Please fill Your Name.');
		obj.focus();
		return false;
	}
	

	if (obj.value.length > 100)
	{
		alert('The given name is too large.\n Please ensure that maximum 100 characters are given.');
		obj.focus();
		return false;
	}
	//END: name
	
	//START: address
	obj = document.forms['frm_feedback']['address'];
	if (!(obj.value))
	{
		alert('Please fill Your address.');
		obj.focus();
		return false;
	}
	

	if (obj.value.length > 200)
	{
		alert('The given address is too large.\n Please ensure that maximum 200 characters are given.');
		obj.focus();
		return false;
	}
	//Ends: address
	
	// start email
	obj = document.forms['frm_feedback']['email'];
	var mystr = obj.value;
	obj.value = mystr.replace(/^\s*|\s*$/g,"");
	var re = /^[a-zA-Z0-9_\.\-]+(\.[a-zA-Z0-9_\.\-]+)*@([a-zA-Z0-9_\.\-]+\.)+[a-zA-Z]{2,7}$/;
	if (!obj.value.match(re)) 
	{
		alert('Please check the Email Address given. It is an invalid one.');
		obj.focus();
		return false;
	} 
	
		obj = document.forms['frm_feedback']['email'];
	if (!(obj.value.search (/[@]/) >= 0))
	{
		alert('Please check the Email Address given. It is an invalid one.');
		obj.focus();
		return false;
	}
	
		obj = document.forms['frm_feedback']['email'];
	if (!(obj.value.search (/[.]/) >= 0))
	{
		alert('Please check the Email Address given. It is an invalid one.');
		obj.focus();
		return false;
	}
		
	//END: Email
	
	//START: subject
	obj = document.forms['frm_feedback']['subject'];
	if (!(obj.value))
	{
		alert('Please fill Your subject.');
		obj.focus();
		return false;
	}
	

	if (obj.value.length > 150)
	{
		alert('The given subject is too large.\n Please ensure that maximum 150 characters are given.');
		obj.focus();
		return false;
	}
	//Ends: subject
	
	//START: Captcha
	obj = document.forms['frm_feedback']['recaptcha_response_field'];
	if (!(obj.value))
	{
		alert('Please enter displayed CAPTCHA text.');
		obj.focus();
		return false;
	}
	

	if (obj.value.length > 250)
	{
		alert('The given captcha is too large.\n Please ensure that maximum 250 characters are given.');
		obj.focus();
		return false;
	}
	//Ends: Captcha
	
	//START: comment
	obj = document.forms['frm_feedback']['comment'];
	if (!(obj.value))
	{
		alert('Please fill Your comment.');
		obj.focus();
		return false;
	}
	

	if (obj.value.length > 500)
	{
		alert('The given comment is too large.\n Please ensure that maximum 500 characters are given.');
		obj.focus();
		return false;
	}
	//ENDS: comment
}
