
var iDelTotalChecked=0;

	function objDelChecked(chk)
	{
	//if any item is selected to delete then iDelTotalChecked will ++
		if(chk.checked==true)
		{
			iDelTotalChecked=iDelTotalChecked+1;
		}
		else
		{
			iDelTotalChecked=iDelTotalChecked-1;
		}
	}

	function ConfirmChoice() 
	{ 
	//function to ask confirm message while updating cart	
		if(iDelTotalChecked > 0)
		{					
			return  confirm("Are you sure you want to Remove the selected Product(s) from the cart?")
					
		}

	return true;
				
	}



function confirmEmpty()
{
//function used to check confirmation for empty action
	return confirm("Are you sure you want to Empty the Shopping Cart? ");
}


function onlyno()
{
// fuction to restrict to enter numbers only
	if (event.keyCode < 47 || event.keyCode > 57 ) 
	event.returnValue = false;
}


function chkValue(obj)
{
//function to restrict to insert value blank or 0
objVal=obj.value;
	if(objVal=="")
	{
		alert("Please enter some Quantity to Update"); 
		obj.focus();
	}
	if(objVal=="0")
	{
		alert("Please enter valid Quantity"); 
		obj.focus();
		obj.select();
	}
}

function goUpdate(frm)
{
//function that is used to submit the form for final update
	if(ConfirmChoice())
	{
		frm.submit();
	}
	else
	{
		return false;
	}
}

function confirmOrd()
{
//function used to check confirmation for final order
	return confirm("Are you sure you want to place Order? ");
}


function check_shipping(frm,obj,pathVar)
{
/* function to check wether user selected any shipping option or not 
   frm:form fefrence
   pathVar=path where to redirect user after selecteing option  ***/


	if(obj)
	{
		if(obj.selectedIndex==0)
		{
				alert("Please select Shipping option.");
				return false;
		}
		else
		{
			frm.action=pathVar;
			frm.submit();
		}
		
	}
	
}

function submitManualShipping( frm, pathVar){
	if(frm.select_manualshipping)
	{
		if(frm.select_manualshipping.value=='')
		{
				alert("Please select Shipping option.");
				return false;
		}
		else
		{
			frm.action=pathVar;
			frm.submit();
		}
		
	}	

}
