var req;
var blReq;
var sReq;
var upReq;
var downReq;
var crReq;
function Initialize()
{
	try
	{
		sReq = new ActiveXObject("Msxml2.XMLHTTP");
		req = new ActiveXObject("Msxml2.XMLHTTP");
		blReq = new ActiveXObject("Msxml2.XMLHTTP");

		upReq = new ActiveXObject("Msxml2.XMLHTTP");
		downReq = new ActiveXObject("Msxml2.XMLHTTP");
		crReq = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch(e)
	{
		try
		{
			sReq = new ActiveXObject("Microsoft.XMLHTTP");
			req = new ActiveXObject("Microsoft.XMLHTTP");
			blReq = new ActiveXObject("Microsoft.XMLHTTP");

			upReq = new ActiveXObject("Microsoft.XMLHTTP");
			downReq = new ActiveXObject("Microsoft.XMLHTTP");
			crReq = new ActiveXObject("Microsoft.XMLHTTP");


		}
		catch(oc)
		{

			sReq = null;
			req = null;
			blReq = null;

			upReq = null;
			downReq = null;
			crReq = null;


		}
	}

	if(!req&&typeof XMLHttpRequest!="undefined")
	{

		sReq = new XMLHttpRequest();
		req = new XMLHttpRequest();
		blReq = new XMLHttpRequest();

		upReq = new XMLHttpRequest();
		downReq = new XMLHttpRequest();
		crReq = new XMLHttpRequest();


	}

}

function getData(item_num)
	{
	Initialize();
    //ShowDiv("contentLoading");
    HideDiv("item_description_demo");
	var url="http://#cgi.SERVER_NAME#/webservices/getData.cfm?objectid="+item_num;
   	if(req!=null)
	{
           req.onreadystatechange = Process;
		req.open("GET", url, true);
		req.send(null);
	}
}
function Process()
{
	if (req.readyState == 4)
		{
		// only if "OK"
			if (req.status == 200)
			{
				if(req.responseText=="")
					HideDiv("item_description_demo");
				else
				{

					ShowDiv("item_description_demo");
					document.getElementById("item_description_demo").innerHTML =req.responseText;
                     //HideDiv("contentLoading");

				}
			}
			else
			{
				document.getElementById("item_description_demo").innerHTML=
					"There was a problem retrieving data:<br>"+req.statusText;
			}
		}
}

function ShowDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="show";
   else document.getElementById(divid).style.visibility="visible";
}

function HideDiv(divid)
{
   if (document.layers) document.layers[divid].visibility="hide";
   else document.getElementById(divid).style.visibility="hidden";
}

