function validateShoppingCart()
{
	x=document.entry;
	at=x.EmailAddress.value.indexOf("@");
	UserName=x.UserName.value;
	SName=x.ShippingName.value;
	bAddress1=x.BillingAddress1.value;
	sAddress1=x.ShippingAddress1.value;
	bCity=x.BillingCity.value;
	sCity=x.ShippingCity.value;
	bZip=x.BillingZip.value;
	bState=x.BillingState.value;
	sState=x.ShippingState.value;
	bCountry=x.BillingCountry.value;
	sCountry=x.ShippingCountry.value;
	sPhone=x.ShippingPhone.value;
	bPhone=x.BillingPhone.value;
	sZip=x.ShippingZip.value;
	sServiceName=x.ServiceName.value;
	sServiceDesc=x.ServiceDesc.value;	
	nBudget=x.Budget.value;	

	submitOK="True";

	if (nBudget.length < 1 )
	{
		alert("Budget is empty. Please enter a budget. If you are ok with any budget, please enter 0.");
		submitOK="False";
	}
	else if (!IsNumeric(nBudget))
	{
		alert("Please enter only numbers in Budget. No need to mention Currency.");
		submitOK="False";
	}

	if (sServiceName.length < 8 )
	{
		alert("Please enter valid Item/ Service details..");
		submitOK="False";
	}

	if (sServiceDesc.length < 8 )
	{
		alert("Please enter valid Details/ Explanation.");
		submitOK="False";
	}

	if (UserName.length<3)
	{
		alert("Billing name does not seems to be correct. Expects minimum three letters for the name");
		submitOK="False";
	}

	if (SName.length<3)
	{
		alert("Shipping name does not seems to be correct. Expects minimum three letters for the name");
		submitOK="False";
	}

	if (bAddress1.length<2)
	{
		alert("Please enter a valid Billing Address");
		submitOK="False";
	}

	if (sAddress1.length<2)
	{
		alert("Please enter a valid Shipping Address");
		submitOK="False";
	}

	if (bCity.length<2)
	{
		alert("Please enter a valid Billing City");
		submitOK="False";
	}

	if (sCity.length<2)
	{
		alert("Please enter a valid Shipping City");
		submitOK="False";
	}

	if (bState=="X")
	{
		alert("Please enter a valid Billing State");
		submitOK="False";
	}

	if (sState=="X")
	{
		alert("Please enter a valid Shipping State");
		submitOK="False";
	}

	if (bCountry=="X")
	{
		alert("Please enter a valid Billing Country");
		submitOK="False";
	}

	if (sCountry=="X")
	{
		alert("Please enter a valid Shipping Country");
		submitOK="False";
	}

	if (bZip <0 )
	{
		alert("Please enter a valid Billing PIN Code/ZIP Code");
		submitOK="False";
	}

	if (bPhone.length<7)
	{
		alert("Please enter a valid Phone number for billing address.");
		submitOK="False";
	}
	if (sPhone.length<7)
	{
		alert("Please enter a valid Phone number for shipping address.");
		submitOK="False";
	}

	if (sZip <0 )
	{
		alert("Please enter a valid Shipping PIN Code/ZIP Code");
		submitOK="False";
	}



	if (at==-1) 
	{
		alert("Please enter a valid e-mail address.");
		submitOK="False";
	}

	if (submitOK=="False")
	{
		return false;
	}
	else
	{
		return true;
	}
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}

