function hkecLogGetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } function hkecLogSearchRequestLog(tool_code, search_string, search_type) { xmlHttp=hkecLogGetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="/tools/search_log/handler.php"; //url=url+"?actionID=SEARCH_REQUEST"; //url=url+"&tool_code="+encodeURI(tool_code); //url=url+"&search_string="+encodeURI(search_string); //url=url+"&search_type="+encodeURI(search_type); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { //alert(xmlHttp.responseText); } } var logParam = ""; logParam=logParam+"actionID=SEARCH_REQUEST"; logParam=logParam+"&tool_code="+encodeURIComponent(tool_code); logParam=logParam+"&search_type="+encodeURIComponent(search_type); logParam=logParam+"&search_string="+encodeURIComponent(search_string); // alert (url); xmlHttp.open("POST",url,false); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", logParam.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.send(logParam); } function hkecLogSearchRequestTrim(value) { var temp = value; var obj = /^(\s*)([\W\w]*)(\b\s*$)/; if (obj.test(temp)) { temp = temp.replace(obj, '$2'); } var obj = / +/g; temp = temp.replace(obj, " "); if (temp == " ") { temp = ""; } return temp; }