var xmlHttp

function showHint(str,filename)
{
	if (str.length==0)
  { 
  document.getElementById("txtHint").innerHTML=""
  return
  }
//alert('xxxxxxxxxxxx');
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Browser does not support HTTP Request")
  return
  }
 

		/* if(fiename='showDetail.php')
		 {
			//alert(filename);
			nowDates = str.split("-");	 
			var url="ajax/"+filename
			url=url+"?mm="+nowDates[0]
			url=url+"&dd="+nowDates[1]
			alert(nowDates[1]);
		
		 }
		 else if(fiename='getData.php')
		 {
			//alert(filename);
			var url="ajax/"+filename
			url=url+"?q="+str
			
		}
 */
 	//alert(str);
	var url="ajax/"+filename
	url=url+"?q="+str
	xmlHttp.onreadystatechange=stateChanged 
	xmlHttp.open("GET",url,true)
	// alert(xmlHttp)
	xmlHttp.send(null)

} 

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 	

	/*// create a DIV element, using the variable eDIV as a reference to it
	eDIV = document.createElement("div");
	//use the setAttribute method to assign it an id
	eDIV.setAttribute("id","myDiv");
	// append your newly created DIV element to an already existing element.
	document.getElementById("txtHint").appendChild(eDIV);

	document.getElementById("txtHint").firstChild.nodeValue=xmlHttp.responseText*/
	document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
	//xmlHttp = null;
 } 
}


// return the create

/*function GetXmlHttpObject()
{
	var xmlHttp;
	if(window.XMLHttpRequest){
	xmlHttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject){
	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	if (!xmlHttp){
	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
}
return xmlHttp;
}*/

function GetXmlHttpObject()
{
var xmlHttp;
try
 {
	 // Firefox, Opera 8.0+, Safari
	 xmlHttp=new XMLHttpRequest();
	// alert('mozila')
 }
catch (e)
 {
	 // Internet Explorer
	 try
	  {
	     xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		//alert('IE5');
	  }
	 catch (e)
	  {
		
		 xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
		 //alert('IE1');
	 
	  }
 }
return xmlHttp; 
}

/*var xmlHttp=null
if (window.XMLHttpRequest)
  {
  xmlHttp=new XMLHttpRequest()
  }
else if (window.ActiveXObject)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
return xmlHttp
}*/