function trim(Form) {
	for (var i = 0; i < Form.elements.length; i++) {
		if ((Form.elements[i].type == "text") || (Form.elements[i].type == "textarea") || (Form.elements[i].type == "password")) {
			Form.elements[i].value = Form.elements[i].value.replace(/^\s+|\s+$/, "");
		}
	}
}


function validatePhoneNumber(strAreaCode, strPhoneExchange, strPhoneNumber) {
	if (strAreaCode.search(/^\d{3}$/) == -1) {return false}
	else if (strPhoneExchange.search(/^\d{3}$/) == -1) {return false}
	else if (strPhoneNumber.search(/^\d{4}$/) == -1) {return false}
	return true;
}



function validateEmailAddress(strEmailAddress) {
	return strEmailAddress.search(/^(\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)?$/) != -1;
}



function setSelectedIndex(selectBox, value)
{
	for (var index = 0; index < selectBox.options.length; index++)
	{
		if (selectBox.options[index].value == value)
		{
			selectBox.selectedIndex = index;
			break;
		}
	}
}



function ValidateInteger(value, minimum, maximum)
{
	if (value.search(/^0|([1-9]\d*)$/gi))
	{
		return false;
	}
	else if (0 < (minimum - Number(value)))
	{
		return false;
	}
	else if (0 < (Number(value) - maximum > 0))
	{
		return false;
	}
	else
	{
		return true;
	}
}



function Truncate(input, maximumValueLength)
{
	if (maximumValueLength < input.value.length)
	{
		input.value = input.value.substring(0, maximumValueLength);
		alert("You have reached the maximum number\nof characters allowed for this field");
	}
}


function EnvirofiltersProduct(productID, manufacturerDescription, categoryDescription,
	partNumber, description, equipmentModelNumber, isAlias)
{
	this.ProductID = productID;
	this.ManufacturerDescription = manufacturerDescription;
	this.CategoryDescription = categoryDescription;
	this.PartNumber = partNumber;
	this.Description = description;
	this.EquipmentModelNumber = equipmentModelNumber;
	this.IsAlias = isAlias;
}