/*
	PREREQUSITIES FOR USING THE SCRIPT
	THE FORM NAME MUST BE NAMED AS form1
	QUANTITY FIELD MUST BE NAMED AS sQty 
*/

function check_qty()
{
var bcheck_qty = check_qty1();
var bcheck_shipping = check_shipping();
return (bcheck_qty && bcheck_shipping);
}




function check_qty1()
{
var cQty = document.form1.sQty.value;
var err = false;

		if (cQty > 0)
		{	

			for (i=0; i<cQty.length; i++)
			{
				if (cQty.charAt(i) == ".")
				{
					err = true;
				}
				
			}
		}
		else
		{
			err = true;
		}
		
	if (err == true)
	{
		window.alert('Please provide quantity in numeric format and greater than 0');
		return false;
	}

	else
	{
		return true;
	}
}


function check_shipping()
{
var cshipping = document.form1.sshipping.value;
var err = false;

	if (cshipping > -1)
		{	

			for (i=0; i<cshipping.length; i++)
			{
				if (cshipping.charAt(i) == ".")
				{
					err = true;
				}
				
			}
		}
		else
		{
			err = true;
		}
		
	if (err == true)
	{
		window.alert('Please provide shipping in right amount according to the table');
		return false;
	}
	else
	{
		return true;
	}
}





/*
function check_price(price)
{
	var err = false;
	if (price > 0)
	{
		return true;
	}
	else
	{
		window.alert('Price must be numeric and not equals to 0');
		price.focus();
		return false;
	}
}
*/
