
function autoSelectInquiry()
{
	showDiv('0');
	var iType
	iType=document.location.search;
	iType=iType.substring(7,iType.length)
	if ((iType>0)&&(iType<(document.forms['EmailForm'].infotype.length)))
	{
		document.forms['EmailForm'].infotype.options[iType].selected=true;
		for (var i=0; i < document.forms['EmailForm'].infotype.length;i++)
		{
			if((document.forms['EmailForm'].infotype.options[i].value)==iType)
			{
				document.forms['EmailForm'].infotype.options[iType].selected=true;
				showDiv(iType);
			}
		}
	}
	document.EmailForm.infotype.selectedIndex=0;
}

function resetStyle(lblNum)
{
	lblName = "lbl_" + (lblNum);
	document.getElementById(lblName).style.color="black";
	document.getElementById(lblName).style.fontWeight="normal";
}

function resetMessagePage()
{
	if(typeof(parent.window.document.smplSearchForm)!='undefined')
	{
		parent.window.document.smplSearchForm.queryText.focus();
		parent.window.document.smplSearchForm.queryText.value='Search ';
		parent.window.document.smplSearchForm.queryText.blur();
	}
}

function displayAttachmentInput()
{
	document.getElementById("dependent-upload-link").style.display = 'none';
	document.getElementById("dependent-upload").style.display = 'block';
}

function showInquiry()
{
	var selbox = document.EmailForm.infotype;
	selbox.length=1;

	// Thomson Financial Customer
	if (document.EmailForm.TFCustomerRadio[0].checked)
	{
		selbox.options[selbox.options.length] = new Option('Account Information','1');
		selbox.options[selbox.options.length] = new Option('Billing','2');
		selbox.options[selbox.options.length] = new Option('Feedback','3');
		selbox.options[selbox.options.length] = new Option('Permissions / Entitlements','4');
		selbox.options[selbox.options.length] = new Option('Product Assistance','5');
		selbox.options[selbox.options.length] = new Option('Publications','9');
		selbox.options[selbox.options.length] = new Option('Sales','6');
		selbox.options[selbox.options.length] = new Option('Technical Support','7');
	}
	// Not Thomson Financial Customer
	else
	{
		selbox.length=1;
		selbox.options[selbox.options.length] = new Option('Sales','6');
	}
	showDiv('0');
	document.getElementById("dependent-inquiry").style.display = 'block';
}

function showDiv(optionValue)
{
	//Reset Styles
	resetStyle(4);		// First Name
	resetStyle(5);		// Last Name
	resetStyle(6);		// Email Address
	resetStyle(7);		// Phone
	resetStyle(31);		// Thomson Customer

	resetStyle(0); 		// Subtopic
	resetStyle(1);		// Subtopic Other
	resetStyle(2);		// Product
	resetStyle(3);		// Product Other
	resetStyle(10);		// Product Log-in/User Name
	resetStyle(29);		// Thomson Customer
	resetStyle(17);		// Attachment
	resetStyle(18);		// Request/Comments

	resetStyle("9_02");	// SubID
	resetStyle(12);		// Company Name
	resetStyle(21);		// Mailing Address
	resetStyle(14);		// City
	resetStyle(15);		// Region

	// first hide all dependent divs
	document.getElementById("dependent-inquiry").style.display = 'none';

	document.getElementById("Inquiry-Details-Fieldset").style.display = 'none';
	document.getElementById("dependent-problem").style.display = 'none';
	document.getElementById('lbl_1').style.visibility="hidden";
	document.getElementById('lbl_1_0').style.visibility="hidden";
	document.getElementById("dependent-product").style.display = 'none';
	document.getElementById("dependent-product-other").style.display = 'none';
	document.getElementById("dependent-product-multiple").style.display = 'none';
	document.getElementById("dependent-login").style.display = 'none';
	document.getElementById("dependent-feature").style.display = 'none';
	document.getElementById("dependent-customer-question").style.display = 'none';
	document.getElementById("dependent-upload-link").style.display = 'none';
	document.getElementById("dependent-upload").style.display = 'none';

	document.getElementById("Technical-Support-Fieldset").style.display = 'none';
	document.getElementById("dependent-support").style.display = 'none';

	document.getElementById("Company-Information-Fieldset").style.display = 'none';
	document.getElementById("dependent-uniqueid").style.display = 'none';
	document.getElementById("dependent-subid").style.display = 'none';
	document.getElementById("dependent-company").style.display = 'none';
	document.getElementById("dependent-address").style.display = 'none';
	document.getElementById("dependent-city").style.display = 'none';
	document.getElementById("dependent-state").style.display = 'none';
	document.getElementById("dependent-region").style.display = 'none';
	document.getElementById("dependent-zipcode").style.display = 'none';

	document.getElementById("Contact-Method-Fieldset").style.display = 'none';
	document.getElementById("dependent-response-optional").style.display = 'none';
	document.getElementById("Submit-Buttons").style.display = 'none';

	document.getElementById('lbl_24').style.visibility="visible";
	document.getElementById('lbl_25').style.visibility="visible";
	document.getElementById('lbl_27').style.visibility="visible";
	document.getElementById('lbl_28').style.visibility="hidden";

	var selbox = document.EmailForm.SubTopicDropDown;

	switch (optionValue)
	{
		case "1":
			//Account Information
			window.document.EmailForm.FormType.value="3";
			displayProductOther("3")

			document.getElementById("dependent-inquiry").style.display = 'block';

			selbox.length=1;
			selbox.options[selbox.options.length] = new Option('Change Address','Change Address');
			selbox.options[selbox.options.length] = new Option('Change Contact Name','Change Contact Name');
			selbox.options[selbox.options.length] = new Option('List of Active Users','List of Active Users');
			selbox.options[selbox.options.length] = new Option('Contract Inquiry','Contract Inquiry');
			selbox.options[selbox.options.length] = new Option('Other','Other');

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-problem").style.display = 'block';
			document.getElementById("dependent-product-multiple").style.display = 'block';
			document.getElementById("dependent-login").style.display = 'block';
			document.getElementById("dependent-upload-link").style.display = 'block';

			document.getElementById("Company-Information-Fieldset").style.display = 'block';
			document.getElementById("dependent-company").style.display = 'block';
			document.getElementById("dependent-address").style.display = 'block';
			document.getElementById("dependent-city").style.display = 'block';
			document.getElementById("dependent-state").style.display = 'block';
			document.getElementById("dependent-region").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

		case "2":
			//Billing
			window.document.EmailForm.FormType.value="1";

			document.getElementById("dependent-inquiry").style.display = 'block';

			selbox.length=1;
			selbox.options[selbox.options.length] = new Option('Invoice Copy Request','Invoice Copy Request');
			selbox.options[selbox.options.length] = new Option('Invoice Question','Invoice Question');
			selbox.options[selbox.options.length] = new Option('Payment Question','Payment Question');
			selbox.options[selbox.options.length] = new Option('Change Address/Contact Name','Change Address/Contact Name');
			selbox.options[selbox.options.length] = new Option('Other','Other');

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-problem").style.display = 'block';
			document.getElementById("dependent-upload-link").style.display = 'block';

			document.getElementById("Company-Information-Fieldset").style.display = 'block';
			document.getElementById("dependent-uniqueid").style.display = 'block';
			document.getElementById("dependent-company").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

		case "3":
			//Feedback
			window.document.EmailForm.FormType.value="6";
			document.forms['EmailForm'].ProductDropDown.options[0].selected=true;

			document.getElementById("dependent-inquiry").style.display = 'block';

			selbox.length=1;
			selbox.options[selbox.options.length] = new Option('Compliment','Compliment');
			selbox.options[selbox.options.length] = new Option('Complaint','Complaint');
			selbox.options[selbox.options.length] = new Option('Suggestion','Suggestion');
			selbox.options[selbox.options.length] = new Option('Other','Other');

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-problem").style.display = 'block';
			document.getElementById("dependent-product").style.display = 'block';
			document.getElementById('lbl_27').style.visibility="hidden";
			document.getElementById('lbl_28').style.visibility="visible";
			document.getElementById("dependent-upload-link").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';
			document.getElementById("dependent-response-optional").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

		case "4":
			//Permissions
			window.document.EmailForm.FormType.value="5";
			displayProductOther("5")

			document.getElementById("dependent-inquiry").style.display = 'block';

			selbox.length=1;
			selbox.options[selbox.options.length] = new Option('Entitlements Definition','Entitlements Definition');
			selbox.options[selbox.options.length] = new Option('Add/Delete/Modify users','Add/Delete/Modify users');
			selbox.options[selbox.options.length] = new Option('Password Reset','Password Reset');
			selbox.options[selbox.options.length] = new Option('Other','Other');

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-problem").style.display = 'block';
			document.getElementById("dependent-product-multiple").style.display = 'block';
			document.getElementById("dependent-upload-link").style.display = 'block';

			document.getElementById("Company-Information-Fieldset").style.display = 'block';
			document.getElementById("dependent-company").style.display = 'block';
			document.getElementById("dependent-city").style.display = 'block';
			document.getElementById("dependent-state").style.display = 'block';
			document.getElementById("dependent-region").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

		case "5":
			//Product Assistance
			window.document.EmailForm.FormType.value="2";
			document.forms['EmailForm'].ProductDropDown.options[0].selected=true;

			document.getElementById("dependent-inquiry").style.display = 'block';

			selbox.length=1;
			selbox.options[selbox.options.length] = new Option('Navigation','Navigation');
			selbox.options[selbox.options.length] = new Option('Customize Solutions','Customize Solutions');
			selbox.options[selbox.options.length] = new Option('Content Inquiry','Content Inquiry');
			selbox.options[selbox.options.length] = new Option('Content Verification','Content Verification');
			selbox.options[selbox.options.length] = new Option('Other','Other');

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-problem").style.display = 'block';
			document.getElementById("dependent-product").style.display = 'block';
			document.getElementById("dependent-feature").style.display = 'block';
			document.getElementById("dependent-upload-link").style.display = 'block';

			document.getElementById("Company-Information-Fieldset").style.display = 'block';
			document.getElementById("dependent-company").style.display = 'block';
			document.getElementById("dependent-city").style.display = 'block';
			document.getElementById("dependent-state").style.display = 'block';
			document.getElementById("dependent-region").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

		case "6":
			//Sales
			window.document.EmailForm.FormType.value="8";

			document.getElementById("dependent-inquiry").style.display = 'block';

			selbox.length=1;
			selbox.options[selbox.options.length] = new Option('Asset Management','Asset Management');
			selbox.options[selbox.options.length] = new Option('Corporate Management','Corporate Management');
			selbox.options[selbox.options.length] = new Option('Fixed Income','Fixed Income');
			selbox.options[selbox.options.length] = new Option('Institutional Equities','Institutional Equities');
			selbox.options[selbox.options.length] = new Option('Investment Banking','Investment Banking');
			selbox.options[selbox.options.length] = new Option('Private Equity','Private Equity');
			selbox.options[selbox.options.length] = new Option('Research Authoring','Research Authoring');
			selbox.options[selbox.options.length] = new Option('Wealth Management/Private Banking','Wealth Management/Private Banking');
			selbox.options[selbox.options.length] = new Option('Other','Other');

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-problem").style.display = 'block';
			document.getElementById("dependent-customer-question").style.display = 'block';

			document.getElementById("Company-Information-Fieldset").style.display = 'block';
			document.getElementById("dependent-company").style.display = 'block';
			document.getElementById("lbl_26").style.display = 'none';
			document.getElementById("dependent-address").style.display = 'block';
			document.getElementById("dependent-city").style.display = 'block';
			document.getElementById("dependent-state").style.display = 'block';
			document.getElementById("dependent-region").style.display = 'block';
			document.getElementById("dependent-zipcode").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

		case "7":
			// Technical Support
			window.document.EmailForm.FormType.value="4";

			document.getElementById("dependent-inquiry").style.display = 'block';

			document.getElementById("Technical-Support-Fieldset").style.display = 'block';
			document.getElementById("dependent-support").style.display = 'block';
			break;

		case "9":
			// Publications
			window.document.EmailForm.FormType.value="9";

			document.getElementById("dependent-inquiry").style.display = 'block';

			document.getElementById("Inquiry-Details-Fieldset").style.display = 'block';
			document.getElementById("dependent-upload-link").style.display = 'block';

			document.getElementById("Company-Information-Fieldset").style.display = 'block';
			document.getElementById("dependent-company").style.display = 'block';
			document.getElementById("dependent-city").style.display = 'block';
			document.getElementById("dependent-state").style.display = 'block';
			document.getElementById("dependent-region").style.display = 'block';

			document.getElementById("Contact-Method-Fieldset").style.display = 'block';

			document.getElementById("Submit-Buttons").style.display = 'block';
			break;

	  } //switch
} //showDiv

function displaySubtopicOther()
{
	if(document.EmailForm.SubTopicDropDown.value=="Other")
	{
		document.getElementById('lbl_1').style.visibility="visible";
		document.getElementById('lbl_1_0').style.visibility="visible";
	}else{
		document.getElementById('lbl_1').style.visibility="hidden";
		document.getElementById('lbl_1_0').style.visibility="hidden";
	}
}

function displayProductOther(FormType)
{
	document.EmailForm.ProductTextBox.value="";
	str=document.EmailForm.ProductDropDown.value

	if ((FormType==3)||(FormType==5))
	{
		for ( i=0; i< document.EmailForm.ProductMultipleDropDown.options.length; i++)
		{
			if (document.EmailForm.ProductMultipleDropDown.options[i].selected == true )
			{
			    document.EmailForm.ProductTextBox.value=document.EmailForm.ProductTextBox.value + document.EmailForm.ProductMultipleDropDown.options[i].text + ","
			}
		}
	}
	else
	{
		for ( i=0; i< document.EmailForm.ProductDropDown.options.length; i++)
		{
			if (document.EmailForm.ProductDropDown.options[i].selected == true )
			{
		    	document.EmailForm.ProductTextBox.value=document.EmailForm.ProductTextBox.value + document.EmailForm.ProductDropDown.options[i].text + ","
			}
		}
	}
	if (document.EmailForm.ProductTextBox.value.indexOf("Other")>-1)
	{
		document.getElementById("dependent-product-other").style.display = 'block';
	}
	else
	{
		document.getElementById("dependent-product-other").style.display = 'none';
	}
	if ((FormType==2)||(FormType==4)||(FormType==5))
	{
		if ((document.EmailForm.ProductTextBox.value.indexOf("Thomson ONE")>-1)||(document.EmailForm.ProductTextBox.value.indexOf("ILX")>-1))
		{
			resetFlag1();
  			document.getElementById("dependent-subid").style.display = 'block';
		}
		else
		{
			document.getElementById("dependent-subid").style.display = 'none';
		}
	}
}

function displayFlag1()
{
	document.getElementById('lbl_9_01').style.visibility="hidden";
	document.getElementById('lbl_9_02').style.color="black";
	document.getElementById('lbl_9_02').style.fontWeight="normal";
	document.getElementById('lbl_24').style.visibility="visible";
	document.getElementById('lbl_24').style.color="red";
	document.getElementById('lbl_24').style.fontWeight="normal";
	document.getElementById('lbl_25').style.visibility="visible";
	document.getElementById('lbl_25').style.color="red";
	document.getElementById('lbl_25').style.fontWeight="normal";
}

function resetFlag1()
{
	document.getElementById('lbl_9_01').style.visibility="visible";
	document.getElementById('subid').style.color="black";
	document.getElementById('subid').style.fontWeight="normal";
	document.getElementById('lbl_24').style.visibility="hidden";
	document.getElementById('lbl_12').style.color="black";
	document.getElementById('lbl_12').style.fontWeight="normal";
	document.getElementById('lbl_25').style.visibility="hidden";
	document.getElementById('lbl_14').style.color="black";
	document.getElementById('lbl_14').style.fontWeight="normal";
}

function SubmitForm()
{
	strFormType = document.EmailForm.FormType.value;

	strErr = ""; //clear error label
	flag = true; //unset flag

	//unset all style colors
	resetStyle(4);		// First Name
	resetStyle(5);		// Last Name
	resetStyle(6);		// Email Address
	resetStyle(7);		// Phone
	resetStyle(31);		// Thomson Financial Customer

	resetStyle(0); 		// Subtopic
	resetStyle(1);		// Subropic Other
	resetStyle(2);		// Product
	resetStyle(3);		// Product Other
	resetStyle(10);		// Product Log-in/User Name
	resetStyle(29);		// Thomson Customer
	resetStyle(17);		// Attachment
	resetStyle(18);		// Request/Comments

	resetStyle("9_02");	// SubID
	resetStyle(12);		// Company Name
	resetStyle(21);		// Mailing Address
	resetStyle(14);		// City
	resetStyle(15);		// Region

	validateForm();
	if(flag)
	{
		document.EmailForm.action="SendEmail.asp";
		document.EmailForm.submit();
	}
	else
	{
		alert(strErr);
	}
}

function validateForm()
{
	validRequired(4);	// First Name
	validRequired(5);	// Last Name
	validRequired(6);	// Email Address
	validRequired(7);	// Phone
	validRequired(31);	// Thomson Financial Customer
	validRequired(18); 	// Request/Comments

	if(strFormType!="9")
	{
		validRequired(0);	// Subtopic
	}

	if(strFormType!="6")
	{
		validRequired(12); 	// Company Name - All except FeedBack
	}

	if((strFormType!="1")&&(strFormType!="6"))
	{
		validRequired(14); 	// City - All except FeedBack & Billing
		validRequired(15);  // Region - All except FeedBack & Billing
	}

	if((strFormType=="2")||(strFormType=="3")||(strFormType=="5"))
	{
		validRequired(2); 	// Product - Product Assistance, Account Information, Technical Support, Permissions/Entitlements
	}

	if((strFormType=="2")||(strFormType=="5"))
	{
		validRequired(9); 	// SubID - Product Assistance, Technical Support, Permissions/Entitlements
	}

	if(strFormType=="6")
	{
		validRequired(3); 	// Product Other - FeedBack
	}

	if(strFormType=="3")
	{
		validRequired(10); 	// Product Log-in/User Name - Account Information
		validRequired(21); 	// Mailing Address - Account Information
	}

	if(strFormType=="8")
	{
		validRequired(29); 	// Thomson Customer - Sales
	}

	if(!flag){strErr = strErr + "Please complete all required fields (shown in bold red)";}
}

function validRequired(lblNum)
{
	// Sub-Topic Validation
	if(lblNum==0)
	{
		if ((document.EmailForm.SubTopicDropDown.value=="00") || (document.EmailForm.SubTopicDropDown.value==""))
		{
			document.getElementById('lbl_0').style.color="red";
			document.getElementById('lbl_0').style.fontWeight="bold";
			flag = false;
		}
	}

	// Sub-Topic Other Validation
	if((lblNum==0) && (document.EmailForm.SubTopicDropDown.value=="Other"))
	{
		if(document.EmailForm.SubTopicOtherTextBox.value=="")
		{
			document.getElementById('lbl_1').style.color="red";
			document.getElementById('lbl_1').style.fontWeight="bold";
			flag = false;
		}
	}

	// Product Validation
	if (lblNum==2)
	{
		if ((document.EmailForm.FormType.value=="3")||(document.EmailForm.FormType.value=="5"))
		{
			if (document.EmailForm.ProductMultipleDropDown.value=="")
			{
				document.getElementById('lbl_2_1').style.color="red";
				document.getElementById('lbl_2_1').style.fontWeight="bold";
				flag = false;
			}
		}
		else
		{
			if ((document.EmailForm.ProductDropDown.value=="00") || (document.EmailForm.ProductDropDown.value==""))
			{
				document.getElementById('lbl_2').style.color="red";
				document.getElementById('lbl_2').style.fontWeight="bold";
				flag = false;
			}
		}
	}

	// Product Other Validation
	if((lblNum==2) &&(document.EmailForm.ProductTextBox.value.indexOf("Other")>-1))
	{
		if(document.EmailForm.ProductOtherTextBox.value=="")
		{
			document.getElementById('lbl_3').style.color="red";
			document.getElementById('lbl_3').style.fontWeight="bold";
			flag = false;
		}
	}

	// Product Other Validation
	if((lblNum==3) &&(document.EmailForm.ProductDropDown.value=="Other"))
	{
		if(document.EmailForm.ProductOtherTextBox.value=="")
		{
			document.getElementById('lbl_3').style.color="red";
			document.getElementById('lbl_3').style.fontWeight="bold";
			flag = false;
		}
	}

	// First Name Validation
	if((lblNum==4) && (document.EmailForm.FirstNameTextBox.value==""))
	{
		document.getElementById('lbl_4').style.color="red";
		document.getElementById('lbl_4').style.fontWeight="bold";
		flag = false;
	}

	// Last Name Validation
	if((lblNum==5) && (document.EmailForm.LastNameTextBox.value==""))
	{
		document.getElementById('lbl_5').style.color="red";
		document.getElementById('lbl_5').style.fontWeight="bold";
		flag = false;
	}

	// Email Validation
	if((lblNum==6) && (document.EmailForm.EmailAddressTextBox.value==""))
	{
		document.getElementById('lbl_6').style.color="red";
		document.getElementById('lbl_6').style.fontWeight="bold";
		flag = false;
	}

	if((lblNum==6) && (document.EmailForm.EmailAddressTextBox.value!=""))
	{
		str=document.EmailForm.EmailAddressTextBox.value;
		if (str.indexOf("@") == -1)
		{
			document.getElementById('lbl_6').style.color="red";
			document.getElementById('lbl_6').style.fontWeight="bold";
			flag = false;
			alert("Please enter a valid email address.");
		}
		if (str.indexOf(".") == -1)
		{
			document.getElementById('lbl_6').style.color="red";
			document.getElementById('lbl_6').style.fontWeight="bold";
			flag = false;
			alert("Please enter a valid email address.");
		}
		else
		{
			var atPos = str.indexOf("@")
			if (str.indexOf(".",atPos) == -1)
			{
				document.getElementById('lbl_6').style.color="red";
				document.getElementById('lbl_6').style.fontWeight="bold";
				flag = false;
				alert("Please enter a valid email address.");
			}
		}
	}

	// Phone Validation
	if(lblNum==7){
		if (document.EmailForm.PhoneNumberTextBox1.value=="")
		{
			lblName = "lbl_" + (lblNum);
			document.getElementById(lblName).style.color="red";
			document.getElementById(lblName).style.fontWeight="bold";
			flag = false;
		}
		else
		{
			if (document.EmailForm.PhoneNumberTextBox1.value!="")
			{
				if (document.EmailForm.PhoneNumberTextBox1.value.length < 10)
				{
					lblName = "lbl_" + (lblNum);
					document.getElementById(lblName).style.color="red";
					document.getElementById(lblName).style.fontWeight="bold";
					flag = false;
					alert('Phone numbers should include at least 10 digits.')
				}
				else
				{
					x=0
					for (j=0; j<document.EmailForm.PhoneNumberTextBox1.value.length; j++)
					{
						x=x+1
						if ((document.EmailForm.PhoneNumberTextBox1.value.charAt(j) < "0") || (document.EmailForm.PhoneNumberTextBox1.value.charAt(j) > "9"))
						{
							x=x-1
						}
					}
					if (x<10)
					{
						lblName = "lbl_" + (lblNum);
						document.getElementById(lblName).style.color="red";
						document.getElementById(lblName).style.fontWeight="bold";
						flag = false;
						alert('Phone numbers should include at least 10 digits.')
					}
			 	}
			}
		}
	}

	// How would you like us to respond
	if(lblNum==8)
	{
		selectedButton = -1;
		for (i=document.EmailForm.ResponseRadio.length-1; i > -1; i--)
		{
			if (document.EmailForm.ResponseRadio[i].checked)
			{
				selectedButton = i; i = -1;
			}
		}
		if (selectedButton == -1) {
			document.getElementById('lbl_8').style.color="red";
			document.getElementById('lbl_8').style.fontWeight="bold";
			flag = false;
		}
	}

	// Thomson Customer
	if(lblNum==29)
	{
		selectedButton = -1;
		for (i=document.EmailForm.CustomerRadio.length-1; i > -1; i--)
		{
			if (document.EmailForm.CustomerRadio[i].checked)
			{
				selectedButton = i; i = -1;
			}
		}
		if (selectedButton == -1)
		{
			document.getElementById('lbl_29').style.color="red";
			document.getElementById('lbl_29').style.fontWeight="bold";
			flag = false;
		}
	}

	// Thomson Financial Customer
	if(lblNum==31)
	{
		selectedButton = -1;
		for (i=document.EmailForm.TFCustomerRadio.length-1; i > -1; i--)
		{
			if (document.EmailForm.TFCustomerRadio[i].checked)
			{
				selectedButton = i; i = -1;
			}
		}
		if (selectedButton == -1)
		{
			document.getElementById('lbl_31').style.color="red";
			document.getElementById('lbl_31').style.fontWeight="bold";
			flag = false;
		}
	}

	// Product Login Validation
	if((lblNum==10) && (document.EmailForm.ProductLoginTextBox.value==""))
	{
		document.getElementById('lbl_10').style.color="red";
		document.getElementById('lbl_10').style.fontWeight="bold";
		flag = false;
	}

	// SubID Validation
	if((lblNum==9) && (document.EmailForm.IDTextBox.value==""))
	{
		if ((document.EmailForm.FormType.value=="2")||(document.EmailForm.FormType.value=="4")||(document.EmailForm.FormType.value=="5"))
		{
			if ((document.EmailForm.ProductTextBox.value.indexOf("Thomson ONE")>-1)||(document.EmailForm.ProductTextBox.value.indexOf("ILX")>-1))
			{
				if (document.EmailForm.IDRadio[0].checked)
				{
					document.getElementById('lbl_9_01').style.color="red";
					document.getElementById('lbl_9_01').style.fontWeight="bold";
					document.getElementById('lbl_9_02').style.color="red";
					document.getElementById('lbl_9_02').style.fontWeight="bold";
					flag = false;
				}
				else
				{
					document.getElementById('lbl_9_01').style.color="white";
					document.getElementById('lbl_9_01').style.fontWeight="normal";
					document.getElementById('lbl_9_02').style.color="black";
					document.getElementById('lbl_9_02').style.fontWeight="normal";
				}
			}
		}
	}

	// Company Name Validation
	if((lblNum==12) && (document.EmailForm.CompanyNameTextBox.value==""))
	{
		if ((document.EmailForm.FormType.value=="2")||(document.EmailForm.FormType.value=="4")||(document.EmailForm.FormType.value=="5"))
		{
			if ((document.EmailForm.ProductTextBox.value.indexOf("Thomson ONE")==-1)||(document.EmailForm.ProductTextBox.value.indexOf("ILX")>-1))
			{
				document.getElementById('lbl_12').style.color="red";
				document.getElementById('lbl_12').style.fontWeight="bold";
				flag = false;
			}
			if (document.EmailForm.IDRadio[1].checked)
			{
				document.getElementById('lbl_24').style.color="red";
				document.getElementById('lbl_24').style.fontWeight="bold";
				document.getElementById('lbl_12').style.color="red";
				document.getElementById('lbl_12').style.fontWeight="bold";
				flag = false;
			}
		}
		else
		{
			document.getElementById('lbl_12').style.color="red";
			document.getElementById('lbl_12').style.fontWeight="bold";
			flag = false;
		}
	}

	// Mailing Address
	if((lblNum==21) && (document.EmailForm.MailingAddressTextBox.value==""))
	{
		document.getElementById('lbl_21').style.color="red";
		document.getElementById('lbl_21').style.fontWeight="bold";
		flag = false;
	}

	// City Validation
	if((lblNum==14) && (document.EmailForm.CityTextBox.value==""))
	{
		if ((document.EmailForm.FormType.value=="2")||(document.EmailForm.FormType.value=="4")||(document.EmailForm.FormType.value=="5"))
		{
			if ((document.EmailForm.ProductTextBox.value.indexOf("Thomson ONE")==-1)||(document.EmailForm.ProductTextBox.value.indexOf("ILX")>-1))
			{
				document.getElementById('lbl_14').style.color="red";
				document.getElementById('lbl_14').style.fontWeight="bold";
				flag = false;
			}
			if (document.EmailForm.IDRadio[1].checked)
			{
				document.getElementById('lbl_25').style.color="red";
				document.getElementById('lbl_25').style.fontWeight="bold";
				document.getElementById('lbl_14').style.color="red";
				document.getElementById('lbl_14').style.fontWeight="bold";
				flag = false;
			}
		}
		else
		{
			document.getElementById('lbl_14').style.color="red";
			document.getElementById('lbl_14').style.fontWeight="bold";
			flag = false;
		}
	}

	// Region Validation
	if(lblNum==15)
	{
		if ((document.EmailForm.RegionDropDown.value=="00") || (document.EmailForm.RegionDropDown.value==""))
		{
			document.getElementById('lbl_15').style.color="red";
			document.getElementById('lbl_15').style.fontWeight="bold";
			flag = false;
		}
	}

	// Attachment Validation
	if((lblNum==17) && (document.EmailForm.FilAttach.value!=""))
	{
		var ext = document.EmailForm.FilAttach.value;
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
		if ((ext == 'exe')||(ext=='.js')||(ext=='.vb')||(ext=='asp')||(ext=='dll')||(ext=='scr')||(ext=='bat')||(ext=='reg')||(ext=='cab')||(ext=='mp3'))
		{
			alert('You selected a .'+ext+' file; Please select a text-based file.');
			flag = false;;
		}
	}

	// Requests/Comments
	if((lblNum==18) && (document.EmailForm.CommentsTextArea.value==""))
	{
		document.getElementById('lbl_18').style.color="red";
		document.getElementById('lbl_18').style.fontWeight="bold";
		flag = false;
	}
}

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}