		var arrqty = new Array();
		var arrcheck = new Array();
		var arrprodCode = new Array();
		var arrprodid = new Array();
		var count=0;
	///////////////////////////////////////////////
	////////    SHIPPING ON COUNTRY CHANGE   /////////////////////////
	/////////////////////////////////////////////
	function submittIt2(){
	if(document.form1.dcountry.value==''){
	alert("Please select Country");
	}else if(document.form1.currencyid.value==''){
	alert("Please select Currency");
	}else if(document.form1.paymethodid.value==''){
	alert("Please select Paymethod");
	}else{
	document.form1.action='checkout.php';
	document.form1.submit();
	}
}
function do_able2buylist_cb(able2buyspan) {
		document.getElementById("able2buyspan").innerHTML=able2buyspan;
	}
	
var pay='';
	pay= document.getElementById("Payment Method");
	pay.onchange=function do_able2buylist(){
	var paylistvalue='';
	var merchant='';
	
	paylistvalue=document.getElementById("paymethodid").value;
	
	x_able2buylist(paylistvalue,do_able2buylist_cb);
	
	}
	////////////// On country list change for shipping /////////////////////////////	
	var country='';
	country= document.getElementById("dcountry");
	country.onchange=function do_shipping(){
		 arrqty.length=0; 
		 arrcheck.length=0; 
		 arrprodCode.length=0; 
		 arrprodid.length=0; 
		 count=0;
		
		count=(document.form1.qty.length); 
		
		if (count>1) {
					 var m=0;
						for(i=0;i<count;i++) 
						{ 
							arrqty[i] = document.form1.qty[i].value;
							arrprodCode[i] = document.form1.prodCode[i].value;
							arrprodid[i] = document.form1.prodid[i].value;
							
								if (document.form1.check[i].checked==true) 
								{ 
								arrcheck[m] = document.form1.check[i].value;
								m=m+1; 
								}else if(document.form1.check.checked==true){  
								arrcheck[0] = document.form1.check.value;
								} 
						} 
		} 
		else { 
				
					arrqty[0] = document.form1.qty.value;
					arrprodCode[0] = document.form1.prodCode.value;
					arrprodid[0] = document.form1.prodid.value;
							
							if (document.form1.check.checked==true) 
							{ 
							arrcheck[0] = document.form1.check.value;
							} 
						} 
				var country='';
			country = document.form1.dcountry.value;
		var vat_register1='';
		var getvtno='';
		var getvatinfoformflag='0';
		if (document.form1.vat_register)
		{
	//vat_register1 = document.form1.vat_register.checked;
	getvatinfoformflag='1';
		
		if (document.form1.vat_register[0].checked==true)
		{
				vat_register1='No Vat';
				getvtno=document.form1.VATNO.value;
		}
		else
		{
		vat_register1='Apply Vat';
		}
		
		
		}
		//VatButtonvalue = document.form1.VatButton.value;

if (document.form1.bandid)
		{
		var bandvalue='';
		bandvalue=document.form1.bandid.value;
		//alert(bandvalue);
		}
		var vouchercode='';
		vouchercode=document.form1.vouchercode.value;
			//alert('hello world '+vat_register1+getvtno+getvatinfoformflag);
		x_shipping(arrqty, arrcheck, arrprodCode, country, arrprodid,vat_register1,getvtno,getvatinfoformflag,bandvalue,vouchercode,do_shipping_cb);
		//	x_shipping(arrqty, arrcheck, arrprodCode, country, arrprodid,do_shipping_cb);
		}	
	function do_shipping_cb(cartItems) {
	//	document.getElementById("cartItems").innerHTML=cartItems;

	var cartItems2=cartItems.split("|");
	
		document.getElementById("cartItems").innerHTML=cartItems2[0];
		document.getElementById("getvattable").innerHTML=cartItems2[1];
		document.getElementById("bandids").innerHTML=cartItems2[2];
		document.getElementById("states").innerHTML=cartItems2[3];
	}
	
	///////////////////////////////////////////////
	////////    UPDATE   /////////////////////////
	/////////////////////////////////////////////

function do_update_cb(cartItems) {
		document.getElementById("cartItems").innerHTML=cartItems;
	}
	function do_update() {
	document.form1.dcountry.selectedIndex=0;
		arrqty.length=0; 
		 arrcheck.length=0; 
		 arrprodCode.length=0; 
		 arrprodid.length=0; 
		 count=0;
		count=(document.form1.qty.length); 
		
		if (count>1) {
					 var m=0;
						for(i=0;i<count;i++) 
						{ 
							arrqty[i] = document.form1.qty[i].value;
							arrprodCode[i] = document.form1.prodCode[i].value;
							arrprodid[i] = document.form1.prodid[i].value;
							
								if (document.form1.check[i].checked==true) 
								{ 
								arrcheck[m] = document.form1.check[i].value;
								m=m+1; 
								}else if(document.form1.check.checked==true){  
								arrcheck[0] = document.form1.check.value;
								} 
						} 
		} 
		else { 
				
					arrqty[0] = document.form1.qty.value;
					arrprodCode[0] = document.form1.prodCode.value;
					arrprodid[0] = document.form1.prodid.value;
							
							if (document.form1.check.checked==true) 
							{ 
							arrcheck[0] = document.form1.check.value;
							} 
						} 
				var country='';
			country = document.form1.dcountry.value;
			x_update(arrqty, arrcheck, arrprodCode, country, arrprodid, do_update_cb);
		}	
		



	function do_euvatdisplay_cb(vatdisplayflag) {
		document.getElementById("vatdisplayflag").innerHTML=vatdisplayflag;
	}
	
	function do_euvatdisplay() {
	country = document.form1.dcountry.value;
	x_euvatdisplay(country,do_euvatdisplay_cb);
		}		