function InitAjax()
{
	var ajax=false;
	try
	{
		ajax = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try 
		{
			ajax = new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch (E)
		{
			ajax = false;
		}
	}
	if (!ajax && typeof XMLHttpRequest!='undefined')
	{
		ajax = new XMLHttpRequest();
	}
	return ajax;
}

function getEbays(keyword,div)
{
	if(typeof(keyword) == 'undefined')
	{
		return false;
	}

	var url = "ebay/ebay.php?keystr="+ keyword;
	var show = document.getElementById(div);
	
	var ajax = InitAjax();
	
	ajax.open("GET", url, true);
	
	ajax.onreadystatechange = function() 
	{
		if (ajax.readyState == 4 && ajax.status == 200)
		{
			if(ajax.responseText.length>10)
			{
				show.style.width = '160px';
				show.style.border = "#666 1px dotted";
				show.style.background = "#FFFFEE";
				show.style.margin = "0px 0px 0px 20px";
				
				
				show.innerHTML = ajax.responseText;
				show.style.display="";
			}
			else
			{
				show.style.display="none";
			}
		}
	}
	
	ajax.send(null);
}
