function testIsBlank(strValue)
	{
		for(i = 0; i < strValue.length; i++)
	 		{
			var c = strValue.charAt(i);
			if ((c != ' ') && (c != '\n') && (c != '\t'))
				return false;
		}
		return true;
	}	
	
	function validateForm()
	{
		try
		{
			// Replicate the following for each field to validate and change the field name and message
			///////////////////////////////////////////////////////////////////////////////////////////
			if (testIsBlank(document.frmForm1.FirstName.value) == true)
			{
				alert("You must enter your First Name");
				document.frmForm1.FirstName.focus();
				return false;
			}
			///////////////////////////////////////////////////////////////////////////////////////////
			
			// Replicate the following for each field to validate and change the field name and message
			///////////////////////////////////////////////////////////////////////////////////////////
			if (testIsBlank(document.frmForm1.LastName.value) == true)
			{
				alert("You must enter your Last Name");
				document.frmForm1.LastName.focus();
				return false;
			}
			///////////////////////////////////////////////////////////////////////////////////////////
			
			// Replicate the following for each field to validate and change the field name and message
			///////////////////////////////////////////////////////////////////////////////////////////
			if (testIsBlank(document.frmForm1.JobTitle.value) == true)
			{
				alert("You must enter your Job Title");
				document.frmForm1.JobTitle.focus();
				return false;
			}
			///////////////////////////////////////////////////////////////////////////////////////////
			
			if (testIsBlank(document.frmForm1.CompanyName.value) == true)
			{
				alert("You must enter your Company Name");
				document.frmForm1.CompanyName.focus();
				return false;
			}
			///////////////////////////////////////////////////////////////////////////////////////////
			
			// Replicate the following for each field to validate and change the field name and message
			///////////////////////////////////////////////////////////////////////////////////////////
			if (testIsBlank(document.frmForm1.DaytimeTelephone.value) == true)
			{
				alert("You must enter your Daytime Telephone Number");
				document.frmForm1.DaytimeTelephone.focus();
				return false;
			}
			
			
			///////////////////////////////////////////////////////////////////////////////////////////
			
			// Replicate the following for each field to validate and change the field name and message
			///////////////////////////////////////////////////////////////////////////////////////////
			if (testIsBlank(document.frmForm1.Email.value) == true)
			{
				alert("You must enter your Email Address");
				document.frmForm1.Email.focus();
				return false;
			}
			///////////////////////////////////////////////////////////////////////////////////////////
			if (testIsBlank(document.frmForm1.Country.value) == true)
			{
				alert("You must enter your Country");
				document.frmForm1.Country.focus();
				return false;
			}
			
			///////////////////////////////////////////////////////////////////////////////////////////
			
			booSel1 = false;
			booSel2 = false;
			for(i = 0; i < document.frmForm1.MetalOption1.length; i++)
			{
				if (document.frmForm1.MetalOption1[i].checked == true)
					booSel1 = true;
			}
			for(i = 0; i < document.frmForm1.MetalOption3.length; i++)
			{
				if (document.frmForm1.MetalOption3[i].checked == true)
					booSel2 = true;
			}
			if ((booSel1 == true) || (booSel2 == true))
			{
				if (booSel1 == false)
				{
					alert("You must select Voice Broking or Electronic Trading under Metals");
					return false;
				}
				if (booSel2 == false)
				{
					alert("You must select a Metal under Metals");
					return false;
				}
			}
			
			booSel1 = false;
			booSel2 = false;
			for(i = 0; i < document.frmForm1.EnergyOption1.length; i++)
			{
				if (document.frmForm1.EnergyOption1[i].checked == true)
					booSel1 = true;
			}
			for(i = 0; i < document.frmForm1.EnergyOption3.length; i++)
			{
				if (document.frmForm1.EnergyOption3[i].checked == true)
					booSel2 = true;
			}
			if ((booSel1 == true) || (booSel2 == true))
			{
				if (booSel1 == false)
				{
					alert("You must select Voice Broking or Electronic Trading under Energy");
					return false;
				}
				if (booSel2 == false)
				{
					alert("You must select a Fuel under Energy");
					return false;
				}
			}
			
			booSel1 = false;
			booSel2 = false;
			for(i = 0; i < document.frmForm1.AgricultureOption1.length; i++)
			{
				if (document.frmForm1.AgricultureOption1[i].checked == true)
					booSel1 = true;
			}
			for(i = 0; i < document.frmForm1.AgricultureOption3.length; i++)
			{
				if (document.frmForm1.AgricultureOption3[i].checked == true)
					booSel2 = true;
			}
			if ((booSel1 == true) || (booSel2 == true))
			{
				if (booSel1 == false)
				{
					alert("You must select Voice Broking or Electronic Trading under Agriculture");
					return false;
				}
				if (booSel2 == false)
				{
					alert("You must select a Product under Agriculture");
					return false;
				}
			}
			
			booSel1 = false;
			booSel2 = false;
			for(i = 0; i < document.frmForm1.ForeignOption1.length; i++)
			{
				if (document.frmForm1.ForeignOption1[i].checked == true)
					booSel1 = true;
			}
			for(i = 0; i < document.frmForm1.ForeignOption3.length; i++)
			{
				if (document.frmForm1.ForeignOption3[i].checked == true)
					booSel2 = true;
			}
			if ((booSel1 == true) || (booSel2 == true))
			{
				if (booSel1 == false)
				{
					alert("You must select Voice Broking or Electronic Trading under Foreign Exchange");
					return false;
				}
				if (booSel2 == false)
				{
					alert("You must select a Product under Foreign Exchange");
					return false;
				}
			}
			
			booSel1 = false;
			booSel2 = false;
			for(i = 0; i < document.frmForm1.GlobalOption1.length; i++)
			{
				if (document.frmForm1.GlobalOption1[i].checked == true)
					booSel1 = true;
			}
			for(i = 0; i < document.frmForm1.GlobalOption3.length; i++)
			{
				if (document.frmForm1.GlobalOption3[i].checked == true)
					booSel2 = true;
			}
			if ((booSel1 == true) || (booSel2 == true))
			{
				if (booSel1 == false)
				{
					alert("You must select Voice Broking or Electronic Trading under Global Futures");
					return false;
				}
				if (booSel2 == false)
				{
					alert("You must select a Product under Global Futures");
					return false;
				}
			}
			
			document.frmForm1.submit();
		}
		catch(e)
		{
			alert("Sorry, an error occurred.\nPlease check that you have JavaScript enabled.")
		}
	}
	

