// JavaScript Document
// JavaScript Document
var xmlhttp = false;
var xmlhttp1 = false;
var xmlhttp2 = false;
//Check if we are using IE.
try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	xmlhttp1 = new ActiveXObject("Msxml2.XMLHTTP");
	xmlhttp2 = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp1 = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp2 = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
	xmlhttp = false;
	xmlhttp1 = false;
	xmlhttp2 = false;
	}
}
//If we are using a non-IE browser, create a JavaScript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}
if (!xmlhttp1 && typeof XMLHttpRequest != 'undefined') {
	xmlhttp1 = new XMLHttpRequest();
}
if (!xmlhttp2 && typeof XMLHttpRequest != 'undefined') {
	xmlhttp2 = new XMLHttpRequest();
}	
	

function ChangePrice(productid)
{
	var objId = "price";
	var objId1 = "quantity";
	var ServerPage = "getproductprice.php?productid="+productid;
	var objNew = document.getElementById(objId)
	xmlhttp.open("GET",ServerPage)
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			objNew.innerHTML = xmlhttp.responseText;
		}
	}
	var ServerPage1 = "getproductqty.php?productid="+productid;
	//var objNew1 = document.getElementById(objId1)
	xmlhttp1.open("GET",ServerPage1)
	xmlhttp1.onreadystatechange = function() {
		if (xmlhttp1.readyState == 4 && xmlhttp1.status == 200) {
			document.productdetails.stockqty.value = xmlhttp1.responseText;
		}
	}
xmlhttp.send(null);
xmlhttp1.send(null);
}

function ChangeStyle(sizeid)
{
	//alert(size);
	var objId = "prod_style";
	var objId1 = "quantity";
	var ServerPage = "getproductstyle.php?sizeid="+sizeid;
	var objNew = document.getElementById(objId)
		//alert("tges" + objNew.innerHTML);
	xmlhttp2.open("GET",ServerPage)
var msg = ""
	xmlhttp2.onreadystatechange = function() {
		if (xmlhttp2.readyState == 4 && xmlhttp2.status == 200) {
			msg = xmlhttp2.responseText
			//alert("msg " + msg)
			objNew.innerHTML = msg;
		}
	}

xmlhttp2.send(null);
}	

