var xmlHttp		

function showHint1()
{

		if(document.getElementById("name").length!=0)
			var name=document.getElementById("name").value;
			//alert(city);
		if(document.getElementById("lastname").length!=0)
			var lastname=document.getElementById("lastname").value;
		
		if(document.getElementById("phone").length!=0)
			var phone=document.getElementById("phone").value;
			//alert(address);
		if(document.getElementById("zip").length!=0)
			var zip=document.getElementById("zip").value;
		//alert(zip);
				
			if(document.getElementById("hid1").length!=0)
			var page=document.getElementById("hid1").value;
			else if(pageNum!=0)
				page=pageNum;
		//alert(page);
		
		xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
			alert ("Browser does not support HTTP Request");
			return;
			}

		
		var url="dqs_inc.php";
		url=url+"?nm="+name;
		url=url+"&lnm="+lastname;
		url=url+"&phn="+phone;
		url=url+"&zp="+zip;
		url=url+"&page="+page;
		url=url+"&sid="+Math.random();
		
		
		xmlHttp.onreadystatechange=stateChanged ;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		Tooltip.init();
} 


function stateChanged() 
		{ 
			//alert("=>"+xmlHttp.readyState);
			//alert(xmlHttp.Status);
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{
				var response=xmlHttp.responseText;
			//alert(response);
				//document.getElementById("test").innerHTML=response; 
				var rsltRows=response.split("~~!~~");
				var sReturn='<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#5E99A0" class="text" >';
				sReturn +='<tr bgcolor="#fcf4e7">';
                sReturn +='<td width="182" height="20" bgcolor="#7AACB2" class="headig-white-small2">Name</td>';
                sReturn +='<td width="187" height="20" bgcolor="#7AACB2" class="headig-white-small2">Address</td>';
                sReturn +='<td width="126" height="20" bgcolor="#7AACB2" class="headig-white-small2">Phone#</td>';
				sReturn +='<td width="84" height="20" bgcolor="#7AACB2" class="headig-white-small2">Zip</td>';
                sReturn +='<td width="168" height="20" bgcolor="#7AACB2" class="headig-white-small2">Specialization</td>';
                sReturn +='</tr>';
				rsltRowslen=rsltRows.length-1
				for(i=0; i< rsltRowslen; i++)
				{
					var colData=rsltRows[i].split("@");         
					var colCount=colData.length;
					sReturn +='<tr  bgcolor="#fcf4e7">';
					 
					rowBgColor=(i%2==0)?'#F7FBFC' :'#D5ECEF';
					
					for(j=1; j< 2; j++)	
					{
						var docid=colData[0];
						sReturn +="<td height='10' bgcolor='"+rowBgColor+"' id=row_"+i+"_"+j+"><a href='doctor_details.php?aid="+docid+"&page="+'dqs'+"' class='data'>"+colData[j]+"</td>";

					}
					for(j=2; j< colCount; j++)	
					{
						var docid=colData[0];
						sReturn +="<td height='10' class='text' bgcolor='"+rowBgColor+"' id=row_"+i+"_"+j+">"+colData[j]+"</td>";

					}
				sReturn +="</tr>";

				}
				sReturn +='<tr><td colspan="6" id="page" name="page">'+rsltRows[rsltRowslen]+'</td></tr>';
				sReturn +="</table>";
					document.getElementById("resultData").innerHTML=sReturn; 

						} 
		
		} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
} 

function showHint2(page)
{
		if(document.getElementById("name").length!=0)
			var name=document.getElementById("name").value;
			if(document.getElementById("lastname").length!=0)
			var lastname=document.getElementById("lastname").value;
		
			//alert(city);
		if(document.getElementById("phone").length!=0)
			var phone=document.getElementById("phone").value;
			//alert(address);
		if(document.getElementById("zip").length!=0)
			var zip=document.getElementById("zip").value;
		//alert(zip);
				
		/*	if(document.getElementById("hid1").length!=0)
			var page=document.getElementById("hid1").value;
			else if(p!=0)*/
			var	page=page;
		//alert(page);
		
		xmlHttp=GetXmlHttpObject()
			if (xmlHttp==null)
			{
			alert ("Browser does not support HTTP Request");
			return;
			}

		
		var url="dqs_inc.php";
		url=url+"?nm="+name;
		url=url+"&lnm="+lastname;
		url=url+"&phn="+phone;
		url=url+"&zp="+zip;
		url=url+"&page="+page;
		url=url+"&sid="+Math.random();
		
		
		xmlHttp.onreadystatechange=stateChanged ;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
} 


