// JavaScript Document

function refreshbids(catId) {
	/*var ajax = getXMLHttpRequestObject();
	if (ajax) {
		ajax.open('get', 'currentbids.cfm?CatID=' + catId, true);
		ajax.onreadystatechange = function() {
			handleResponse(ajax);
		}
		ajax.send(null);
		//alert("Got this far")
	}
	else
	{*/
		location = "bid4items.cfm?CatID=" + catId;
	//}
}

function handleResponse(ajax) {
	if (ajax.readyState == 4) {
		if ((ajax.status == 200) || (ajax.status == 304)) {
			var data = ajax.responseXML;
			var bidtypes = data.getElementsByTagName('bidtype');
			var bidvalues = data.getElementsByTagName('bidvalue');
			var bidders = data.getElementsByTagName('bidder');
			if (bidvalues.length > 0) {
				for (var i=0; i<bidvalues.length; i++) {
					n = i + 1;
					strLen = (document.getElementById("bidtype"+n).childNodes[0].data.length);
					document.getElementById("bidtype"+n).childNodes[0].replaceData(0,strLen,bidtypes[i].firstChild.nodeValue);
					strLen = (document.getElementById("bidvalue"+n).childNodes[0].data.length);
					document.getElementById("bidvalue"+n).childNodes[0].replaceData(0,strLen,bidvalues[i].firstChild.nodeValue);
					if (bidders[i].firstChild.nodeValue != "None") {
						strLen = (document.getElementById("bidder"+n).childNodes[0].data.length);
						document.getElementById("bidder"+n).childNodes[0].replaceData(0,strLen,bidders[i].firstChild.nodeValue);
					}
				}
			}
		}
	}
	
}
