var oldValue = "";

function echo(str)
{
	return document.write(str);
}

function equipChangeHandler(obj)
{
	var spec = document.getElementById("specifyContainer");
	spec.style['visibility'] = ((obj.options[obj.selectedIndex].id == "other") ? "visible" : "hidden");
}

function validateForm(obj)
{
	var textField = new Array("firstName", "lastName", "title", "company", "address", "city", "state", "zip", "phone", "email", "desiredTerm", "typeOfEquip");
	var fieldName = new Array("first name", "last name", "title", "company", "address", "city", "state", "zip", "phone", "e-mail", "desired term", "type of equip");

	for (var i = 0; i < textField.length; i++)
	{
		if (document.getElementById(textField[i]).value == "")
		{
			alert("Fill '" + fieldName[i] + "' field first.");
			return false;
		}
	}

	if (document.getElementById('email').value.indexOf("@") ==  -1)
	{
		alert("Email format mismatch.");
		return false;
	}

	if ((document.getElementById('typeOfEquip').value == "Other") && (document.getElementById("specify").value == ""))
	{
			alert("Please, specify type of equipment you want to lease.");
			return false;
	}


	return true;
}
