function showDiv(id) { 
	document.getElementById(id).style.display = ''; 
} 
function hideDiv(id) { 
	document.getElementById(id).style.display = 'none'; 
}

function ajax_search_start2(str, type) {
	if (typeof(id) != 'undefined') { 
		clearTimeout(id);
	}
	id = setTimeout("ajax_search2('"+str+"', '"+type+"')", 500);

	return id;
}

function ajax_search2(str, type) {
   var xmlHttp;

   try {
        xmlHttp=new XMLHttpRequest();
    }
    
	catch(e) {
        try {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e) {
            try {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e) {
                return false;
            }
        }
    }

			document.getElementById("search_list2").style.display='';
    xmlHttp.onreadystatechange=function() {
        if(xmlHttp.readyState==4) {
            var data = xmlHttp.responseText.split("|");
			showDiv("search_list2");
			document.getElementById("search_list2").innerHTML = data[0];
		} 	
	}
var parameters = "1"; 

  	xmlHttp.open("GET","ajax_search2.php?type="+type+"&str="+str,true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length", parameters.length);
    xmlHttp.setRequestHeader("Connection", "close");
    xmlHttp.send(parameters);
}
