	// JavaScript Document
	// XMLHTTPRequest Enable
	function createObject() {
		var request_type;
		var browser = navigator.appName;
		if(browser == "Microsoft Internet Explorer"){
			request_type = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			request_type = new XMLHttpRequest();
		}
		return request_type;
	}
	
	var http = createObject();
	
	// SEARCH
	function searchNameq() {
		searchq = encodeURI(document.getElementById('product_search').value);
		
		http.open('get', root+'ajax/in_search.php?name='+searchq);
		http.onreadystatechange = searchNameqReply;
		http.send(null);
	}
	
	function searchNameqReply() {
		if(http.readyState == 4){
			//alert(http.responseText);
			var response = http.responseText;
			if(response){
				document.getElementById("search-result").style.display = "block";
				document.getElementById('search-result').innerHTML = response;
			}else{
				document.getElementById("search-result").style.display = "none";
				document.getElementById('search-result').innerHTML = "";
			}
		}
	}
	
	function fill(thisValue) {
		document.getElementById('product_search').value = thisValue;
	}
