function updqty()
{
  document.cartfrm.action='updatebasket.php';
  document.cartfrm.submit();
}
function go_to()
{
  document.cartfrm.action='checkout_1.php';
  document.cartfrm.submit();
}
function showhide(val)
{
 if(val == 1)
 {
   document.getElementById('opt').style.display='';
 }
 else
 {
   document.getElementById('opt').style.display='none';
   document.cartfrm.action='checkout_1.php';
   document.cartfrm.submit();
 }
}
function chkfree(){
	if(document.getElementById('freeis')){
	if(document.getElementById('freeis').value == 1){
		alert("Please Select Your Free Bag.")
	return 1;
	}}
	else{
		return 2;
	}
}
function chkshopper(){
 
	if(document.getElementById('shopper')){
	if(document.getElementById('shopper').value > 0){
		alert("You cannot select Shopping Bags alone.")
	return 1;
	}
	else{
		return 2;
	}
	
	}
	else{
		return 2;
	}
}
function validate1()
{
	var t = chkfree();
	var sho = chkshopper();

	if( t == 2 && sho == 2)
	{

    var ptype = document.getElementById('ptyp').value;
	
	if(ptype)
	{
		
		document.cartfrm.action='checkout.php';
		document.cartfrm.submit();
		return true;
	}
	else
	{
		alert("Please select the payment method!");
		return false;
	}
	
	}
	else{
 		return false;
	    
	}
} 
	 
 
 
	    
	 
 
	

