function valProduct()
{
	var frm = document.frm_addproduct;
	if(Trim(frm.txtProdName.value) == "")
	{
		alert('Please enter product name');
		frm.txtProdName.focus();
		return false;
	}
	if(Trim(frm.txtPrice.value) == "")
	{
		alert('Please enter product price');
		frm.txtPrice.focus();
		return false;
	}
	if(Trim(frm.txtPrice.value) != "")
	{
		if(isFloat(frm.txtPrice.value) == false)
		{
			alert('Please enter valid price');
			frm.txtPrice.value="";
			frm.txtPrice.focus();
			return false;
		}
		
	}
	if(Trim(frm.txtMinStock.value) == "")
	{
		alert('Please enter min. stock');
		frm.txtMinStock.focus();
		return false;
	}
	if(Trim(frm.txtMinStock.value) != "")
	{
		if(isNum(frm.txtMinStock.value) == false)
		{
			alert('Please enter valid min. stock');
			frm.txtMinStock.value="";
			frm.txtMinStock.focus();
			return false;
		}
		
	}
	
	if(Trim(frm.txtAvailStock.value) != "")
	{
		if(isNum(frm.txtAvailStock.value) == false)
		{
			alert('Please enter valid Available Stock');
			frm.txtAvailStock.value="";
			frm.txtAvailStock.focus();
			return false;
		}
		
	}
	if(Trim(frm.txtExpiry.value) == "")
	{
		alert('Please enter expiry date');
		frm.txtExpiry.focus();
		return false;
	}

	
}

function valQty()
{
	var frm = document.addtocart;
	if(Trim(frm.txtQty.value) == "")
	{
		alert('Please enter quantity');
		frm.txtQty.focus();
		return false;
	}
	return true;
}

function DeleteProduct(prdid)
{
	var frm = document.viewcart;
	if(!confirm("Are you sure to delete it?"))
		return false;
	frm.action="CartView.php?act=D&PID="+prdid
	frm.submit();
	return true;
}

