function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid E-mail ID")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid E-mail ID")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid E-mail ID")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid E-mail ID")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("Invalid E-mail ID")
		return false
	 }
	 return true					
}


function form_valiate()
{

//alert(act);

if(document.enq_form.name.value=="")
	{
     alert("Please mention name"); 
	 document.enq_form.name.focus();
	 return false;
	}


if (document.enq_form.name.value!="")
{
	
	//check for name
	nwstl=document.enq_form.name.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.name.focus();
	return false;
	}
}


if(document.enq_form.name.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.name.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.name.select();
    return false;
  }
}

if(document.enq_form.name.value!="")
	{

		if(document.enq_form.name.value.length > 100)
		{
					alert("Name cannot be greater than 100 Characters");
					document.enq_form.name.focus();
					return false;
		}
	}	
	

if(document.enq_form.designation.value=="")
	{
     alert("Please mention designation"); 
	 document.enq_form.designation.focus();
	 return false;
	}


if (document.enq_form.designation.value!="")
{
	
	//check for name
	nwstl=document.enq_form.designation.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.designation.focus();
	return false;
	}
}


if(document.enq_form.designation.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.designation.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.designation.select();
    return false;
  }
}

if(document.enq_form.designation.value!="")
	{

		if(document.enq_form.designation.value.length > 100)
		{
					alert("Designation cannot be greater than 100 Characters");
					document.enq_form.designation.focus();
					return false;
		}
	}	
	

	

if(document.enq_form.company.value=="")
	{
     alert("Please mention company"); 
	 document.enq_form.company.focus();
	 return false;
	}


if (document.enq_form.company.value!="")
{
	
	//check for name
	nwstl=document.enq_form.company.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.company.focus();
	return false;
	}
}


if(document.enq_form.company.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.company.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.company.select();
    return false;
  }
}

if(document.enq_form.company.value!="")
	{

		if(document.enq_form.company.value.length > 100)
		{
					alert("Company cannot be greater than 100 Characters");
					document.enq_form.company.focus();
					return false;
		}
	}	
	


if(document.enq_form.email.value=="")
	{
     alert("Please mention email"); 
	 document.enq_form.email.focus();
	 return false;
	}


if (document.enq_form.email.value!="")
{
	
	//check for name
	nwstl=document.enq_form.email.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.email.focus();
	return false;
	}
}


if(document.enq_form.email.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.email.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.email.select();
    return false;
  }
}

if(document.enq_form.email.value!="")
	{

		if(document.enq_form.email.value.length > 100)
		{
					alert("Email cannot be greater than 100 Characters");
					document.enq_form.email.focus();
					return false;
		}
	
		var str=document.enq_form.email.value;
		var valid=echeck(str);

		if (valid==0)
		{
			//alert('Invalid email id');
			document.enq_form.email.focus();
			return false;
		}

	
	}	



if(document.enq_form.phone.value=="")
	{
     alert("Please mention phone"); 
	 document.enq_form.phone.focus();
	 return false;
	}


if (document.enq_form.phone.value!="")
{
	
	//check for name
	nwstl=document.enq_form.phone.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.phone.focus();
	return false;
	}
}


if(document.enq_form.phone.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.phone.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.phone.select();
    return false;
  }
}

if(document.enq_form.phone.value!="")
	{

if(document.enq_form.phone.value.length > 100)
{
			alert("Phone cannot be greater than 100 Characters");
			document.enq_form.phone.focus();
			return false;
}
	}	




if(document.enq_form.fax.value=="")
	{
     alert("Please mention fax"); 
	 document.enq_form.fax.focus();
	 return false;
	}


if (document.enq_form.fax.value!="")
{
	
	//check for name
	nwstl=document.enq_form.fax.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.fax.focus();
	return false;
	}
}


if(document.enq_form.fax.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.fax.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.fax.select();
    return false;
  }
}

if(document.enq_form.fax.value!="")
	{

if(document.enq_form.fax.value.length > 100)
{
			alert("Fax cannot be greater than 100 Characters");
			document.enq_form.fax.focus();
			return false;
}
	}	





if(document.enq_form.address1.value=="")
	{
     alert("Please mention address"); 
	 document.enq_form.address1.focus();
	 return false;
	}


if (document.enq_form.address1.value!="")
{
	
	//check for name
	nwstl=document.enq_form.address1.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.address1.focus();
	return false;
	}
}


if(document.enq_form.address1.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_form.address1.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('Data are invalid.Only a-z 0-9 @ _ . , /   are allowed');
    document.enq_form.address1.select();
    return false;
  }
}

if(document.enq_form.address1.value!="")
	{

if(document.enq_form.address1.value.length > 1000)
{
			alert("Address cannot be greater than 1000 Characters");
			document.enq_form.address1.focus();
			return false;
}
	}	


if(document.enq_form.country.value=="#")
	{
     alert("Please mention country"); 
	 document.enq_form.country.focus();
	 return false;
	}


if(document.enq_form.servingplace.value=="#")
	{
     alert("Please mention serving Place"); 
	 document.enq_form.servingplace.focus();
	 return false;
	}


if(document.enq_form.industry_sector.value=="#")
	{
     alert("Please mention industry sector"); 
	 document.enq_form.industry_sector.focus();
	 return false;
	}


if(document.enq_form.grade.value=="")
	{
     alert("Please mention usage sub category "); 
	 document.enq_form.grade.focus();
	 return false;
	}


if (document.enq_form.grade.value!="")
{
	
	//check for name
	nwstl=document.enq_form.grade.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.grade.focus();
	return false;
	}
}


if(document.enq_form.specification.value=="")
	{
     alert("Please mention specification"); 
	 document.enq_form.specification.focus();
	 return false;
	}


if (document.enq_form.specification.value!="")
{
	
	//check for name
	nwstl=document.enq_form.specification.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.specification.focus();
	return false;
	}
}


if(document.enq_form.strand_diameter.value=="")
	{
     alert("Please mention Strand Diameter/Nominal Size"); 
	 document.enq_form.strand_diameter.focus();
	 return false;
	}


if (document.enq_form.strand_diameter.value!="")
{
	
	//check for name
	nwstl=document.enq_form.strand_diameter.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.strand_diameter.focus();
	return false;
	}
}


if(document.enq_form.construction.value=="")
	{
     alert("Please mention construction"); 
	 document.enq_form.construction.focus();
	 return false;
	}


if (document.enq_form.construction.value!="")
{
	
	//check for name
	nwstl=document.enq_form.construction.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.construction.focus();
	return false;
	}
}


if(document.enq_form.lay_ratio.value=="")
	{
     alert("Please mention Lay Ratio"); 
	 document.enq_form.lay_ratio.focus();
	 return false;
	}


if (document.enq_form.lay_ratio.value!="")
{
	
	//check for name
	nwstl=document.enq_form.lay_ratio.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.lay_ratio.focus();
	return false;
	}
}



if(document.enq_form.coating.value=="")
	{
     alert("Please mention Coating"); 
	 document.enq_form.coating.focus();
	 return false;
	}


if (document.enq_form.coating.value!="")
{
	
	//check for name
	nwstl=document.enq_form.coating.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.coating.focus();
	return false;
	}
}



if(document.enq_form.breaking_load.value=="")
	{
     alert("Please mention Minimum Breaking Load"); 
	 document.enq_form.breaking_load.focus();
	 return false;
	}


if (document.enq_form.breaking_load.value!="")
{
	
	//check for name
	nwstl=document.enq_form.breaking_load.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.breaking_load.focus();
	return false;
	}
}



if(document.enq_form.security_code.value=="")
	{
     alert("Please mention security code"); 
	 document.enq_form.security_code.focus();
	 return false;
	}


if (document.enq_form.security_code.value!="")
{
	
	//check for name
	nwstl=document.enq_form.security_code.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_form.security_code.focus();
	return false;
	}
}


}

