

/////////////////////////////////////////////////////////Ajax Code ////////////////////////////////////////////////
var myDDL
function FillDDL(objmySelect,sqlStr,opt3)
  {
		 
  var baseURL="Ajax.asp?Cnt="+opt3+"&Amt="+sqlStr+"&Stat="+objmySelect;
  var url=baseURL
   myDDL=objmySelect;
     
      if(window.XMLHttpRequest)
                      {
       xmlhttp=new XMLHttpRequest()
                         xmlhttp.onreadystatechange=FillDDLState_Change
                         xmlhttp.open("GET",url,true)
                         xmlhttp.send(null)
       
                      }
                   else if (window.ActiveXObject)  //code for IE
                      {
         
                        try
                         {
           
                          xmlhttp= new ActiveXObject("Msxml2.XMLHTTP");
                          }
                        catch(e)
                         {
                           try
                            {
                               xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
                            }
                           catch(e){}
                        }
                        
                         if(xmlhttp)
                           {
                             try
                             {
        
                               xmlhttp.onreadystatechange=FillDDLState_Change
                               xmlhttp.open("GET",url,false)
                               xmlhttp.send()
                             }
                             catch(e){}  
                           }
                 }
          }
    function shipping(shipCnt,id)
	{
	
		
			var url="shippingCnt.asp?ship_cnt="+shipCnt+"&storeid="+id
		//	alert(url)
			xmlHttp=GetXmlHttpObject(stateChanged)
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 
				xmlHttp.open("GET", url , true)
				xmlHttp.send(null)
		
	}
  
 
 
 
 function stateChanged() 
{
	//alert(xmlHttp.responseText)
  if(xmlHttp.readyState==4 && xmlHttp.status==200)
        {
			 if(window.XMLHttpRequest)
			  {
					   var xmlDoc = document.implementation.createDocument;
						xmlDoc=xmlHttp.responseXML;
						
						var rows = xmlDoc.getElementsByTagName('db_row')
					
			  }
			 else 
			 { 
						
			var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
			   xmlDoc.async="false";
				  xmlDoc.loadXML(xmlHttp.responseText);
					var rows = xmlDoc.getElementsByTagName('db_row')
			 
				}
				if (rows.length>1)
					{			
						 if (xmlDoc.documentElement.hasChildNodes)
						 {
							
							document.getElementById("cmbShip").innerHTML=""
							
							 
						   for(var i=0;i<rows.length;i++)
						   {
								var newOpt=new Option(rows[i].getAttribute("value"),rows[i].getAttribute("id"));
								 document.getElementById("cmbShip").options[i] = newOpt;
						   } 
							document.getElementById("cmbShip").value = document.getElementById("selectship").value;
						 }
					
					}
					document.getElementById('loadimg').style.display='none';
					document.getElementById('BillingCountry').style.display='';
		}
} 

function GetXmlHttpObject(handler)
{ 
	var objXmlHttp=null
	
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		alert("This doesn't work in Opera") 
		return 
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{ 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		} 
		try
		{ 
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler                
			return objXmlHttp
		} 
		catch(e)
		{ 
			alert("Error. Scripting for ActiveX might be disabled") 
			return c
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
	}
} 

         function FillDDLState_Change()
          {
      
           if(xmlhttp.readyState==4&&xmlhttp.status==200)
      		{
     			      var str=xmlhttp.responseText;
				   var arr=str.split("/");
					id=document.getElementById("tax");
					id1=document.getElementById("txtTax");
					 id3=document.getElementById("taxRatecart");
					 id4=document.getElementById("txtGTotal");
				   id.value=arr[0];
				   id1.value=arr[0];
				   id3.value=arr[1];
					 id4.value=arr[2];
			  
              }
  }
/////////////////////////////////////////////////////////Ajax Code End here////////////////////////////////////////////////