
function nextbutton(webpage)
{
	if (chkinfo())
	{	
		document.sectionform.action = webpage		
		document.sectionform.submit()
		return true
	}
}

function chkinfo()
{

//REQUIRED FIELDS NOT EMPTY	

	if(trim(document.sectionform.customername.value) == "")
	{	
		alert("Please enter your full name.")
		document.sectionform.customername.focus()
		return false
	}
	
	

//PHONE digits - at least 10 digits but allow more for extentions

	i=0
	phoneval = trim(document.sectionform.customerphone.value)
	for (x=0;x<phoneval.length;x++)
	{
		if (!isNaN(phoneval.charAt(x))) i++
	}
	if (i < 10)
	{
		alert("Please provide a valid telephone number of at least 10 digits - may include extention.")
		document.sectionform.customerphone.focus()										
		return false
	}


if(trim(document.sectionform.position.value) == "")
	{	
		alert("Please enter your position or job title.")
		document.sectionform.position.focus()
		return false
	}


if(trim(document.sectionform.customeremail.value) == "")
	{	
		alert("Please enter your email address.")
		document.sectionform.customeremail.focus()
		return false
	}

//VALID EMAIL
	tmpval = trim(document.sectionform.customeremail.value)
	atsign = tmpval.indexOf("@")
	dot = tmpval.indexOf(".")
	if (atsign <= 0 || dot <= 0)
	{
		alert("Please provide a valid email address including the '@' sign and period.")
		document.sectionform.customeremail.focus()
		return false
	}


	if(trim(document.sectionform.sitename.value) == "")
	{	
		alert("Please enter your company name.")
		document.sectionform.sitename.focus()
		return false
	}

	if(trim(document.sectionform.addr1.value) == "")
	{	
		alert("Please enter an address.")
		document.sectionform.addr1.focus()
		return false
	}
	else
	if(trim(document.sectionform.city.value) == "")
	{	
		alert("Please enter a city.")
		document.sectionform.city.focus()
		return false
	}
	else
	if ((trim(document.sectionform.state.value) == "") || (document.sectionform.state.value == "--") || (document.sectionform.state.value == "0") || (document.sectionform.state.value < 2))
	{	
		alert("Please enter a state.")
		document.sectionform.state.focus()
		return false
	}
	else
	if(trim(document.sectionform.zip5.value) == "")
	{	
		alert("Please enter a zip code.")
		document.sectionform.zip5.focus()
		return false
	}

//VALID ZIP
	zipval = trim(document.sectionform.zip5.value)
	i=0
	for (x=0;x<zipval.length;x++)
	{
		if (!isNaN(zipval.charAt(x))) i++
	}
	if (i!=5)
	{
		alert("Please provide a valid zip code of 5 digits.")
		document.sectionform.zip5.focus()
		return false
	}

//VALID ZIP
	if (trim(document.sectionform.zip4.value) != "")
	{
		zipval = document.sectionform.zip4.value
		i=0
		for (x=0;x<zipval.length;x++)
		{
			if (!isNaN(zipval.charAt(x))) i++
		}
		if (i!=4)
		{
			alert("Please provide a valid zip code of 4 digits.")
			document.sectionform.zip4.focus()
			return false
		}
	}
	
	return true
}

