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 go() {

	var myForm = document.forms[0];
	var make = myForm.sel_manufacture;
	var make2 = make.options[make.selectedIndex].value;

	var type = myForm.sel_type;
	var type2 = type.options[type.selectedIndex].value;

	var cc = myForm.sel_cc;
	var cc2 = cc.options[cc.selectedIndex].value;

	var action = myForm.action.value;
	if(make2 !== 'none' && type2 !== 'none' && cc2 !== 'none') {
	http.open('post',  action, true);
	
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http.onreadystatechange = handleProducts; 
	http.send('sel_manufacture=' + make2.toUpperCase() + '&sel_cc=' + cc2 + '&sel_type=' + type2);
	}

}

function gosearch() {

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

}

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;
	}
}
