﻿// JScript File
function UpdateQuantity(ColourId,Qty)
{
    var SID = document.getElementById("leftcol1_hdnSid").value;
   // var QID = ControlName.substring(ControlName.lastIndexOf('_') + 1);
    var PageUrl = "UpdateBasket.aspx?Qty=" + Qty + "&TID=" + ColourId + "&SID=" + SID +"&rand="+Math.floor(Math.random()*100000000);
   //alert(PageUrl);
    var BasketData = ReturnXmlData(PageUrl);
   return BasketData;
}

function ReturnXmlData(PageName)
{
	var XmlHttp;
	if( !window.XMLHttpRequest && window.ActiveXObject ) 
	{
		window.XMLHttpRequest = function() 
		                        {
		                            var a = [ "Microsoft.XMLHTTP", "Msxml2.XMLHTTP", "Msxml2.XMLHTTP.3.0", "Msxml2.XMLHTTP.4.0", "Msxml2.XMLHTTP.5.0" ],i = a.length; 
		                            while(i--)
		                            {
					                    try 
					                    {    
					                        return new ActiveXObject( a[i] );
					                    } 
					                    catch (e) {}
					                }
				                    return null;
				                };
	}
	
	if (window.XMLHttpRequest)
	{
		XmlHttp = new XMLHttpRequest();
	}
	if (!XmlHttp)
		alert( 'Sorry, creating the XMLHttpRequest object failed.' );
	else
	{
	    XmlHttp.open("Get",PageName,false);
		XmlHttp.send(null);		
		return XmlHttp.responseText;
		
	}
}
