function entsub(myform) {
  if (window.event && window.event.keyCode == 13)
    myform.submit();
  else
    return true;}

	function createRequestObject(){
	var request_o; //declare the variable to hold the object.
	var browser = navigator.appName; //find the browser name
	if(browser == "Microsoft Internet Explorer"){
		/* Create the object using MSIE's method */
		request_o = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		/* Create the object using other browser's method */
		request_o = new XMLHttpRequest();
	}
	return request_o; //return the object
}

var http = createRequestObject(); 


function gosearch() {

        var search2 = document.forms[0].search.value;
	var flag = document.forms[0].searched_flag.value;
	var action = document.forms[0].action.value;
        http.open('post', action, true);
        http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        http.onreadystatechange = handleProducts; 
        http.send('item=' + search2+ '&searched_flag=' + flag);

}

function handleProducts(){

	document.getElementById('progress1').style.visibility = "visible";
	
	if(http.readyState == 4){ //Finished loading the response
		document.getElementById('progress1').style.visibility = "hidden";
		
		var response = http.responseText;
		document.getElementById('product_cage').innerHTML = response;
	}
}
