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_bright.name.value=="")
	{
     alert("Please mention name"); 
	 document.enq_bright.name.focus();
	 return false;
	}


if (document.enq_bright.name.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.name.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.name.focus();
	return false;
	}
}


if(document.enq_bright.name.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.name.select();
    return false;
  }
}

if(document.enq_bright.name.value!="")
	{

		if(document.enq_bright.name.value.length > 100)
		{
					alert("Name cannot be greater than 100 Characters");
					document.enq_bright.name.focus();
					return false;
		}
	}	
	

if(document.enq_bright.designation.value=="")
	{
     alert("Please mention designation"); 
	 document.enq_bright.designation.focus();
	 return false;
	}


if (document.enq_bright.designation.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.designation.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.designation.focus();
	return false;
	}
}


if(document.enq_bright.designation.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.designation.select();
    return false;
  }
}

if(document.enq_bright.designation.value!="")
	{

		if(document.enq_bright.designation.value.length > 100)
		{
					alert("Designation cannot be greater than 100 Characters");
					document.enq_bright.designation.focus();
					return false;
		}
	}	
	

	

if(document.enq_bright.company.value=="")
	{
     alert("Please mention company"); 
	 document.enq_bright.company.focus();
	 return false;
	}


if (document.enq_bright.company.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.company.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.company.focus();
	return false;
	}
}


if(document.enq_bright.company.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.company.select();
    return false;
  }
}

if(document.enq_bright.company.value!="")
	{

		if(document.enq_bright.company.value.length > 100)
		{
					alert("Company cannot be greater than 100 Characters");
					document.enq_bright.company.focus();
					return false;
		}
	}	
	


if(document.enq_bright.email.value=="")
	{
     alert("Please mention email"); 
	 document.enq_bright.email.focus();
	 return false;
	}


if (document.enq_bright.email.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.email.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.email.focus();
	return false;
	}
}


if(document.enq_bright.email.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.email.select();
    return false;
  }
}

if(document.enq_bright.email.value!="")
	{

		if(document.enq_bright.email.value.length > 100)
		{
					alert("Email cannot be greater than 100 Characters");
					document.enq_bright.email.focus();
					return false;
		}
	
		var str=document.enq_bright.email.value;
		var valid=echeck(str);

		if (valid==0)
		{
			//alert('Invalid email id');
			document.enq_bright.email.focus();
			return false;
		}

	
	}	



if(document.enq_bright.phone.value=="")
	{
     alert("Please mention phone"); 
	 document.enq_bright.phone.focus();
	 return false;
	}


if (document.enq_bright.phone.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.phone.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.phone.focus();
	return false;
	}
}


if(document.enq_bright.phone.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.phone.select();
    return false;
  }
}

if(document.enq_bright.phone.value!="")
	{

if(document.enq_bright.phone.value.length > 100)
{
			alert("Phone cannot be greater than 100 Characters");
			document.enq_bright.phone.focus();
			return false;
}
	}	




if(document.enq_bright.fax.value=="")
	{
     alert("Please mention fax"); 
	 document.enq_bright.fax.focus();
	 return false;
	}


if (document.enq_bright.fax.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.fax.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.fax.focus();
	return false;
	}
}


if(document.enq_bright.fax.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.fax.select();
    return false;
  }
}

if(document.enq_bright.fax.value!="")
	{

if(document.enq_bright.fax.value.length > 100)
{
			alert("Fax cannot be greater than 100 Characters");
			document.enq_bright.fax.focus();
			return false;
}
	}	





if(document.enq_bright.address1.value=="")
	{
     alert("Please mention address"); 
	 document.enq_bright.address1.focus();
	 return false;
	}


if (document.enq_bright.address1.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.address1.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.address1.focus();
	return false;
	}
}


if(document.enq_bright.address1.value !="")
	{
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.@_/,- \n\r";
  var checkStr = document.enq_bright.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_bright.address1.select();
    return false;
  }
}

if(document.enq_bright.address1.value!="")
	{

if(document.enq_bright.address1.value.length > 1000)
{
			alert("Address cannot be greater than 1000 Characters");
			document.enq_bright.address1.focus();
			return false;
}
	}	


if(document.enq_bright.country.value=="#")
	{
     alert("Please mention country"); 
	 document.enq_bright.country.focus();
	 return false;
	}


if(document.enq_bright.servingplace.value=="#")
	{
     alert("Please mention serving place"); 
	 document.enq_bright.servingplace.focus();
	 return false;
	}




if(document.enq_bright.application.value=="")
	{
     alert("Please mention Application"); 
	 document.enq_bright.application.focus();
	 return false;
	}


if (document.enq_bright.application.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.application.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.application.focus();
	return false;
	}
}




if(document.enq_bright.grade.value=="")
	{
     alert("Please mention Grade"); 
	 document.enq_bright.grade.focus();
	 return false;
	}


if (document.enq_bright.grade.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.grade.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.grade.focus();
	return false;
	}
}




if(document.enq_bright.quantity.value=="")
	{
     alert("Please mention Quantity"); 
	 document.enq_bright.quantity.focus();
	 return false;
	}


if (document.enq_bright.quantity.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.quantity.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.quantity.focus();
	return false;
	}
}



if(document.enq_bright.size.value=="")
	{
     alert("Please mention Size"); 
	 document.enq_bright.size.focus();
	 return false;
	}


if (document.enq_bright.size.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.size.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.size.focus();
	return false;
	}
}



if(document.enq_bright.tolerance.value=="")
	{
     alert("Please mention Size Tolerance"); 
	 document.enq_bright.tolerance.focus();
	 return false;
	}


if (document.enq_bright.tolerance.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.tolerance.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.tolerance.focus();
	return false;
	}
}


if(document.enq_bright.length1.value=="")
	{
     alert("Please mention Length"); 
	 document.enq_bright.length1.focus();
	 return false;
	}


if (document.enq_bright.length1.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.length1.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.length1.focus();
	return false;
	}
}


if(document.enq_bright.length2.value=="")
	{
     alert("Please mention Length Tolerance"); 
	 document.enq_bright.length2.focus();
	 return false;
	}


if (document.enq_bright.length2.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.length2.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.length2.focus();
	return false;
	}
}


if(document.enq_bright.straightness.value=="")
	{
     alert("Please mention Straightness"); 
	 document.enq_bright.straightness.focus();
	 return false;
	}


if (document.enq_bright.straightness.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.straightness.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.straightness.focus();
	return false;
	}
}



if(document.enq_bright.bundle.value=="")
	{
     alert("Please mention Bundle Weight"); 
	 document.enq_bright.bundle.focus();
	 return false;
	}


if (document.enq_bright.bundle.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.bundle.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.bundle.focus();
	return false;
	}
}



if(document.enq_bright.gas.value=="")
	{
     alert("Please mention Gas Content"); 
	 document.enq_bright.gas.focus();
	 return false;
	}


if (document.enq_bright.gas.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.gas.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.gas.focus();
	return false;
	}
}


if(document.enq_bright.surface.value=="")
	{
     alert("Please mention Surface Condition"); 
	 document.enq_bright.surface.focus();
	 return false;
	}


if (document.enq_bright.surface.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.surface.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.surface.focus();
	return false;
	}
}


if(document.enq_bright.depth.value=="")
	{
     alert("Please mention Depth of Decarburisation"); 
	 document.enq_bright.depth.focus();
	 return false;
	}


if (document.enq_bright.depth.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.depth.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.depth.focus();
	return false;
	}
}


if(document.enq_bright.grain.value=="")
	{
     alert("Please mention Grain Size"); 
	 document.enq_bright.grain.focus();
	 return false;
	}


if (document.enq_bright.grain.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.grain.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.grain.focus();
	return false;
	}
}

if(document.enq_bright.inclusion.value=="")
	{
     alert("Please mention Inclusion Rating"); 
	 document.enq_bright.inclusion.focus();
	 return false;
	}


if (document.enq_bright.inclusion.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.inclusion.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.inclusion.focus();
	return false;
	}
}

if(document.enq_bright.microstructure.value=="")
	{
     alert("Please mention Microstructure"); 
	 document.enq_bright.microstructure.focus();
	 return false;
	}


if (document.enq_bright.microstructure.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.microstructure.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.microstructure.focus();
	return false;
	}
}


if(document.enq_bright.hardenability.value=="")
	{
     alert("Please mention Hardenability"); 
	 document.enq_bright.hardenability.focus();
	 return false;
	}


if (document.enq_bright.hardenability.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.hardenability.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.hardenability.focus();
	return false;
	}
}

if(document.enq_bright.uts.value=="")
	{
     alert("Please mention UTS"); 
	 document.enq_bright.uts.focus();
	 return false;
	}


if (document.enq_bright.uts.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.uts.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.uts.focus();
	return false;
	}
}


if(document.enq_bright.hardness.value=="")
	{
     alert("Please mention Hardness"); 
	 document.enq_bright.hardness.focus();
	 return false;
	}


if (document.enq_bright.hardness.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.hardness.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.hardness.focus();
	return false;
	}
}


if(document.enq_bright.security_code.value=="")
	{
     alert("Please mention security code"); 
	 document.enq_bright.security_code.focus();
	 return false;
	}


if (document.enq_bright.security_code.value!="")
{
	
	//check for name
	nwstl=document.enq_bright.security_code.value;

	if (nwstl==0 || nwstl==null)
	{
	alert("Please enter proper value");
	document.enq_bright.security_code.focus();
	return false;
	}
}


}
