//*********************************************************************************
// Function for Checking/ Validation of Advertisement Form for the Member Companeis
// Developer: WebinfotechIndia
// 
//*********************************************************************************
function HomeEnq_Validate(theform)
{   
//Enquirer Name
if(theform.txtName.value=="")
		{	
		alert("Please Enter Your Name.");
		theform.txtName.focus();
		return (false);
		}

//EMAIL ID VALIDATION
	if(theform.txtEmail.value == "") 
	   {
	   alert("Please Provide Email ID for Better Communication.");
	   theform.txtEmail.focus();
	   return false;
	   }
   
	if (theform.txtEmail.value != "")
	{
	// Test if Valid Email Address, Must have @ and .
	var checkEmail = "@.";
	var checkStr = theform.txtEmail.value;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;
		for (i = 0;  i < checkStr.length;  i++)
		{
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkEmail.length;  j++)
			{
			if (ch == checkEmail.charAt(j) && ch == "@")
			EmailAt = true;
			if (ch == checkEmail.charAt(j) && ch == ".")
			EmailPeriod = true;
			  if (EmailAt && EmailPeriod)
			  break;
			  if (j == checkEmail.length)
			  break;
			}
		// if both the @ and . were in the string
			if (EmailAt && EmailPeriod)
			{
			EmailValid = true
			break;
			}
		}
	}

		if (!EmailValid)
		{
		alert("Please Enter Valid Email ID.");
		theform.txtEmail.focus();
		return (false);
		} // EMAIL VALIDATION FINISED		

//Customer Mobile
		if (theform.txtMobile.value=="")
		{
		alert("Please Provide Mobile No. for Better & Quick Communication.");
		theform.txtMobile.focus();
		return false;
		}
//Mobile No Field Only Numbers Validation
	var checkOK = "0123456789";
	var checkStr = theform.txtMobile.value;
	var allValid = true;
	for (i = 0;  i < checkStr.length;  i++)
	{
	ch = checkStr.charAt(i);
	for (j = 0;  j < checkOK.length;  j++)
	if (ch == checkOK.charAt(j))
	break;
		if (j == checkOK.length)
		{
		allValid = false;
		break;
		}
	}
	if (!allValid)
	{
	alert("PLease Enter Only Numbers In MOBILE NO. Field.");
	theform.txtMobile.focus();
	return (false);
	}//Mobile No. Validation No-2 Final		

	
//Moving From
	if (theform.txtSendFrom.value=="")
    {
    alert("Please Enter FROM Which Location You Wanna Move.");
	theform.txtSendFrom.focus();
    return false;
    }

//Moving To
	if (theform.txtSendTo.value=="")
    {
    alert("Please Enter TO Which Location You Wanna Move.");
	theform.txtSendTo.focus();
    return false;
    }
	
//Customer Requirements Details
if(theform.txtDetails.value=="")
		{	
		alert("Please Enter Brief Details about Requirements.");
		theform.txtDetails.focus();
		return (false);
}	
	
}// Function Ended