function FillBox(Element)
{
	if ( Element.value == "")
	{
		Element.value = "Produktsuche ...";		
	}
	
}

function HideResponseBox()
{
	document.getElementById("LiveSearchResponseBox").style.display = "none";
}

function ClearBox(Element)
{
	if ( Element.value == "Produktsuche ...") Element.value = "";	
}

function SendLiveSearchRequest(Element)
{
	if( Element.value.length >= 3)
	{
		document.getElementById("LiveSearchResponseBox").style.display = "block";
		WriteContent("Es wird gesucht ...");
		
		if (window.XMLHttpRequest)
		{
			httpRequest = new XMLHttpRequest();
		}
		else if (window.ActiveXObject)
		{
			httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}		
		
		httpRequest.open('GET', 'http://www.digittrade.de/shop/livesearch.php?SearchValue=' + Element.value , true);
		httpRequest.onreadystatechange = GetLiveSearchRespons;
		httpRequest.send(null);	
	}
}

function GetLiveSearchRespons()
{	
	if (httpRequest.readyState == 4) WriteContent(httpRequest.responseText);
}

function WriteContent(Content)
{
	closeimg = '<a href="javascript:HideResponseBox();"><img src="http://www.digittrade.de/shop/templates/digittrade10/img/close.png" class="CloseImg"/></a>';
	document.getElementById("LiveSearchResponse").innerHTML = closeimg + Content;
}
