
function fnSubmitCompanySearchForm(myForm)
{	
	// function resets the form action to an SEO friendly string.  
	// all form values are passed into the action URL - so we don't need to worry about formhandler.
	// we don't just use a GET method on the form submit because this would lead to ugly URL in the action

	var newFormAction = '/companySearch';
	
	// add the sector into the URL
	selectedSectorNameValue = myForm.sectorName[myForm.sectorName.selectedIndex].value;
	if(selectedSectorNameValue!='0' && selectedSectorNameValue!='')
		newFormAction += '/sector-'+selectedSectorNameValue;
	
	// add the location into the URL
	selectedCountryNameValue = myForm.countryName[myForm.countryName.selectedIndex].value;
	if(selectedCountryNameValue!='0' && selectedCountryNameValue!='')
	{
		newFormAction += '/location-'+selectedCountryNameValue;
		// now add the locale value if one has been selected
		selectedLocaleNameValue = myForm.localeName[myForm.localeName.selectedIndex].value;
		if(selectedLocaleNameValue!='0' && selectedLocaleNameValue!='')
			newFormAction += '-'+selectedLocaleNameValue;	
	}
	
	// add the company type option into the URL
	selectedCompanyType = '';
	for(g=0; g<myForm.companyType.length; g++)
	{
		if(myForm.companyType[g].checked)
			selectedCompanyType=myForm.companyType[g].value;
	}
	if(selectedCompanyType != '' && selectedCompanyType != 'all')
		newFormAction += '/type-'+selectedCompanyType;

	// add the page number into the URL - always 1 because its a fresh search
	newFormAction += '/startrow-1';
	
	myForm.action = newFormAction+'.htm';
	window.location.href = myForm.action;
	return false;
}
