
	function toggleFields()
	{ 
		if(document.frmZipcode1.blnCity.checked)
		{
			document.frmZipcode1.strStartCity.disabled = false;
			document.frmZipcode1.strStartCity.style.backgroundColor="white";
			document.frmZipcode1.strEndCity.disabled = false;
			document.frmZipcode1.strEndCity.style.backgroundColor="white";
			document.frmZipcode1.strStartState.disabled = false;
			document.frmZipcode1.strEndState.disabled = false;
			
			document.frmZipcode1.strStartZipcode.style.backgroundColor="Gainsboro";
			document.frmZipcode1.strEndZipcode.style.backgroundColor="Gainsboro";
			document.frmZipcode1.strStartZipcode.disabled = true;
			document.frmZipcode1.strEndZipcode.disabled = true;
		}
		else
		{
			document.frmZipcode1.strStartCity.disabled = true;
			document.frmZipcode1.strStartCity.style.backgroundColor="Gainsboro";
			document.frmZipcode1.strEndCity.disabled = true;
			document.frmZipcode1.strEndCity.style.backgroundColor="Gainsboro";
			document.frmZipcode1.strStartState.disabled = true;
			document.frmZipcode1.strEndState.disabled = true;
			
			document.frmZipcode1.strStartZipcode.style.backgroundColor="white";
			document.frmZipcode1.strEndZipcode.style.backgroundColor="white";
			document.frmZipcode1.strStartZipcode.disabled = false;
			document.frmZipcode1.strEndZipcode.disabled = false;
		}
		document.frmZipcode1.strPieceCount.focus();
	}
	function verifySubmit()
	{
		blnGood = true;
		if(document.frmZipcode1.blnCity.checked) 
		{
			if (document.frmZipcode1.strPieceCount.value=="")
			{
				blnGood = false;
			}
			if (document.frmZipcode1.strStartCity.value=="")
			{
				blnGood = false;
			}
			if (document.frmZipcode1.strEndCity.value=="")
			{
				blnGood = false;
			}
		}
		else
		{
			if (document.frmZipcode1.strPieceCount.value=="")
			{
				blnGood = false;
			}
			if (document.frmZipcode1.strStartZipcode.value=="")
			{
				blnGood = false;
			}
			if (document.frmZipcode1.strEndZipcode.value=="")
			{
				blnGood = false;
			}
		}
		if (blnGood)
		{
			blnWeightCheck=true;
			blnWeightCheck= weightCheck(document.frmZipcode1.strPieceCount.value,document.frmZipcode1.strTotalShipmentWeight.value);
			if (blnWeightCheck)
			{
				document.frmZipcode1.submit();
			}
		}
		else
		{
			alert("Please complete the required fields.");
		}
	}
	
	function weightCheck(iPieceCount,iWeight)
	{
		blnMaxGood=true;
		
		//Min
		if(iPieceCount==1)
		{
			intMinCalcWeight=100;
		}
		else if (iPieceCount > 1 && iPieceCount<9)
		{
			intMinCalcWeight=200;
		}
		else
		{
			intMinCalcWeight = ((iPieceCount - 8) * 25) + 200;
		}
		//Max
		intMaxCalcWeight = iPieceCount * 100;

		if (iWeight < intMinCalcWeight)
		{
			//The minimum purchased weight for " " items is for up to "    " pounds.
			//Your indicated weight has been changed to minimum.
			document.frmZipcode1.strTotalShipmentWeight.value=intMinCalcWeight;
			alert("The minimum purchased weight for " + iPieceCount + " items is for up to " + intMinCalcWeight + " pounds.\nYour indicated weight has been changed to minimum.")
		}
		else
		{
			if (iWeight > intMaxCalcWeight)
			{
				//Maximum weight per item accepted by GPX is 100 lbs. per item.  Based  
				//on your entry there appears to be items exceeding this amount.
				document.frmZipcode1.strTotalShipmentWeight.value="";
				document.frmZipcode1.strPieceCount.value="";
				alert("Maximum weight per item accepted by GPX is 100 lbs. per item.\nBased on your entry there appears to be items exceeding this amount.");
				blnMaxGood=false;
			}
		}
		
		return blnMaxGood;
	}