function id1(f)
{
//   ------ Name Validations ------ 

	if (document.f.name.value == "")
	{
		alert("You must enter your Name")
		document.f.name.focus();
		return (false);
	}

	if (document.f.name.value.length < 3)
	{
		alert("Please enter at least 3 characters in the \"Name\" field.")
		document.f.name.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	var checkStr =  document.f.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("Please enter only Alphabetic characters in the \"Name\" field.");
		document.f.name.focus();
		return (false);
	}
	
// ------- Designation validation --------

if (document.f.desg.selectedIndex < 0)
{
alert("Please select your \"Designation\".");
document.f.desg.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.desg.selectedIndex == 0)
{
alert("Please select your \"Designation\".");
document.f.desg.focus();
return (false);
}

if (document.f.desg.options[document.f.desg.selectedIndex].value =="Other" && document.f.desg_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.desg_oth.focus();
return (false);
}



//   ------ Company Validations ------ 
	

	if (document.f.company.value == "")
	{
		alert("You must enter your Company")
		document.f.company.focus();
		return (false);
	}

	if (document.f.company.value.length < 3)
	{
		alert("Please enter at least 3 characters in the \"Company\" field.")
		document.f.company.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890./\-()@&- ";
	var checkStr =  document.f.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("Please enter only Alphanumeric characters in the \" Company\" field.");
		document.f.company.focus();
		return (false);
	}


// ------- Nature of Business validation --------

if (document.f.nob.selectedIndex < 0)
{
alert("Please select your \"Nature of Business\".");
document.f.nob.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.nob.selectedIndex == 0)
{
alert("Please select your \"Nature of Business\".");
document.f.nob.focus();
return (false);
}

if (document.f.nob.options[document.f.nob.selectedIndex].value =="Other" && document.f.nob_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.nob_oth.focus();
return (false);
}

//   ------ address Validations ------ 
	

	if (document.f.address.value == "")
	{
		alert("You must enter your Address")
		document.f.address.focus();
		return (false);
	}

	if (document.f.address.value.length < 10)
	{
		alert("Please enter at least 10 characters in the \"Address\" field.")
		document.f.address.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/\.-()@&- ";
	var checkStr =  document.f.address.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 Alphanumeric characters in the \"Address\" field.");
		document.f.address.focus();
		return (false);
	}


//   ------ City Validations ------ 
	

	if (document.f.city.value == "")
	{
		alert("You must enter your City")
		document.f.city.focus();
		return (false);
	}

	if (document.f.city.value.length < 2)
	{
		alert("Please enter at least 2 characters in the \"city\" field.")
		document.f.city.focus();
		return (false);
	}

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890.-() ";
	var checkStr =  document.f.city.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 Alphanumeric characters in the \"city\" field.");
		document.f.city.focus();
		return (false);
	}




// ------- zip Code validation --------

if (document.f.zip.value=="")
{
alert("Please enter \"zip Code\".");
document.f.zip.focus();
return (false);
}

var checkOK = "0123456789- ";
var checkStr = document.f.zip.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
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 (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"zip Code\" field.");
document.f.zip.focus();
return (false);
}

if (document.f.zip.value.length < 4)
{
alert("Please enter valid \"zip Code\".");
document.f.zip.focus();
return (false);
}


// ------- Phone validation --------

if (document.f.phn_no.value=="")
{
alert("Please enter \"Phone Number\".");
document.f.phn_no.focus();
return (false);
}

var checkOK = "0123456789";
var checkStr = document.f.phn_no.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
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 (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Phone Number\" field.");
document.f.phn_no.focus();
return (false);
}

if (document.f.phn_no.value.length < 4 || document.f.phn_no.value.length > 10)
{
alert("Please enter valid \"Phone Number\".");
document.f.phn_no.focus();
return (false);
}



// ------- fax validation3 --------

var checkOK = "0123456789";
var checkStr = document.f.fax_no.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
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 (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Fax Number\" field.");
document.f.fax_no.focus();
return (false);
}


// ------- Mobile validation1 --------


var checkOK = "0123456789";
var checkStr = document.f.mobile.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
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 (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Mobile\" field.");
document.f.mobile.focus();
return (false);
}

// ----------------- Email  Validation ---------------------

if (document.f.email.value == "")
{
alert("Please enter a value for the \"Email\" field.");
document.f.email.focus();
return (false);
}
if (document.f.email.value.charAt(0)=="@")
{
alert("Invalid \"Email\" Address");
document.f.email.focus();
return (false);
}

if (document.f.email.value.charAt(0)=="\.")
{
alert("Invalid \"Email\" Address");
document.f.email.focus();
return (false);
}



// test if valid email address, must have @ and .
var checkEmail = "@.";
var checkStr = document.f.email.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("The \"Email\" field must contain an \"@\" and a \".\".");
document.f.email.focus();
return (false);
}

var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890@._-& ";
	var checkStr =  document.f.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("Please enter a Valid \"Email Address\".");
		document.f.email.focus();
		return (false);
	}



//   ------ WS Validations ------ 

	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz:/\;_-. ";
	var checkStr =  document.f.ws.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 Alphabetic characters in the \"Website\" field.");
		document.f.ws.focus();
		return (false);
	}


// ------- Product validation --------

if (document.f.product.selectedIndex < 0)
{
alert("Please select your \"Product\".");
document.f.product.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.product.selectedIndex == 0)
{
alert("Please select your \"Product\".");
document.f.product.focus();
return (false);
}


// ------- mat validation --------

if (document.f.mat.selectedIndex < 0)
{
alert("Please select your \"Material Specification\".");
document.f.mat.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.mat.selectedIndex == 0)
{
alert("Please select your \"Material Specification\".");
document.f.mat.focus();
return (false);
}

if (document.f.mat.options[document.f.mat.selectedIndex].value =="Other" && document.f.mat_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.mat_oth.focus();
return (false);
}

// ------- DIM validation --------

if (document.f.dim.selectedIndex < 0)
{
alert("Please select your \"Dimensional Specification\".");
document.f.dim.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.dim.selectedIndex == 0)
{
alert("Please select your \"Dimensional Specification\".");
document.f.dim.focus();
return (false);
}

if (document.f.dim.options[document.f.dim.selectedIndex].value =="Other" && document.f.dim_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.dim_oth.focus();
return (false);
}

// ------- SPEC validation --------

if (document.f.spec.selectedIndex < 0)
{
alert("Please select your \"Specification No\".");
document.f.spec.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.spec.selectedIndex == 0)
{
alert("Please select your \"Specification No.t\".");
document.f.spec.focus();
return (false);
}

if (document.f.spec.options[document.f.spec.selectedIndex].value =="Other" && document.f.spec_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.spec_oth.focus();
return (false);
}


// ------- TYPE validation --------

if (document.f.type.selectedIndex < 0)
{
alert("Please select your \"Type\".");
document.f.type.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.type.selectedIndex == 0)
{
alert("Please select your \"Type\".");
document.f.type.focus();
return (false);
}

if (document.f.type.options[document.f.type.selectedIndex].value =="Other" && document.f.type_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.type_oth.focus();
return (false);
}



// ------- FACE validation --------

if (document.f.face.selectedIndex < 0)
{
alert("Please select your \"Facing\".");
document.f.face.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.face.selectedIndex == 0)
{
alert("Please select your \"Facing\".");
document.f.face.focus();
return (false);
}

if (document.f.face.options[document.f.face.selectedIndex].value =="Other" && document.f.face_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.face_oth.focus();
return (false);
}



// ------- UNIT validation --------

if (document.f.unit.selectedIndex < 0)
{
alert("Please select your \"Unit\".");
document.f.unit.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.unit.selectedIndex == 0)
{
alert("Please select your \"Unit\".");
document.f.unit.focus();
return (false);
}

if (document.f.unit.options[document.f.unit.selectedIndex].value =="Other" && document.f.unit_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.unit_oth.focus();
return (false);
}


// ------- SIZE validation --------

if (document.f.size.selectedIndex < 0)
{
alert("Please select your \"Size NB\".");
document.f.size.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.size.selectedIndex == 0)
{
alert("Please select your \"Size NB\".");
document.f.size.focus();
return (false);
}

if (document.f.size.options[document.f.size.selectedIndex].value =="Other" && document.f.size_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.size_oth.focus();
return (false);
}


// ------- Pressure Rating validation --------

if (document.f.pr.selectedIndex < 0)
{
alert("Please select your \"Pressure Rating\".");
document.f.pr.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.pr.selectedIndex == 0)
{
alert("Please select your \"Pressure Rating\".");
document.f.pr.focus();
return (false);
}

if (document.f.pr.options[document.f.pr.selectedIndex].value =="Other" && document.f.pr_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.pr_oth.focus();
return (false);
}


// ------- Pipe Schedule validation --------

if (document.f.ps.selectedIndex < 0)
{
alert("Please select your \"Pipe Schedule\".");
document.f.ps.focus();
return (false);
}

// check if the first drop down is selected, if so, invalid selection
if (document.f.ps.selectedIndex == 0)
{
alert("Please select your \"Pipe Schedule\".");
document.f.ps.focus();
return (false);
}

if (document.f.ps.options[document.f.ps.selectedIndex].value =="Other" && document.f.ps_oth.value=="")
{
alert("Please enter the Value in Other Field");
document.f.ps_oth.focus();
return (false);
}



// ------- Quantity Validations --------

if (document.f.qty.value=="")
{
alert("Please enter \"Quantity\".");
document.f.qty.focus();
return (false);
}

var checkOK = "0123456789";
var checkStr = document.f.qty.value;
var allValid = true;
var decPoints = 0;
var allNum = "";
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 (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"Quantity\" field.");
document.f.qty.focus();
return (false);
}

if (document.f.qty.value.length < 1)
{
alert("Please enter valid \"Quantity Number\".");
document.f.qty.focus();
return (false);
}
}